Example 6 (2 tasks (incl. 1 supplier task) + modifying of fields)
The next example extends the example 2 workflow with modifying of fields within the workflow after finishing the tasks,
Info
Please consider to define your trigger in Product 360 carefully, because if the initiator "Service API" is not excluded for this workflow will run in a loop!
Diagram for example 6
Product 360 prerequisites for example 6
Product 360 entity |
value |
Usergroup |
Standardusers |
Ui Template |
Item approve UI |
Explanation of the steps example 6
Step |
Description |
0 |
Check whether item is already in this workflow |
1 |
Put the item into the supplier task "My task 1" |
2 |
Modify the field Article.CurrentStatus to the value 200 |
3 |
Put the item into the task "My task 2" |
4 |
Modify the field Article.CurrentStatus to the value 300 |
StepWorkflow.xml file for example 6
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
imp
:payload
xmlns:imp
=
"http://www.informatica.com/schema/ItemMap"
contentType
=
"string"
>
<
workflow
>
<
label
>Example Workflow 6</
label
>
<
identifier
>Workflow_06</
identifier
>
<
version
>1.0</
version
>
<
step
>
<
id
>0</
id
>
<
entity
>Article</
entity
>
<
enterStatus
>Never</
enterStatus
>
<
batchSize
>500</
batchSize
>
<
executeDq
>Always</
executeDq
>
<
dqService
>ItemsInWorkflowTasks-Process</
dqService
>
<
dqFailStep
>STEP:1</
dqFailStep
>
<
getField
>Article.MainSupplier->Party.Name</
getField
>
</
step
>
<
step
>
<
id
>1</
id
>
<
entity
>Article</
entity
>
<
workflowStatus
>My task 1</
workflowStatus
>
<
description
>My task 1</
description
>
<
workflowServiceEndpoint
>StepWorkflow-Trigger</
workflowServiceEndpoint
>
<
enterStatus
>Always</
enterStatus
>
<
batchSize
>500</
batchSize
>
<
userType
>supplier</
userType
>
<
uiTemplate
>Item approve UI</
uiTemplate
>
<
executeDq
>Never</
executeDq
>
<
getField
>Article.CurrentStatus</
getField
>
<
nextStep
>STEP:2</
nextStep
>
<
nextStep
>STEP:3</
nextStep
>
</
step
>
<
step
>
<
id
>2</
id
>
<
entity
>Article</
entity
>
<
updateFieldDescriptor
>Article.CurrentStatus</
updateFieldDescriptor
>
<
updateFieldValue
>200</
updateFieldValue
>
</
step
>
<
step
>
<
id
>3</
id
>
<
entity
>Article</
entity
>
<
workflowStatus
>My task 2</
workflowStatus
>
<
description
>My task 2</
description
>
<
workflowServiceEndpoint
>StepWorkflow-Trigger</
workflowServiceEndpoint
>
<
enterStatus
>Always</
enterStatus
>
<
batchSize
>500</
batchSize
>
<
userType
>userGroup</
userType
>
<
userName
>Standardusers</
userName
>
<
uiTemplate
>Item approve UI</
uiTemplate
>
<
executeDq
>Never</
executeDq
>
<
nextStep
>STEP:4</
nextStep
>
</
step
>
<
step
>
<
id
>4</
id
>
<
entity
>Article</
entity
>
<
updateFieldDescriptor
>Article.CurrentStatus</
updateFieldDescriptor
>
<
updateFieldValue
>300</
updateFieldValue
>
</
step
>
</
workflow
>
</
imp
:payload>
Detailed explanation of the steps
Step 0
Step 0 is an exact copy of the step 0 of the example 5 (incl. getField for supplier tasks).
Step 0
This steps checks only whether the item is already in this workflow. The difference to the previous step 0 steps is, that in this case the mandatory field "Article.MainSupplier->Party.Name " for supplier tasks is called. When you work with supplier tasks it is necessary that this getField command is part of the very first step of the StepWorkflow.
Key |
Value |
Description |
id |
0 |
Identifier of the step. |
entity |
Article |
Entity container for this workflow. |
enterStatus |
Never |
The circumstances when an item should enter a status (task). In this case never! |
batchSize |
500 |
Batch size to use with trigger batching. |
dqService |
ItemsInWorkflowTasks-Process |
This DQ service is an additional bpel inside the StepWorkflow which checks whether the item is already inside this workflow or not. |
dqFailStep |
STEP:1 |
The item will be moved to the step with the identifier 1 if the above dq fails. |
getField |
Article.MainSupplier->Party.Name |
List of any fields directly on the entity that will be required. These entries must be fully qualified. |
Step 1
This step puts the item into a workflow task and when leaving this task the steps 2 and 3 are executed.
Key |
Value |
Description |
id |
1 |
Identifier of the step. |
entity |
Article |
Entity container for this workflow. |
workflowStatus |
My task 1 |
Status name within the Product 360 workflow. ==> Product 360 task name = [Workflow] - [Status] - [Catalog] |
description |
My task 1 |
Description of the status. |
workflowServiceEndpoint |
StepWorkflow-Trigger |
This is the service name of the partner link. This name is defined in the process deployment descriptor of the workflow. |
enterStatus |
Always |
The circumstances when an item should enter a status (task). In this case always! |
batchSize |
500 |
Batch size to use with trigger batching. |
userType |
supplier |
Type of the default assignee of this task. In this case it will be assigned to the supplier of the cataslog. |
uiTemplate |
Item approve UI |
This is the default UI of the task. |
executeDq |
Never |
The circumstances when a DQ should be run. In this case never! |
getField |
Article.CurrentStatus |
List of any fields directly on the entity that will be required. These entries must be fully qualified. |
nextStep |
STEP:2 |
Identifier of the next step, The item will be moved to the next step, when this step is finished. |
nextStep |
STEP:3 |
Identifier of the next step, The item will be moved to the next step, when this step is finished. |
Step 2
Step 2 will manipulate data within the workflow. In this example we will change the field CurrentStatus of the entity Article.
Key |
Value |
Description |
id |
2 |
Same keys and values than in the example above. |
entity |
Article |
Entity container for this workflow. |
updateFieldDescriptor |
Article.CurrentStatus |
This field allows the step to update a field in Product 360. The field must be fully qualified. |
updateFieldValue |
200 |
This is the value for the update. |
The next table shows you how to qualify field.
Key |
Value |
FieldDescriptor |
Article.CurrentStatus |
FieldDescriptor |
Article.MainSupplier->Party.Name |
FieldDescriptor |
Article.ManufacturerName |
FieldDescriptor |
ArticleLang.DescriptionShort(9,"Default Channel") |
Step 3
This step puts the item again into a workflow task and when leaving this task the steps 4 is exectuted.
Key |
Value |
Description |
id |
3 |
Identifier of the step. |
entity |
Article |
Entity container for this workflow. |
workflowStatus |
My task 2 |
Status name within the Product 360 workflow. ==> Product 360 task name = [Workflow] - [Status] - [Catalog] |
description |
My task 2 |
Description of the status. |
workflowServiceEndpoint |
StepWorkflow-Trigger |
This is the service name of the partner link. This name is defined in the process deployment descriptor of the workflow. |
enterStatus |
Always |
The circumstances when an item should enter a status (task). In this case always! |
batchSize |
500 |
Batch size to use with trigger batching. |
userType |
userGroup |
Type of the default assignee of this task. In this case it will be a usergroup. |
userName |
Standardusers |
Name/Identifier of the Default assignee of the task. ==> The item will be assigned to the usergroup "Standardusers". |
uiTemplate |
Item approve UI |
This is the default UI of the task. |
executeDq |
Never |
The circumstances when a DQ should be run. In this case never! |
nextStep |
STEP:4 |
Identifier of the next step, The item will be moved to the next step, when this step is finished. |
Step 4
Step 4 is similar to step 2, but it will set another value to the field.
Key |
Value |
Description |
id |
4 |
Same keys and values than in the example above. |
entity |
Article |
Entity container for this workflow. |
updateFieldDescriptor |
Article.CurrentStatus |
This field allows the step to update a field in Product 360. The field must be fully qualified. |
updateFieldValue |
300 |
This is the value for the update. |