Package org.uengine.kernel

Examples of org.uengine.kernel.ProcessInstance


    delegateForRoleMapping(instanceId, roleMapping);
  }
 
  private void delegateForRoleMapping(String instanceId, RoleMapping roleMapping) throws RemoteException{
    try{
      ProcessInstance instance = getInstance(instanceId);
      Vector runningActs = instance.getCurrentRunningActivities();
      for(int i=0; i<runningActs.size(); i++){
        if(runningActs.get(i) instanceof HumanActivity){
          HumanActivity humanActivity = (HumanActivity)runningActs.get(i);
         
          if(humanActivity.getRole().getName().equals(roleMapping.getName()))
View Full Code Here


   public void ejbCreate () {}
  
   public void onMessage (Message omessage)
   {
    String tracingTag = null;
    ProcessInstance instance = null;
   
    ProcessManagerBean pmb = null;
    try{
      ObjectMessage message = (ObjectMessage)omessage;     
      FaultParameter faultParameter = (FaultParameter)message.getObject();
           
      String instanceId = faultParameter.getInstanceId();
      tracingTag = faultParameter.getTracingTag();
      UEngineException fault = faultParameter.getFault();
     
      pmb = new ProcessManagerBean();
      pmb.setSessionContext(null);
     
      try{
        instance = pmb.getProcessInstance(instanceId);
      }catch(Exception e){
        throw new UEngineException("Fault has been occurred during a new instance initiates.", fault);
      }
System.out.println("FaultProcessorBean::onMessage: fault is " + fault + "\n detail is " + fault.getDetails());
      //TODO: because of Oracle's max size of varchar
      fault.setDetails(null);
      //
     
      instance.fireFault(tracingTag, fault);
      pmb.applyChanges();

    }catch(Exception e){
      if(pmb!=null)
        try {
View Full Code Here

    bvt.setClassName("org.uengine.kernel.RoleMapping");
    bvt.getArgumentSourceMap().put("in", "rolemapping");
   
    ProcessInstance.USE_CLASS = DefaultProcessInstance.class;
   
    ProcessInstance pi = DefaultProcessInstance.create();
    pi.set("", "rolemapping", rm);
   
    Object output = bvt.letTransform(pi, "ResourceName");
   
    System.out.println(output);
   
View Full Code Here

  public void testMain() throws Exception{
   
   
    ProcessInstance.USE_CLASS = DefaultProcessInstance.class;
    ProcessInstance pi = DefaultProcessInstance.create();

    String fieldName = "value";
    String fieldName1 = "value1";
    String fieldName2 = "value2";
    String fieldName3 = "value3";
    String errorSuffix = " should be a number";

    RegularExpValidatorTransformer revt = new RegularExpValidatorTransformer();
    revt.setRegularExpression("[0-9]");
    revt.setValidationMessage(errorSuffix);
   
    revt.getArgumentSourceMap().put(revt.getInputArguments()[0], fieldName);
    revt.getArgumentSourceMap().put(revt.getInputArguments()[1], fieldName1);
    revt.getArgumentSourceMap().put(revt.getInputArguments()[2], fieldName2);
    revt.getArgumentSourceMap().put(revt.getInputArguments()[3], fieldName3);
   
    revt.setAliasesForEachInputArgument(new String[]{"value field1", "value field2"});
   
    Map options = new HashMap();
    options.put(org.uengine.processdesigner.mapper.Transformer.OPTION_KEY_OUTPUT_ARGUMENT, "out2");
    options.put(org.uengine.processdesigner.mapper.Transformer.OPTION_KEY_FORM_FIELD_NAME, fieldName2);

//    pi.set("", fieldName, "a string");
//    pi.set("", fieldName1, "a string2");
//    pi.set("", fieldName2, "a string3");
//    pi.set("", fieldName3, "a string4");
    pi.set("", fieldName, "1");
    pi.set("", fieldName1, "2");
    pi.set("", fieldName2, "3");
    pi.set("", fieldName3, "4");
   
    try{
      Object output = revt.letTransform(pi, options);
      assertTrue("a string2".equals(output));
     
View Full Code Here

  
   public void ejbCreate () {}
  
   public void onMessage (Message omessage)
   {
    ProcessInstance instance = null;
   
    ProcessManagerBean pmb = new ProcessManagerBean();
    pmb.setSessionContext(null);

    try
    {        
      System.out.println ("MessageProcessor::onMessage() called..");
     
      MapMessage message = (MapMessage)omessage;
      String instanceId = message.getString("instance");
      String msg = message.getString("message");
      String str_payload = message.getString("payload");
     
      ByteArrayInputStream bis = new ByteArrayInputStream(str_payload.getBytes("ISO-8859-1"));
      Object payload = GlobalContext.deserialize(bis, String.class);
     
     
      instance = pmb.getProcessInstance(instanceId);

      if(instance.isRunning("")){ // if STOP signaled, don't execute anymore.
        //review: message would effect only one instance. it is not common in BPEL
        instance.getProcessDefinition().fireMessage(msg, instance, payload);
        pmb.applyChanges();
      }
     
    }
    catch(Throwable e)
View Full Code Here

   
    ProcessInstance.USE_CLASS = DefaultProcessInstance.class;

    ProcessDefinition pd = (ProcessDefinition) GlobalContext.deserialize(new FileInputStream(args[0]), ProcessDefinition.class);
   
    ProcessInstance pi = pd.createInstance();
   
    pi.set("", "fieldName", "1");
   
    try{
      pi.execute();
     
    }catch(Exception e){
      e.printStackTrace();
    }
   
View Full Code Here

    final ProcessDefinition definition = (ProcessDefinition) GlobalContext.deserialize(
        inputStream, ProcessDefinition.class);
   
    final HashMap statusCode = options.getStatusCode();
   
    ProcessInstance instance = new DefaultProcessInstance(){

      public String getStatus(String scope) throws Exception {
        Activity act =  definition.getActivity(scope);
       
        if(act instanceof ProcessDefinition) return Activity.STATUS_RUNNING;
View Full Code Here

   public void ejbCreate () {}
  
   public void onMessage (Message omessage)
   {
     String tracingTag = null;
  ProcessInstance instance = null;
  Activity activity = null;
//  boolean bRetry = false;
 
  ProcessManagerRemote pmb = null;
  try
  {     
    pmb = (new ProcessManagerFactoryBean()).getProcessManager();
   
    System.out.println ("WorkProcessor::onMessage() called...");
   
    MapMessage message = (MapMessage)omessage;
 
   
    String instanceId = message.getString("instance");
    String definitionName = message.getString("processDefinition");
    tracingTag = message.getString("tracingTag");
//    bRetry = message.getBoolean("retry");
//    String serviceName = message.getString("service");
//    String operationName = message.getString("operationName");

   
    instance = pmb.getProcessInstance(instanceId);
    if(instance.isRunning("")){ // if STOP signaled, don't execute anymore.
      activity = instance.getProcessDefinition().getActivity(tracingTag);
      activity.setRetryCount(instance, 5);
      instance.execute(tracingTag);
      pmb.applyChanges();
    }
   
    //ProcessDefinition pd = ProcessDefinition.getDefinition(definitionName, instance.getProcessTransactionContext());
   
View Full Code Here

            setProcessVersionId(reqMap.getString("definitionVersionId", ""));
            setProcessInstId(reqMap.getString("instanceId", ""));

            //replace with production version
            if (UEngineUtil.isNotEmpty(getProcessInstId())) {
                ProcessInstance instance = pm.getProcessInstance(getProcessInstId());
                setProcessVersionId(instance.getProcessDefinition().getId());
            } else if (!UEngineUtil.isNotEmpty(getProcessVersionId()) && UEngineUtil.isNotEmpty(pd)) {
                setProcessVersionId(pm.getProcessDefinitionProductionVersion(pd));
            }

            if (UEngineUtil.isNotEmpty(lastInstanceId)) {
View Full Code Here

    }

  @Override
  protected void executeActivity(ProcessInstance instance) throws Exception {

    final ProcessInstance thisInstance = instance;
   
    final Vector outStrings =new Vector();
    SystemLauncher sl =new SystemLauncher(){
      public void write(String out){
        outStrings.add(out);
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.