Thanks for the replies. This has helped me going -- but I still have lots of
questions:
1) I had overlooked the documentation and I was not calling a
ctx.save(ProcessInstance). As a result of this, the JBPM_LOG table was empty. I
added the ctx.save(...) call and now the table is getting populated.
However, I need to confirm / clarify / ask the following:
1) I am starting my Processes by using the following code:
| JbpmConfiguration jbpmConfig = JbpmConfiguration.getInstance();
| JbpmContext ctx = jbpmConfig.createJbpmContext();
| try {
| //Create Instance
| ProcessInstance PI =
ctx.getGraphSession().findLatestProcessDefinition("some-process-def").createProcessInstance();
|
| //Initialize Process Context Variables
| Map ProcessMap = new HashMap();
| ProcessMap.put("...",...);
| PI.getContextInstance().addVariables(ProcessMap);
|
| //Start the Process
| PI.getRootToken().signal();
| ctx.save(PI);
|
| System.out.println(PI.hasEnded());
| }
| catch (Exception e) {
| System.out.println(e.toString());
| }
| finally {
| ctx.close();
| }
Is the above piece of code good enough? Am I still missing something?
2) My process definitions typically consist of Automatic Nodes -- where I have
either a beanshell script doing something or an ActionHandler implementation.
How can make sure that everything that happens in each of these nodes gets
logged into the JBPM_LOG table. Is the above code good enough.
3) If my server is halted while executing some workflow instances, then I have
written code that will load all running Process instances on startup and signal
them to continue execution. Should I load all these Instances with a
loadProcessInstanceforUpdate and then signal() -- so that everything is logged?
4) If I am handling a Task Node, should I load the task with
LoadTaskInstanceforUpdate() and then do a TaskInstance.end() -- so that
everything is logged?
I would like to be pointed out to some sample code (if possible ) in the test
package so that I can view how the complete logs can be retrieved from the
Database.
Could someone explain the logic behind retrieving the logs as pointed out by
the posts below. I used the
| :
|
| LoggingSession logSession =
JbpmContext.getCurrentContext().getLoggingSession();
|
| Map logMap = logSession.findLogsByProcessInstance(m_process.getId()
Isnt this sufficient ? Do we have some utility method somewhere that simply
prints like a toString() of the whole Log for the instance. That would more
than meet the requirements from the purpose of debugging by reading this log
quickly.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3932808#3932808
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3932808
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user