Community

jBPM 4.3 starting a sub-process after a state node will fail

reply from Tun Mang in jBPM - View the full discussion

Hi Maciej :

 

Thanks a lot for your sample code. And by that, I finally figured out why my call does not work. The way we call the "deploy process definition", and "start process instance", and "signal execution" is by 3 persons (or 3 stages) to simulate a business facility. So my work is providing a utility for them to execute and call. But your sample code is doing all of them in one-shot (from deploy PD, to signal execution). My utility is like the following and got executed by parameters such as (-deploy, -start, -signal, etc):

 

 

private synchronized void initJbpmEngine()
  {
    //
    // got called when this utility class instantiated.
    //
    if (processEngine != null)
      return;
    configuration = new Configuration();
   
    processEngine = configuration.buildProcessEngine();    
    out("Process Engine Identity Hash Code: " + System.identityHashCode(processEngine));
    repositoryService = processEngine.get(RepositoryService.class);
    executionService  = processEngine.getExecutionService();
    historyService    = processEngine.getHistoryService();
    managementService = processEngine.getManagementService();
    taskService       = processEngine.getTaskService();
    identityService   = processEngine.getIdentityService();       
  }
public void deployProcessDefinition(String fileName)
{
  ....
}

 

public void startProcessInstance(String processDefinitionName)

{

  ....

}

 

public void signalExecution(String executionId)

{

  executionService.signalExecutionById( executionId );

}

 

Once calling those operations in stages, the executionService.signalExecutionById( ... ) will throw the "a foreign key constraint fails" exception. But my problem is I can not find a jBPM API to pass (or fill in) the required information to executionService to execute the  signalExecutionById(...) if we are doing thing in stages.

 

Thanks a lot for your help and time in advance again.

 

Tun Mang

Reply to this message by going to Community

Start a new discussion in jBPM at Community