[jboss-user] [JBoss jBPM] - Re: context variables not being persisted

mabogunje do-not-reply at jboss.com
Mon Mar 10 12:50:34 EDT 2008


Actually I am closing the context, here is the full code :

JbpmContext jbpmContext = s_jbpmConfiguration.createJbpmContext();
try
{
ProcessDefinition definition = jbpmContext.getGraphSession().getProcessDefinition(Long.parseLong(instanceTO.getTemplateId()));
ProcessInstance instance = new ProcessInstance(definition);
ContextInstance contextInstance = (ContextInstance)instance.getInstance(ContextInstance.class);
contextInstance.setVariable("name","name");
contextInstance.createVariable("test","test");
jbpmContext.save(instance);
}
catch (Exception e)
{
throw new WorkflowEngineException(e.getMessage(), e);
}
finally
{
jbpmContext.close();
}


Also when I look in the ProcessInstance object during runtime, there are instances and transientInstances, however instances remains null, while transient instance contains my ContextInstance and LoggingInstance. As I add variables, they are being added to my transient instance. Is that correct ? That seems like the reason they are not being persisted but I dont know why its happening.

Thanks for all your help

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135387#4135387

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135387



More information about the jboss-user mailing list