[jboss-user] [jBPM Users] - [jbpm4] Move execution to arbitrary activity

luca.tagliani do-not-reply at jboss.com
Thu Oct 8 12:13:30 EDT 2009

Hi all,
  I'm trying to move the execution of a processInstance to an arbitrary activity.

I'm using the following code:

        org.jbpm.api.ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionName("processTest").uniqueResult();
  |         ExecutionService executionService = processEngine.getExecutionService();
  |         ProcessInstance instance = executionService.startProcessInstanceByKey("processTest");
  |         String newName = "Verified";
  |         Activity newActivity = ((ProcessDefinitionImpl) processDefinition).getActivity(newName);
  |         ExecutionImpl execution = (ExecutionImpl) instance;
  |         if (newActivity != null) {
  |             ((ExecutionImpl) execution).setActivity(newActivity);
  |         }

but when I then signal the execution, the activity ran is not the one I've yet set, but the old one.

I've also tried to use


but with the same result.

It seems that the change is not persisted on the DB....

Is it a bug or am I making any mistake?


Luca Tagliani

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259417#4259417

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259417

More information about the jboss-user mailing list