Question

For every task node in a process definition, i want to dynamically (programtically) add a self transition (from and to transition to the same node) to each task node. Can you tell me can this be done as part of JBPM v3.2 and if there are any issues that can crop up if i choose this approach ?

Was it helpful?

Solution

You don't need to do this dinamically. You can do it straight into your workflow.

What do you mean dinamically? When you are deploying the workflow or while you are already processing it?

If it is while deploying, before you call the deployProcessDefinition method, you can take the xml it will deploy and edit it before making the deploy.

If it is while you are already processing, I can think of 2 possible options:

  1. If you want a new instance of the task to be created when the self transition is taken, you will need to make some hacks in the database to change the already deployed workflow;
  2. If it is ok to use the same instance of the task, you can change the Transition.take method to don't propagate the event when you take the transition to the same task.

For both options, you should pay atention for problems with the ProcessLog. I don't know if JBPM will have a problem for writing the logs for transitions that don't really exist.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top