Hi, I use variables (business objects) in ActionHandler
public class Task_ABC implements ActionHandler{
public void execute(ExecutionContext executionContext) throws Exception
{
ContextInstance c =
executionContext.getProcessInstance().getContextInstance();
Abc abc= (Abc) c.getVariable(abc);
do something ...
executionContext.leaveNode();
}
}
Problem is that this variables are not registered in session, if variable has
an association and I use it, I get an exception. But if I have variable class
has only primitive attributes (String, BigDecimal..) it works perfectly.
Workaround is to declare all association in Hibernate as lazy=false what I
don't want. But really interesting is, that if I change value in variable that
it will be stored in db. That means that jbpm will register variables in
Hibernate session but later and I don't know when.
I don't use any special workflow configuration. This is snip set from my
workflow interface:
public class WorkflowService extends HibernateDaoSupport implements
IWorkflowService {
private static JbpmConfiguration jbpmConfiguration =
JbpmConfiguration.getInstance();
public void startWorkflow(Workflow workflow, MapString, Object
variables) {
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
jbpmContext.setSessionFactory(getSessionFactory());
jbpmContext.setSession(getSession());
try {
ProcessInstance processInstance =
jbpmContext.newProcessInstanceForUpdate(workflow.getFullName());
processInstance.getContextInstance().setTransientVariables(variables);
processInstance.signal();
} finally {
jbpmContext.close();
}
}
Thanks
Fero
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4168667#4168667
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4168667
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user