Package org.uengine.kernel

Examples of org.uengine.kernel.ProcessInstance


  }

  public void stopProcessInstance(String instanceId) throws RemoteException{
    logInst("stopProcessInstance", new Object[]{instanceId});
    try{
      ProcessInstance instance = getInstance(instanceId);     
      instance.stop();
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }   
  }
View Full Code Here


  }

  public void setProcessVariable(String instanceId, String scope, String varKey, Serializable val) throws RemoteException{
    logInst("setProcessVariable", new Object[]{instanceId, scope, varKey, val});
    try{
      ProcessInstance instance = getInstance(instanceId);
     
      instance.set(scope, varKey, val);
    }catch(Exception e){ 
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }   
  }
View Full Code Here

  }

  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);
View Full Code Here

  }
 
  public String getProcessVariableInXML(String instanceId, String scope, String varKey) throws RemoteException{
    logInst("getProcessVariableInXML", new Object[]{instanceId, scope, varKey});
    try{
      ProcessInstance instance = getInstance(instanceId);
      try{
        return instance.getInXML(scope, varKey);
      }catch(Exception e){
        Serializable serVal = instance.get(scope, varKey);
        return GlobalContext.serialize(serVal, String.class);
      }
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
View Full Code Here

  }
 
  public Hashtable listProcessVariableValues(String instanceId) throws RemoteException{
    logInst("listProcessVariableValues", new Object[]{instanceId});
    try{
      ProcessInstance instance = getInstance(instanceId);
     
      return (Hashtable)instance.getAll();
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
View Full Code Here

  }
 
  public void putRoleMapping(String instanceId, String roleName, String endpoint) throws RemoteException{
    logInst("putRoleMapping", new Object[]{instanceId, roleName, endpoint});
    try{
      ProcessInstance instance = getInstance(instanceId);
     
      RoleMapping roleMap = RoleMapping.create();
      roleMap.setName(roleName);
      roleMap.setEndpoint(endpoint);
      roleMap.fill(instance);
     
      instance.putRoleMapping(roleMap);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
View Full Code Here

  }

  public String getRoleMapping(String instanceId, String roleName) throws RemoteException{
    logInst("getRoleMapping", new Object[]{instanceId, roleName});
    try{
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();

      RoleMapping roleMapping = definition.getRole(roleName).getMapping(instance);
     
      if(roleMapping==null) return null;
     
View Full Code Here

    logInst("putRoleMapping", new Object[]{instanceId, roleMapping});
    try{
      if(!UEngineUtil.isNotEmpty(roleMapping.getName()))
        throw new UEngineException("RoleMapping should have its name.");
     
      ProcessInstance instance = getInstance(instanceId);     
      instance.putRoleMapping(roleMapping);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
View Full Code Here

  }

  public RoleMapping getRoleMappingObject(String instanceId, String roleName) throws RemoteException{
    logInst("getRoleMappingObject", new Object[]{instanceId, roleName});
    try{
      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      RoleMapping roleMapping = definition.getRole(roleName).getMapping(instance);
      if(roleMapping==null) return null;
     
      return roleMapping;
View Full Code Here

 
  public String viewProcessDefinitionFlowChart(String processDefinition, Map options) throws RemoteException{
    log("viewProcessDefinitionFlowChart", new Object[]{processDefinition, options});
    try{
      ProcessDefinition definition = getDefinition(processDefinition);
      ProcessInstance instance = new DefaultProcessInstance();
      instance.setProcessTransactionContext(getTransactionContext());
      ActivityViewer processDefinitionViewer = DefaultActivityViewer.createViewer(definition);
      return processDefinitionViewer.render(definition, instance, options).toString();
      //return ProcessDefinitionViewer.getInstance().render(getDefinition(processDefinition), null, options).toString();
    }catch(Exception e){
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.uengine.kernel.ProcessInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.