[jboss-user] [JBoss jBPM] - Re: JBPM BPEL 1.1.1 Getting variables of processInstance
dhanushgopinath
do-not-reply at jboss.com
Thu Jul 2 04:25:29 EDT 2009
I dont think there is any converter as of now.
Here is how I did it
| JbpmContext jbpmContext = GetJbpmConfiguration().createJbpmContext();
| ProcessInstance processInstance = GetJbpmGraphSession(jbpmContext)
| .getProcessInstance(Long.parseLong(strProcessInstanceId));
|
| // Get the context instance
| ContextInstance processContextInstance = processInstance
| .getContextInstance();
| // get the all token variables map
| Map allTokenVariablsMap = processContextInstance.getTokenVariableMaps();
| // get the correct token for the variable
| Token tokenForVariable = GET THE CORRECT TOKEN HERE FROM THE MAP
| // get the variable from the context instance
| Object variable = processContextInstance.getVariable(strVariableName,
| tokenForVariable);
|
| // Variable will be an instance of MessageValue
| if (variable instanceof MessageValue) {
| MessageValue messageElement = (MessageValue) variable;
| Map partElems = messageElement.getParts();
|
| // Get the first Element
| String partName = (String) partElems.keySet().iterator().next();
| Element partElement = (Element) partElems.values().iterator()
| .next();
The partElement is an XML Element . You can recurse through this and get the values using a DOM Parser.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241396#4241396
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241396
More information about the jboss-user
mailing list