Workflow Task and Dependency Web Services

Workflow Task and Dependency Web Services

Overview

Universal Controller supports the following RESTful-based web services for Workflow Task and Dependency operations, which are listed alphabetically on this page.

Formatting specifications for each web service, including details about parameter requirements, are provided.
 

Add a Dependency to a Workflow

 

Description

URI

http://host_name/uc/resources/workflow/edges

HTTP Method

POST

Description

Adds a dependency to a workflow, with the dependency represented by a workflowEdge. (See Example Request, below.)

URI Parameters

See Add a Dependency to a Workflow: URI Parameters, below.

Example URI

http://localhost:8080/uc/resources/workflow/edges?workflowname=workflow1

Consumes Content-Type

application/xml, application/json

Produces Content-Type

n/a

Example Request

See Add a Dependency to a Workflow: Example Request, below.

Add a Dependency to a Workflow Properties

See Add a Dependency to a Workflow: Properties, below.

Example Response

  • Status 200 /OK
    Successfully added a dependency between <sourceId> and <targetId>.

  • Status 400 /Bad Request
    Workflow <workflowName> doesn`t exist.

Add a Dependency to a Workflow: URI Parameters

Name

Description

Specifications

Required

Mutually Exclusive With

workflowid

ID used within the Controller to identify the workflow.

String; URI parameter.

Y
(unless workflowname
is specified)

workflowname

workflowname

Name used within the Controller to identify the workflow.

String; URI parameter.

Y
(unless workflowid
is specified)

workflowid

Add a Dependency to a Workflow: Example Request

XML

JSON

<workflowEdge> <condition>Success</condition> <points> <point x="280" y="300" /> </points> <sourceId>2</sourceId> <straightEdge>false</straightEdge> <targetId>3</targetId> </workflowEdge>

{ "condition": { "value": "Success" }, "points": [ { "x": "280", "y": "300" } ], "sourceId": { "value": "2" }, "straightEdge": false, "targetId": { "value": "3" } }

Add a Dependency to a Workflow: Request Properties

Property

UI Field Name

Description

Specifications

Required

Property

UI Field Name

Description

Specifications

Required

condition

n/a

Dependency condition between the source and target tasks of this dependency (connector).

Valid values:

  • Success

  • Failure

  • Success/Failure

  • Exit Code; Format: Numeric. Use commas to list a series of exit codes; use hyphens to specify a range. Example: 1,5, 22-30

  • Step Condition; Format: step:procedure:program:condition codes. Example: *:*:*:JCLERR

  • Variable


Default is Success.
 
For example:

 <condition>Success</condition>
   <condition>Failure</condition>
   <condition>Success/Failure</condition>
   <condition>1,5,22-30</condition>
   <condition>*:*:*:JCLERR</condition>
   <condition>S1:PROC1:PGM1:U016</condition>
   <condition type="Exit Code">1,5,22-30</condition>
   <condition type="Step Condition">*:*:*:JCLERR</condition>
   <condition type="Step Condition">*:*:*:S0C4</condition>
   <condition type="Step Condition">S1:PROC1:PGM1:U016</condition>
   <variableCondition>
           <firstValue>${_varToLowerCase('variableName')}</firstValue>
           <operator>=</operator>
           <secondValue>${var2}</secondValue>
   </variableCondition>


 
Step Condition is valid for z/OS tasks only.
 
Success/Failure and Failure are not valid for Workflow, Timer, and Manual tasks.
 

Note

The type attribute (type=) is optional for Exit Code and Step Condition. Based on the format of the condition, in most cases it is easily determined if the condition is Exit Code and Step Condition. If the condition cannot be determined, the type attribute can be checked.

N

points

n/a

If straightEdge is false; x and y coordinates of the Edge angles.

For example:
 

<points> <point x="280" y="300" /> </points>

N

sourceId

n/a

Vertex ID of the source task.

 

Y

straightEdge

n/a

Specification for whether the edge is straight or bent.

Boolean; Valid values: true/false. Default is true.

N

targetId

n/a

Vertex ID of the target task.

 

Y

Add a Task to a Workflow

 

Description

URI

http://host_name/uc/resources/workflow/vertices

HTTP Method

POST

Description

Adds a task to a workflow, with the task represented by a workflowVertex. (See Example Request, below.)

URI Parameters

See Add a Task to a Workflow: URI Parameters, below.

Example URI

http://localhost:8080/uc/resources/workflow/vertices?workflowname=workflow1

Consumes Content-Type

application/xml, application/json

Produces Content-Type

application/xml, application/json

Example Request

See Add a Task to a Workflow: Example Request, below.

Example Response

See Add a Task to a Workflow: Example Response (Status 200), below.

Add a Task to a Workflow Properties

See Add a Task to a Workflow: Request/Response Properties, below.

Example Response

  • Status 200 /OK
    Successfully added vertex with vertexId <vertextId>.

  • Status 400 /Bad Request
    Workflow <workflowName> doesn`t exist.

Add a Task to a Workflow: URI Parameters

Name

Description

Specifications

Required

Mutually Exclusive With

workflowid

ID used within the Controller to identify the workflow.

String; URI parameter.

Y
(unless workflowname
is specified)

workflowname

workflowname

Name used within the Controller to identify the workflow.

String; URI parameter.

Y
(unless workflowid
is specified)

workflowid

Add a Task to a Workflow: Example Request

XML

JSON

<workflowVertex> <alias>S30</alias> <task>Sleep 30</task> <vertexX>360</vertexX> <vertexY>60</vertexY> </workflowVertex>

{ "alias": "S30", "task": {
"value": "Sleep 30" }, "vertexX": "360", "vertexY": "60" }

 

Add a Task to a Workflow: Example Response (Status 200)

XML

JSON

<workflowVertex> <alias>S30</alias>
<conditionExpression /> <task>Sleep 30</task> <vertexId>9</vertexId>
<vertexX>360</vertexX> <vertexY>60</vertexY> </workflowVertex>

{ "alias": "S30",
"conditionExpression": null, "task": { "value": "Sleep 30" }, "vertexId": "9,
"vertexX": "360", "vertexY": "60" }

Add a Task to a Workflow: Request/Response Properties

Property

UI Field Name

Description

Specification

Required

alias

n/a

Alias used for the task added to the workflow; specifically, the value of ops_task_workflow_vertex.name.

 

N

conditionExpression

n/a

Boolean condition expression to specify the dependency criteria.

XML:

<conditionExpression>
    <condition>
        <vertexId>7</vertexId>
    </condition>
    <condition>
        <vertexId>10</vertexId>
    </condition>
    <compoundCondition>
        <condition>
            <vertexId>9</vertexId>
        </condition>
        <condition>
            <vertexId>7</vertexId>
        </condition>
        <logicalOperator>And</logicalOperator>
    </compoundCondition>
    <logicalOperator>Or</logicalOperator>
</conditionExpression>

JSON:

"conditionExpression": {
    "conditions": [
        {
            "type": "condition",
            "vertexId": "7"
        },
        {
            "type": "condition",
            "vertexId": "10"
        },
        {
            "type": "compoundCondition",
            "conditions": [
                {
                    "type": "condition",
                    "vertexId": "9"
                },
                {
                    "type": "condition",
                    "vertexId": "7"
                }
            ],
      "logicalOperator": "And"
        }
    ],
    "logicalOperator": "Or"
}

N

task

Task Name

Name of the task added to the workflow.

 

Y

vertexId

n/a

Vertex ID of the task added to the workflow.
 
Each task within a Workflow has a unique Vertex ID to distinguish it from other tasks of the same name, if any.

 

Y

vertexX

n/a

x-coordinate of the task added to the workflow.

Default is 0.

N

vertexY

n/a

y-coordinate of the task added to the workflow.

Default is 0.

N

List Dependencies in a Workflow

 

Description

URI

http://host_name/uc/resources/workflow/edges

HTTP Method

GET

Description

Returns the list of dependencies for all tasks in a workflow, with each dependency represented by a workflowEdge (see Example Response, below).

URI Parameters

See List Dependencies in a Workflow: URI Parameters, below.

Example URI

http://localhost:8080/uc/resources/workflow/edges?workflowname=workflow1

Authentication

HTTP Basic

Consumes Content-Type

n/a

Produces Content-Type

application/xml, application/json

Example Response

See List Dependencies in a Workflow: Example Response, below.

Response Properties

See List Dependencies in a Workflow: Properties, below.

List Dependencies in a Workflow: URI Parameters

Name

Description

Specifications

Required

Mutually Exclusive With

sourceid

Vertex ID of the source task.

String; URI parameter.

N

 

targetid

Vertex ID of the target task.

String; URI parameter.

N

 

workflowid