[jboss-user] [jBPM] - Re: event listeners

kathy89 do-not-reply at jboss.com
Thu Jun 9 22:04:23 EDT 2011


kathy89 [http://community.jboss.org/people/kathy89] created the discussion

"Re: event listeners"

To view the discussion, visit: http://community.jboss.org/message/609533#609533

--------------------------------------------------------------
hi Esteban,

     i do not know where to add the code... i'm not using "kstateful" :| .here is the ProcessTest.java code.









 thank you for replying soon :) 











*public  *class* 

*


ProcessTest {


*public* *static* *final* *void*
main(String[] args) {

*try*
{

// load up the knowledge base

KnowledgeBase kbase = +readKnowledgeBase+();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.+newThreadedFileLogger+(ksession, 
"test"
, 1000);
ksession.getWorkItemManager().registerWorkItemHandler(
"Human Task", *new*
WSHumanTaskHandler());

// start a new process instance

Map<String, Object> params = 
*new*
HashMap<String, Object>();

//params.put("employee", "krisv");

ksession.startProcess(
"com.sample.evaluation"
, params);
logger.close();
} 

*catch*
(Throwable t) 
{
t.printStackTrace();
}
}


*private* *static* KnowledgeBase readKnowledgeBase() *throws*
Exception {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.+newKnowledgeBuilder+();
kbuilder.add(ResourceFactory.+newClassPathResource+(
"Evaluation.bpmn"), ResourceType.+BPMN2+
);

*return*
kbuilder.newKnowledgeBase();
}

}



--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/609533#609533]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110609/284e7694/attachment.html 


More information about the jboss-user mailing list