JBoss Community

Re: Not able to start a process through the Java API

created by Maciej Swiderski in jBPM - View the full discussion

Jose Miguel Loor wrote:

 

 

private StatefulKnowledgeSession getKSession(final String changeSetUrl)  throws ProcessRulesException {

     StatefulKnowledgeSession ksession = getKBase(changeSetUrl).newStatefulKnowledgeSession();

      ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());

     return ksession;

}

 

Here you have two issues:

  1. you create non persistence session and thus nothing ends up in data base
  2. use SystemOutWorkItemHandler as handler for human tasks so it will simply print its properties and move on with the next nodes, most likely ending up as completed process instance

 

Take a look in the docs on how to setup persistent sessions and make sure that it's configured towards the same db as console.

 

HTH

Reply to this message by going to Community

Start a new discussion in jBPM at Community