[jBPM Users] - Re: how to get all tokens from processinstance
by saraswati.santanu
LoggingInstance is not persisted. So you cannot really get the history data from it after the transaction is over. For that you need LoggingSession. If you are saving the logs then you can get the information using LoggingSession.
| //create a LoggingSession. getSession() here returns a Hibernate session
| LoggingSession logginSession = new LoggingSession(getSession());
|
| //this map contains Token vs List of logs
| Map logs = logginSession.findLogsByProcessInstance(processInstance.getId());
|
| //Iterate and do whaterver you need to
| Set<Entry> entries = logs.entrySet();
| for (Entry entry : entries) {
| List<ProcessLog> processLogs = (List<ProcessLog>)entry.getValue();
| for (ProcessLog log:processLogs) {
| System.out.println("Log type : " + log.getClass().getSimpleName());
| }
| }
|
So far I remember, along with the code above, you need to call
| jbpmContext.save(processInstance);
|
everytime after you do the signalling/task execution. This call saves the logs in db.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264558#4264558
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264558
16 years, 5 months
jBPM-4.2 Upgrade problems
by Erik Dannenberg
Hello,
just upgraded from 4.1 to 4.2, upgrade went smoothly, however i got some weird behavior now. I deployed a process we had running in 4.1, all works well except for jobs. Said process has a wait state with a timer on it. Once the timer executed i get
Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry 'createBlogAccount.210301.waitForConfirmation' for key 2
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
i can still signal the process after that and the process will execute and show end status just fine after that. However if i dont signal the process it will hang forever as the next timer wont get initialized.
Another thing i noticed, when i start said process the gwt console shows n/a for activity in the instance overview , with 4.1/gwt 1.1 it showed the correct waiting state. Also, gwt console seems to initialize hibernates 2 times now, is that intended?
All test were done with jbpm4.2, vanilla tomcat 6 install, only changed db properties to use mysql.
16 years, 5 months
[jBPM Users] - Re: how to get all tokens from processinstance
by peterbasutkar@gmail.com
i dont want only running task............i am using following this code for getting completed and pending token(task node) as well as running token information but this is keeping track of token data(means previously completed and currenrently running task) if an only if we are performing any signaling,but i want all completed and pending token information irrespective of signaling,means it should give me information when task is started,when it is ended for that processInstance
ProcessInstance processInstance = getProcessInstance();
LoggingInstance loggingInstance = processInstance.getLoggingInstance();
List logs = loggingInstance.getLogs(SignalLog.class);
for (SignalLog signalLog : logs) {
List children = signalLog.getChildren();
if(children.get(0) != null){
if(children.get(0) instanceof TransitionLog){
TransitionLog transitionLog = (TransitionLog)children.get(0);
System.out.println("Node Name:::"+transitionLog.getSourceNode().getName());
System.out.println("Node Start Time:::");
System.out.println("Node End Time:::"+transitionLog.getDate());
System.out.println("=====================================================");
}
if(children.get(0) instanceof NodeLog){
NodeLog nodeLog = (NodeLog)children.get(0);
System.out.println("Node Name:::"+nodeLog.getNode().getName());
System.out.println("Node Start Time:::"+nodeLog.getEnter());
System.out.println("Node End Time:::"+nodeLog.getLeave());
System.out.println("=====================================================");
}
}
}
return "success";
}
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264443#4264443
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264443
16 years, 5 months