Package org.uengine.kernel

Examples of org.uengine.kernel.ProcessInstance


  }

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


  }

  public ProcessInstance getProcessInstance(String instanceId, String executionScope) throws RemoteException{
    logInst("getProcessInstance", new Object[]{instanceId, executionScope});
    try{
      ProcessInstance instance = getInstance(instanceId);
      instance.setExecutionScope(executionScope);
      //it is ok to return the original object since we have implemented caching logic.
      return instance/*.createSnapshot()*/;
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
View Full Code Here

  }

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

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

  public Serializable getActivityInstanceProperty(String instanceId, String tracingTag, String propertyName) throws RemoteException{
    logInst("getActivityInstanceProperty", new Object[]{instanceId, tracingTag, propertyName});
    try{     
      if(instanceId==null) return null; //guard against illegal requests

      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
      Activity activity = definition.getActivity(tracingTag);
      propertyName = propertyName.substring(0,1).toUpperCase() + propertyName.substring(1);//.toLowerCase();
      //the pattern of instance property (stateful) is 'getXXX(instance)'
      Object returnVal;
      try{
View Full Code Here

          throw new UEngineException("Property value should be not null. If you want to apply with null value, provide valueType as well."); //TODO: change to find proper method and to allow null value
         
        valueType = value.getClass();
      }      

      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      if(definition==null)
        throw new UEngineException("Can't find the definition for instance '" + instance.getInstanceId() + "'");
       
      Activity activity = definition.getActivity(tracingTag);

      if(activity==null)
        throw new UEngineException("No such activity with tracing tag : " + tracingTag + " in definition '" + definition.getId() + "'");
View Full Code Here

      if(instanceId==null) return null; //guard against illegal requests
     
      if(parameters.length!=parameterTypes.length)
        throw new UEngineException("invalid parameter length");

      ProcessInstance instance = getInstance(instanceId);
      ProcessDefinition definition = instance.getProcessDefinition();
     
      if(definition==null)
        throw new UEngineException("Can't find the definition for instance '" + instance.getInstanceId() + "'");
       
      Activity activity = definition.getActivity(tracingTag);

      if(activity==null)
        throw new UEngineException("No such activity with tracing tag : " + tracingTag + " in definition '" + definition.getId() + "'");
View Full Code Here

  }


  private void changeProcessDefinitionImpl(String instanceId, Object definition) throws RemoteException{
    try{
      ProcessInstance instance = getInstance(instanceId);
     
      ProcessDefinition processDefinition = null;
      if(definition instanceof String){
        ByteArrayInputStream is = new ByteArrayInputStream(((String)definition).getBytes("UTF-8"));
        processDefinition = (ProcessDefinition) ProcessDefinitionFactory.getActivity(is);
      }else{
        processDefinition = (ProcessDefinition)definition;
      }
 
      if(processDefinition==instance.getProcessDefinition())
        throw new UEngineException("Dynamic change exception: Changed definition is the original one so it can't be changed. That means your code didn't clone the definition for changing it. Also It implies the damage of cached definition.");
     
      instance.setProcessDefinition(processDefinition);

    }catch(Exception e){
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
View Full Code Here

//  }
// 
 
  public void setFault(String instanceId, String tracingTag, Exception fault) throws RemoteException{
    try{
      ProcessInstance instance = getInstance(instanceId);
 
      ProcessDefinition definition = instance.getProcessDefinition();
      Activity activity = definition.getActivity(tracingTag);
      activity.fireFault(instance, fault);
     
    }catch(Exception e){
      e.printStackTrace();
View Full Code Here

    }
  }
 
  public EventHandler[] getEventHandlersInAction(String instanceId) throws RemoteException{
    try{
      ProcessInstance instance = getInstance(instanceId);
      return instance.getEventHandlersInAction();
    } catch (Exception e) {
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
    }
  }
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.