-
1. Re: restart running process
mwohlf Oct 7, 2010 9:30 AM (in response to gianluca.ricciardi)1 of 1 people found this helpfulwhat do you mean by "restarting"?
A process instance is started once, pauses in wait-states and terminates in an end-state where do you want to restart a process?
As for the connection between the business data and the process instance, you can either keep a process instance id in your business data or query the jbpm4 tables with hql depending on the type of your variable.
-
2. Re: restart running process
gianluca.ricciardi Oct 7, 2010 10:08 AM (in response to mwohlf)Thanks Michael 4 your response. I Mean "resume" , then I'll do so. I found the way how to execute query across jbpm tablels.
Something like this:
String pid=processEngine.execute(new Command<String>() {private String id;public String execute(Environment environment) throws Exception {DbSessionImpl dbSessionImpl = environment.get(DbSessionImpl.class);Session session = dbSessionImpl.getSession();List<Variable> list =session.createQuery("from " + org.jbpm.pvm.internal.type.Variable.class.getName()).list();Variable var = list.get(0);String id_ = var.getExecution().toString();return id_.substring(id_.indexOf("[")+1,id_.indexOf("]"));}});String pid=processEngine.execute(
new Command<Void>() {
private String id;
public String execute(Environment environment) throws Exception {
DbSessionImpl dbSessionImpl = environment.get(DbSessionImpl.class);
Session session = dbSessionImpl.getSession();
List<Variable> list =
session.createQuery(
"from " + org.jbpm.pvm.internal.type.Variable.class.getName()).list();
...
}
}
);