[jboss-user] [JBoss jBPM] - Re: JBPM BPEL 1.1.1 Getting variables of processInstance

evilsephiroth do-not-reply at jboss.com
Thu Jul 2 05:09:17 EDT 2009


yes i was doing something similar to get the variables. The problem is  the parsing of the element. I want to implement a generic parser for all the processes deployed on the console. But every process has its implementation of variables so i can't effectively know in what node is the variable data(some in the first child, some other in nested childs). 

if (variable instanceof MessageValue) {
  | 			MessageValue messageElement = (MessageValue) variable;
  | 			Map partElems = messageElement.getParts();
  | 
  | 			// Get the first Element
  | 			String partName = (String) partElems.keySet().iterator().next();
  | 			org.apache.xerces.dom.DeferredElementNSImpl partElement = (org.apache.xerces.dom.DeferredElementNSImpl) partElems.values().iterator()
  | 			.next();	
  | 			String valueVar=partElement.getFirstChild().getFirstChild().getNodeValue();
  | 		}

This code won't work for all processes because in another process this line will be :

valueVar=partElement.getFirstChild().getNodeValue();

I was thinking a node searcher/comparer to variable Name but i hope something simpler will come out...

any help is appreciated. 

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

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



More information about the jboss-user mailing list