Example 7 (2 Tasks + modifying of fields + approval step)

The next example extends the example 6 workflow with modifying of fields within the workflow after finishing the tasks followed by an approval task which also sets data if the task(s) are rejected.

Diagram for example 7

images/download/attachments/400049245/SW_Example07.png

Product 360 prerequisites for example 7

Product 360 entity

value

Usergroup

Standardusers

Ui Template

Item approve UI

Explanation of the steps example 7

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 3"

4

Modify the field Article.CurrentStatus to the value 300

5.0

Check whether item is already in this workflow

5

Approve task with rejection options to all previous tasks. If rejected modify the field Article.CurrentStatus to the value 300

6

Modify the field Article.CurrentStatus to the value 400

StepWorkflow.xml file for example 7

Example 7
<imp:payload xmlns:imp="http://www.informatica.com/schema/ItemMap" contentType="string">
<workflow>
<label>Example Workflow 7</label>
<identifier>Workflow_07</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>
<nextStep>STEP:5.0</nextStep>
</step>
<step>
<id>4</id>
<entity>Article</entity>
<updateFieldDescriptor>Article.CurrentStatus</updateFieldDescriptor>
<updateFieldValue>300</updateFieldValue>
</step>
<step>
<id>5.0</id>
<entity>Article</entity>
<enterStatus>Never</enterStatus>
<batchSize>500</batchSize>
<executeDq>Always</executeDq>
<dqService>ItemsInWorkflowTasks-Process</dqService>
<dqFailStep>STEP:5</dqFailStep>
</step>
<step>
<id>5</id>
<entity>Article</entity>
<workflowStatus>Approve</workflowStatus>
<description>Approval</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>
<rejectTrigger>StepWorkflow_ParallelTasks-Reject</rejectTrigger>
<singleChoice>true</singleChoice>
<rejectDecision>
<id>p360.bpm.reject.STEP:1</id>
<label>Reject to task 1</label>
</rejectDecision>
<rejectDecision>
<id>p360.bpm.reject.STEP:3</id>
<label>Reject to task 2</label>
</rejectDecision>
<rejectFieldDescriptor>Article.CurrentStatus</rejectFieldDescriptor>
<rejectFieldValue>100</rejectFieldValue>
<nextStep>STEP:6</nextStep>
</step>
<step>
<id>6</id>
<workflowServiceEndpoint>StepWorkflow-Trigger</workflowServiceEndpoint>
<entity>Article</entity>
<updateFieldDescriptor>Article.CurrentStatus</updateFieldDescriptor>
<updateFieldValue>400</updateFieldValue>
</step>
</workflow>
</imp:payload>

Detailed explanation of the steps

Step 0 - Step 3

These steps are exact copy of the example 6.

Step 4

Step 4 is nearly the same as the step 4 of the example above. Only the differences are shown in the next table.

Key

Value

Description

...

...

Same keys and values than in the example 6.

nextStep

STEP:5.0

Identifier of the next step, The item will be moved to the next step, when this step is finished.

Step 5.0

This steps checks only whether the item is already in this workflow. If not the executed next step is 5. If yes the workflow will end to avoid that the item will go to the step 5 (Approve) until it is somewhere else in the workflow.

Key

Value

Description

id

5.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:5

The item will be moved to the step with the identifier 5 if the above DQ fails.

Step 5

This is the approval step with modifying a field while rejecting.

Key

Value

Description

id

5

Identifier of the step.

entity

Article

Entity container for this workflow.

workflowStatus

Approve

Status name within the Product 360 workflow. ==> Product 360 task name = [Workflow] - [Status] - [Catalog]

description

Approval

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!

rejectTrigger

StepWorkflow_ParallelTasks-Reject

Endpoint for the reject trigger of parallel states (tasks).

singleChoice

true

This is for Rejects only and determines if you can have more than one choice. ==> The workflow can be rejected to only one step,

<rejectDecision>id

p360.bpm.reject.STEP:1

Identifier of the 1st reject step.

<rejectDecision>label

Reject to task 1

Label of the 1st rejection. This label will show up in the UI.

<rejectDecision>id

p360.bpm.reject.STEP:3

Identifier of the 2nd reject step.

<rejectDecision>label

Reject to task 2

Label of the 2nd rejection. This label will show up in the UI.

rejectFieldDescriptor

Article.CurrentStatus

This is the field the will be modifed if the task will be rected. The field must be fully qualified.

rejectFieldValue

100

This is the value for the update.

nextStep

STEP:6

Identifier of the next step, The item will be moved to the next step, when this step is approved.

Step 6

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

6

Same keys and values than in the example 6.

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

400

This is the value for the update.