[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException
Marco Rietveld
do-not-reply at jboss.com
Fri Apr 5 06:07:45 EDT 2013
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the discussion
"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"
To view the discussion, visit: https://community.jboss.org/message/806653#806653
--------------------------------------------------------------
Interesting.. well, if you can keep a secret ;D, the metadata that Shobhit was asking about is +actually available+. The jBPM parser parses and stores that information and it's available at (process instance) runtime. Actually, I'm pretty sure it's even available directly from the knowledge base. Of course, the minute we start trying hat metadata, the BPM engine is no longer a black box... I'll make a quick code example and post it on this thread in the next couple days.
But back to your process variable question: unfortunately, the only way to set process variables in a process is at the very beginning, with the following method:
{code}ksession.startProcess(String processId, Map<String, Object> parameters){code}
The String key in the parameters Map should match the name of the.. (searching brain for bpmn2 knowledge... ) property element in the process element. The property's itemSubjectDef should reference a itemDefintiion element defined with the correct data type ("java.lang.String", for example) above/outside the process element in your BPMN2.
At the moment, definining or adding a process variable (that you want to access outside of the engine) is only possible at process instance creation -- with the method described above. At least, as far as I know.. I'll check with some of the other dev's to make sure.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/806653#806653]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130405/579240e1/attachment.html
More information about the jboss-user
mailing list