简体   繁体   中英

Can i add a run time transition to a task node in jbpm v3.2?

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM