Skip to main content
Version: 2.6

Workflows

HumanOS offers a comprehensive workflow engine (see PeMiL\Manual Workflow).

Gets All Workflows

Gets a list of all workflows.

HTTP Method:GET
HTTP Url:nodes/workflow
HTTP Query-Parameter:-
Request Content-Type-
Request Body-
Response Content-Typetext/xml
Response ContentStream

Example:

GET http://localhost:8081/nodes/workflow?id=bd971460-8700-4b9d-b23d-df5f45542d09

Get the Workflow

Gets the information about a workflow, like id, name, state and list of argument.

HTTP Method:GET
HTTP Url:nodes/workflow
HTTP Query-Parameter:id: Id of the workflow as System.Guid
Request Content-Type-
Request Body-
Response Content-Typetext/xml
Response ContentStream

Example:

GET http://localhost:8081/nodes/workflow?id=bd971460-8700-4b9d-b23d-df5f45542d09

Response Body:

<HumanOS.Stream>
<Workflow>
<Id>a706d8cc-12a8-4364-bc90-699cc80bcf71</Id>
<Name>MyWorkflow</Name>
<Property>
<Name>OwnNodes</Name>
<DataType>System.Boolean</DataType>
<Value>true</Value>
</Property>
<Property>
<Name>NodeState</Name>
<DataType>HumanOS.Kernel.Workflow.Activity.EActivityCoordinationNodeState</DataType>
<Value>Ready</Value>
</Property>
<Property>
<Name>AutoReset</Name>
<DataType>System.Boolean</DataType>
<Value>false</Value>
</Property>
<State>Ready</State>
<Argument name="Value1" datatype="System.String" calltype="Input" description=""/>
<Argument name="Value2" datatype="System.String" calltype="Input" description=""/>
</Workflow>
</HumanOS.Stream>

Starting a Workflow

Workflows can be started with or without additional arguments.

Starts a workflow WITHOUT arguments.

HTTP Method:POST
HTTP Url:nodes/workflow
HTTP Query-Parameter:id: Id of the workflow as System.Guid
Request Content-Type-
Request Body-
Response Content-Typetext/text
Response Content"OK"

Example:

POST http://localhost:8081/nodes/workflow?id=f9a4300a-654b-42cf-9f54-f866184b7352

Starts a workflow WITH arguments.

HTTP Method:POST
HTTP Url:nodes/workflow
HTTP Query-Parameter:id: Id of the workflow as System.Guid
Request Content-Typetext/xml
Request BodyArgument list
Response Content-Typetext/text
Response Content"OK"

Example:

Request Body:

<HumanOS.Stream>
<Workflow>
<Argument name="Arg1" datatype="System.String">Content string</Argument>
<Argument name="Arg2" datatype="System.Int32">-982</Argument>
</Workflow>
</HumanOS.Stream>
POST http://localhost:8081/nodes/workflow?id=f9a4300a-654b-42cf-9f54-f866184b7352

Access to Human Activities

Some workflows contain activities, that can only be performed by human beings or other external entities.

Get Pending Activities

Gets all pending activities, including their state and operations.

HTTP Method:GET
HTTP Url:activities/pending
HTTP Query-Parameter:none
Request Content-Type-
Request Body-
Response Content-Typetext/xml
Response ContentStream

Example:

GET http://localhost:8081/activities/pending

Response Body

<HumanOS.Stream>
<HumanProxy>
<Activity>
<Id>44fb36d9-d4d5-4de6-bed1-33415471ad76</Id>
<Name>Activity1</Name>
<State>Ready</State>
<Operation>
<Name>Step 1</Name>
<Description>First step.</Description>
<Instruction>Start the computer.</Instruction>
</Operation>
<Operation>
<Name>Step 2</Name>
<Description>Second step.</Description>
<Instruction>Login as Administrator.</Instruction>
</Operation>
</Activity>
</HumanProxy>
</HumanOS.Stream>

Start an Activity

Human can start a pending activity.

HTTP Method:POST
HTTP Url:activities/start
HTTP Query-Parameter:id: Id of the activity as System.Guid
Request Content-Type-
Request Body-
Response Content-Typetext/xml
Response Content"OK" if no error

Example:

POST http://localhost:8081/activities/start?id=44fb36d9-d4d5-4de6-bed1-33415471ad76

Terminate an Activity

Human can terminate his activity. The activity is removed from the list of pending activities.

HTTP Method:POST
HTTP Url:activities/terminate
HTTP Query-Parameter:id: Id of the activity as System.Guid
Request Content-Type-
Request Body-
Response Content-Typetext/xml
Response Content"OK" if no error

Example:

POST http://localhost:8081/activities/terminate?id=44fb36d9-d4d5-4de6-bed1-33415471ad76

Cancel an Activity

Human can cancel his activity. This will not cancel the workflow. The activity is removed from the list of pending activities.

HTTP Method:POST
HTTP Url:activities/terminate
HTTP Query-Parameter:id: Id of the activity as System.Guid
Request Content-Type-
Request Body-
Response Content-Typetext/xml
Response Content"OK" if no error

Example:

POST http://localhost:8081/activities/cancel?id=44fb36d9-d4d5-4de6-bed1-33415471ad76

Suspend an Activity

Human can suspend his activity. The suspended activity is kept in the pending activities and can be continued with "start".

HTTP Method:POST
HTTP Url:activities/suspend
HTTP Query-Parameter:id: Id of the activity as System.Guid
Request Content-Type-
Request Body-
Response Content-Typetext/xml
Response Content"OK" if no error

Example:

POST http://localhost:8081/activities/suspend?id=44fb36d9-d4d5-4de6-bed1-33415471ad76