Choosing Lane Specific Tasks

Lets take a look at a sample workflow with lanes:

_images/lanes.png

and lets say that we would like to have two separate processes, one that shows the steps for only for the A role, and one that shows only tasks for the B role.

Up until now, we have just asked the workflow processor for any ready tasks, but it is possible to ask the workflow processor for just those tasks that are for a specific lane. Please note that this feature will only work for those situations where you have set up a workflow with lanes

Tip

Workflows with ‘pools’

When you add lanes to a BPMN document, those lanes are contained within a ‘pool’ That pool has its own process ID. To activate the workflow inside of a pool, you need to use the process id for the pool and not the workflow document itself as we have in previous workflows. In the workflow above, the main workflow ID is lanes_outer, and the processid on the pool is ‘lanes’ - so we would use ‘lanes’ in the ‘get_spec’ line of code to interact with this workflow.

To get all of the tasks that are ready for the ‘A’ workflow, we would use the same

ready_tasks = workflow.get_ready_user_tasks()

but we would change it to do the following:

ready_tasks = workflow.get_ready_user_tasks(lane='A')

If there were no tasks ready for the ‘A’ lane, you would get an empty list, and of course if you had no lane that was labeled ‘A’ you would always get an empty list.

This is all well and good, but what if you want to give a user that is in either the ‘A’ or ‘B’ role a sense of where things were at in the workflow? Spiff workflow gives us a ‘Nav List’ that allows us to convey a sort of ‘roadmap’ to the user no matter if they are using lanes or not.