[jboss-user] [jBPM] - Re: Getting process instance variables

Maciej Swiderski do-not-reply at jboss.com
Fri Aug 17 10:16:14 EDT 2012


Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Getting process instance variables"

To view the discussion, visit: https://community.jboss.org/message/754272#754272

--------------------------------------------------------------
alright, kind of expected this error, you should run command in this case, something like this:


Map<String, Object> variables = ksession.execute(new GenericCommand<Map<String, Object>>() {
 
            public Map<String, Object> execute(Context context) {
                StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession();
                ProcessInstance processInstance = (ProcessInstance) ksession.getProcessInstance(piId);
                VariableScopeInstance variableScope = (VariableScopeInstance) processInstance.getContextInstance(VariableScope.VARIABLE_SCOPE);
        Map<String, Object> variables = variableScope.getVariables();
                return variables;
            }
        });

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/754272#754272]

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/20120817/c9438847/attachment.html 


More information about the jboss-user mailing list