REST Workflow API
Create / Update Workflow Details
Creates / updates a workflow definition.
General Info
URL Pattern |
/manage/workflow |
Method |
POST |
Parameters |
- |
Content types |
application/json |
Media types |
application/json |
Result |
Workflow creation / update |
Content
The content has to be a JSON object which includes the properties listed below.
Workflow
Field |
Required |
Default |
Datatype |
Parameter description |
Example |
identifier |
yes |
n/a |
String |
Unique identifier of the workflow. |
Workflow1 |
label |
no |
n/a |
String |
Short description of the workflow and its purpose. |
|
status |
no |
n/a |
List of Status |
List of status definitions |
|
version |
no, but should be given |
0.0 |
Decimal |
This gives a version to the current workflow stored. If a version is stored once, it cannot be modified. To add or delete new status entries e.g. you have to send the workflow data with a newer version! |
1.0 |
Status
Field |
Required |
Default |
Datatype |
Parameter description |
Example |
status |
yes |
n/a |
String |
Unique identifier of the status. |
Status1 |
displayOrder |
no |
n/a |
Integer |
Position of the status within the workflow. |
1 |
workflowTask |
no |
n/a |
Task |
Workflow task that should be generated for this workflow status. |
{ "container" : "1" , "containerEntityId" : "MasterCatalog" , "entity" : "Article" } |
rejectDecision |
no |
n/a |
WorkflowDecision |
WorkflowDecision containing all reject possibilities and also the content for the corresponding reject dialog that will be shown to the user. Relevant for approval workflows where an user can approve/reject at a specific point in the workflow process. |
{ "label" : "Title of the dialog" , "singleChoice" : false , "decisions" : [{ "label" : "Classification" , "id" : "executeClassification" }, { "label" : "Spanish translation" , "id" : "executeSpanishTranslation" }] } |
WorkflowDecision
Field |
Required |
Default |
Datatype |
Parameter description |
Example |
label |
yes |
n/a |
String |
The text for the title of the dialog |
|
singleChoice |
no |
false |
Boolean |
Defines if the children workflow decisions are interpreted in the dialog as radio button group (true), or check boxes (false) |
|
id |
no |
n/a |
String |
This identifier will be transmitted to the Informatica BPM if the corresponding decision is marked as rejected by the user. The existence of this identifier can than be used on Informatica BPM side to enter a different path in the workflow process for example. |
|
decisions |
no |
n/a |
ArrayList<WorkflowDecision> |
Possibility of defining a hierarchical reject dialog, combining for example radio button groups with sub ordinary check boxes. |
Result
Properties
Field |
Data type |
Description |
List |
ResultSummary[] |
Counters indicating the number of created, updated and failed entities. |
Example
Create workflow
Request
{
"identifier"
:
"Workflow1"
,
"label"
:
"First Workflow"
,
"status"
: [
{
"status"
:
"Status1"
,
"workflowTask"
: {
"container"
:
"1"
,
"containerEntityId"
:
"MasterCatalog"
,
"entity"
:
"Article"
}
}
{
"status"
:
"Status2"
},
]
}
Result
{
createdCounter: 2
updatedCounter: 2
failedCounter: 0
}
Create workflow with tasks for supplier and P360 user
Use POST request like http://<server>:<port>/rest/V1.0/manage/workflow
{
"identifier"
:
"Workflow with Supplier Task"
,
"label"
:
"Workflow with Supplier Task"
,
"status"
: [
{
"status"
:
"Enrich data"
,
"displayOrder"
: 1,
"workflowTask"
: [
{
"name"
:
"Enrich data: Task for Supplier"
,
"entity"
:
"Article"
,
"supplier"
:
"SUPPLIER_FOR_TASKS"
,
"workflowServiceEndpoint"
:
"Enrich_Data_Completed"
,
"container"
: {
"id"
:
"'CATALOG_OF_SUPPLIER_FOR_TASKS'"
}
}
]
},
{
"status"
:
"Approve supplier data"
,
"displayOrder"
: 2,
"workflowTask"
: [
{
"name"
:
"Approve supplier data: Task for P360 User"
,
"entity"
:
"Article"
,
"user"
:
"P360_USER"
,
"workflowServiceEndpoint"
:
"Approve_Data_Completed"
,
"container"
: {
"id"
:
"'CATALOG_OF_SUPPLIER_FOR_TASKS'"
}
}
]
}
]
}
Get Workflow Details
Get a workflow definition.
General Info
URL Pattern |
/manage/workflow/{workflowIdentifier} |
Method |
GET |
Parameters |
- |
Content types |
application/json |
Media types |
application/json |
Result |
Workflow details |
Parameters
Workflow
Field |
Required |
Default |
Datatype |
Parameter description |
Example |
workflowIdentifier |
yes |
n/a |
String |
Unique identifier of the workflow. |
Workflow1 |
resolveWorkflowTasks |
no |
false |
boolean |
If set to true, the workflow task information is resolved, too |
|
includeObsoletes |
no |
false |
boolean |
If true, status entries which are not available in the newest version of the workflow, will be resolved, too. Otherwise obsolete status entries will not be shown |
Example
Request
Result
{
"identifier"
:
"Workflow1"
,
"label"
:
"First Workflow"
,
"status"
: [
{
"status"
:
"Status1"
,
"displayOrder"
: 1 },
{
"status"
:
"Status2"
,
"displayOrder"
: 2 }
]
}
Enter Workflow Process Status
Enters a specific status within the workflow process. If a WorkflowTask is related to the status, this call adds the entity to it.
General Info
URL Pattern |
/manage/workflow/status/enter |
Method |
POST |
Parameters |
- |
Content types |
application/json |
Media types |
application/json |
Result |
success result |
Content
The content has to be a JSON object which includes the properties listed below.
Field |
Required |
Default |
Datatype |
Parameter description |
Example |
processId |
yes |
n/a |
String |
Unique identifier of the workflow instance. |
'1234567' |
workflowId |
yes |
n/a |
String |
Unique identifier of the workflow itself |
'workflowXYZ' |
status |
yes |
n/a |
String |
A status name |
'stateA', 'stateB' |
entity |
yes |
n/a |
String |
The entity name |
'Article', 'Variant' or 'Product2G' |
itemId |
yes |
n/a |
String |
The itemids in the typical service API syntax |
'1234@1' |
resetAcceptUser |
no |
true |
boolean |
If the item was previously accepted by an user, the user is reset and the item available to the usergroup again (since 8.0.01) |
'true' |
hint |
no |
n/a |
String |
A comment field, which can be sent to the server, when this status has been entered |
Example
Request
{
"processId"
:
"4711"
,
"workflowId"
:
"Workflow1"
,
"status"
:
"Status1"
,
"entity"
:
"Article"
,
"hint"
:
"Comment for Status1"
,
"itemId"
: [
"123@1"
]
}
Result
{
"successful"
:
true
,
"canNotFindItem"
:
false
,
"canNotFindWorkflowId"
:
false
,
"workflowTaskNotFound"
:
false
}
Leave Workflow Process Status
Leaves a specific status within the workflow process. This call is only required in case no Workflow Task is assigned to the status. In this case PIM leaves the workflow process status implicitly.
General Info
URL Pattern |
/manage/workflow/status/leave |
Method |
POST |
Parameters |
- |
Content types |
application/json |
Media types |
application/json |
Result |
success result |
Content
The content has to be a JSON object which includes the properties listed below.
Field |
Required |
Default |
Datatype |
Parameter description |
Example |
processId |
yes |
n/a |
String |
Unique identifier of the workflow instance |
'1234567' |
status |
yes |
n/a |
String |
A status name |
'stateA', 'stateB' |
entity |
yes |
n/a |
String |
The entity name |
'Article', 'Variant' or 'Product2G' |
itemId |
yes |
n/a |
String |
The itemids in the typical service API syntax |
'1234@1' |
hint |
no |
n/a |
String |
A comment field, which can be sent to the server, when this status has been left |
Example
Request
{
"processId"
:
"4711"
,
"status"
:
"Status1"
,
"entity"
:
"Article"
,
"hint"
:
"Comment for Status1"
,
"itemId"
: [
"123@1"
]
}
Result
{
"successful"
:
true
,
"canNotFindItem"
:
false
}
End Workflow Process
Ends a workflow process and soft deletes all related status entries
General Info
URL Pattern |
/manage/workflow/process |
Method |
DELETE |
Parameters |
- |
Content types |
application/json |
Media types |
application/json |
Result |
- |
Parameters
Field |
Required |
Default |
Datatype |
Parameter description |
Example |
processId |
yes |
n/a |
String |
Unique identifier of the workflow instance |
'1234567' |
Example
Request
http:
//localhost:1512/rest/V1.0/manage/workflow/process?processId=9375
Get Workflow Process Status of an entity item per process
Resolves information about the current status entries related to a given workflow process
General Info
URL Pattern |
/manage/workflow/status |
Method |
GET |
Parameters |
- |
Content types |
application/json |
Media types |
application/json |
Result |
success result and status information |
Parameters
Field |
Required |
Default |
Datatype |
Parameter description |
Example |
processId |
yes |
n/a |
String |
Unique identifier of the workflow instance |
'1234567' |
entity |
yes |
n/a |
String |
The entity name |
'Article', 'Variant' or 'Product2G' |
itemId |
yes |
n/a |
String |
The itemids in the typical service API syntax |
'1234@1' |
Example
Request
http:
//localhost:1512/rest/V1.0/manage/workflow/status?itemId=30025@1&entity=Article&processId=9375
Result
{
"noItemFound"
:
false
,
"statusList"
:[
{
"status"
:
"teststatusX"
,
"visits"
:1,
"duration"
:0,
"startTime"
:
"2015-04-17T16:41:41:950+0200"
,
"endTime"
:
"2015-04-17T16:41:41:957+0200"
}]
}
Add error message to the BPM perspective protocoll view
This can be used within catch exception events within a workflow, to add information to the bpm perspectives protocoll log view
General Info
URL Pattern |
/manage/workflow/message |
Method |
PUT |
Parameters |
- |
Content types |
application/json |
Media types |
application/json |
Result |
HTTP 201 |
Parameters
Field |
Required |
Default |
Datatype |
Parameter description |
Example |
message |
yes |
n/a |
String |
Error message |
'Workflow 1 - Process 1234 - Assign task to user xyz failed' |
severity |
no |
ERROR |
String |
The entity name |
ERROR, INFO, WARNING, CANCEL, OK |