}
public Serializable getProcessVariable(String instanceId, String scope, String varKey) throws RemoteException{
logInst("getProcessVariable", new Object[]{instanceId, scope, varKey});
try{
ProcessInstance instance = getInstance(instanceId);
if(varKey.indexOf('.') < 0){
ProcessDefinition definition = instance.getProcessDefinition();
ProcessVariable variable = definition.getProcessVariable(varKey);
if(variable == null) throw new UEngineException("Undeclared process variable reference : " + varKey);
ProcessVariableValue theValue = definition.getProcessVariable(varKey).getMultiple(instance, scope);
//ProcessVariableValue theValue = instance.getMultiple(scope, varKey);
theValue.beforeFirst();
if(theValue.size()==1)
return theValue.getValue();
else
return theValue;
}else{
return instance.get(scope, varKey);
}
}catch(Exception e){
e.printStackTrace();
throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);