Expand my Community achievements bar.

SOLVED

What is Task Routing for?

Avatar

Level 2

Hi There,

Now I'm walking through Workflow and creating some model. While I was doing that I had a Question about Task Routing. 

When I put Task Manager Step in the Model and Configure it. There is a optional thing ( Action ) to put  on Routing tab. 

What is this for? Is that Triggering some script? 

Thank you. 

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi Kim

 

Routing

·         Actions: Completion options that are presented to the user upon completing the task. The selected action determines the subsequent route to follow. 

Click Add item and type a name for the action. The name and order of the actions appear in the Complete Task dialog as they appear in the properties dialog.

Using Task Actions for Routing

When a user selects an action when completing a task, the Workflow engine stores the action name in the data map of the workfow instance. You can reference the selected action name in the logic of OR Split steps to select the next step to execute.

In the data map of the workflow instance, the selected action name is associated with the lastTaskAction key. In an ECMA script, the following code returns the value:

workitem.getWorkflow().getWorkflowData().getMetaDataMap().get("lastTaskAction","");

When using the last task action that is saved, design your workflow model so that no more than one task is awaiting completion at one time. In this way, you ensure that the value for the lastTaskAction key was populated by the expected task.

The following script example script can be used to determine whether the selected action for the last completed task wasAccept. 

 

function check(){

   var action = workitem.getWorkflow().getWorkflowData().getMetaDataMap().get("lastTaskAction","");

   return action === "Accept";

}

 

Please have a look at :- https://docs.adobe.com/docs/en/cq/5-6-1/workflows/wf-ref.html

 

I hope this would help you.

 

Thanks and Regards

Kautuk Sahni

 


Kautuk Sahni

View solution in original post

1 Reply

Avatar

Correct answer by
Administrator

Hi Kim

 

Routing

·         Actions: Completion options that are presented to the user upon completing the task. The selected action determines the subsequent route to follow. 

Click Add item and type a name for the action. The name and order of the actions appear in the Complete Task dialog as they appear in the properties dialog.

Using Task Actions for Routing

When a user selects an action when completing a task, the Workflow engine stores the action name in the data map of the workfow instance. You can reference the selected action name in the logic of OR Split steps to select the next step to execute.

In the data map of the workflow instance, the selected action name is associated with the lastTaskAction key. In an ECMA script, the following code returns the value:

workitem.getWorkflow().getWorkflowData().getMetaDataMap().get("lastTaskAction","");

When using the last task action that is saved, design your workflow model so that no more than one task is awaiting completion at one time. In this way, you ensure that the value for the lastTaskAction key was populated by the expected task.

The following script example script can be used to determine whether the selected action for the last completed task wasAccept. 

 

function check(){

   var action = workitem.getWorkflow().getWorkflowData().getMetaDataMap().get("lastTaskAction","");

   return action === "Accept";

}

 

Please have a look at :- https://docs.adobe.com/docs/en/cq/5-6-1/workflows/wf-ref.html

 

I hope this would help you.

 

Thanks and Regards

Kautuk Sahni

 


Kautuk Sahni