Maciej Swiderski
2013-02-08 17:11:35 UTC
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion
"Re: Not able to start a process through the Java API"
To view the discussion, visit: https://community.jboss.org/message/796801#796801
--------------------------------------------------------------
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
[https://community.jboss.org/message/796801#796801]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
"Re: Not able to start a process through the Java API"
To view the discussion, visit: https://community.jboss.org/message/796801#796801
--------------------------------------------------------------
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:Â Â Â Â StatefulKnowledgeSession ksession = getKBase(changeSetUrl).newStatefulKnowledgeSession();
     ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());
    return ksession;
}
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
[https://community.jboss.org/message/796801#796801]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]