Examples of Performer


Examples of com.microworkflow.execution.Performer

  public static Test suite() {
    return new TestSuite(TestIterative.class);
  }

  public void testIterative() {
    Primitive body=new Primitive("component", new Performer(){
      public Object execute() {
        String component=(String)getTarget();
        DomainObject domainObject=(DomainObject)get(O1_KEY);
        if (domainObject.getString() != null) {
          domainObject.setString(domainObject.getString().concat(component));
        } else {
          domainObject.setString(component);
        }
        return this;
      }
    });
    Iterative iterative=new Iterative(O1_KEY,
      new Performer(){
        public Object execute() {
          DomainObject target=(DomainObject)getTarget();
          return target.getComponents();
        }
      },
View Full Code Here

Examples of com.microworkflow.execution.Performer

    context.put(O2_KEY, new DomainObject("branch2"));
    context.put(O3_KEY, new DomainObject("branch3"));
  }
  public void testAndJoin() {
    // branch 1
    Activity branch1 = new Primitive(O1_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setSlotA("a");
        }
        return null;
      }
    });
    // branch 2
    Primitive p21 = new Primitive(O2_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setSlotA("aa");
        }
        return null;
      }
    });
    Primitive p22 = new Primitive(O2_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setSlotB("bb");
        }
        return null;
      }
    });
    Sequence branch2=new Sequence();
    branch2.addStep(p21).addStep(p22);
    // branch 3
    Primitive p31 = new Primitive(O3_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setSlotA("aaa");
        }
        return null;
      }
    });
    Primitive p32 = new Primitive(O3_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setSlotB("bbb");
        }
        return null;
      }
    });
    Primitive p33 = new Primitive(O3_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setSlotC("ccc");
        }
        return null;
      }
    });
    Sequence branch3=new Sequence();
    branch3.addStep(p31).addStep(p32).addStep(p33);
    //
    AndJoin join = new AndJoin();
    join.setBody(new Primitive(O1_KEY, "result", new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject do1=(DomainObject) getTarget();
          DomainObject do2=(DomainObject) get(O2_KEY);
          DomainObject do3=(DomainObject) get(O3_KEY);
View Full Code Here

Examples of com.microworkflow.execution.Performer

  }
  public static Test suite() {
    return new TestSuite(TestOrJoin.class);
  }
  public void testOrJoin() {
    Primitive p1 = new Primitive(O1_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setSlotA("A");
        }
        return null;
      }
    });
    Primitive p2 = new Primitive(O1_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setSlotB("B");
        }
        return null;
      }
    });
    Primitive p3 = new Primitive(O1_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setSlotC("C");
        }
        return null;
      }
    });
    OrJoin join = new OrJoin();
    join.setBody(new Primitive(O1_KEY, new Performer() {
      public Object execute() {
        if (context.containsKey(targetKey)) {
          DomainObject domainObject = (DomainObject) getTarget();
          domainObject.setCounter(domainObject.getCounter()+1)
        }
View Full Code Here

Examples of com.microworkflow.execution.Performer

   * The chain of activity is: work1, test1, work2, test2, back to work1, etc.
   *
   * @return the workflow definition.
   */
  protected Activity getDefinition() {
    Activity performer1 = new Primitive("Object1", new Performer() {
      public Object execute() {
        i=i+2;
        return null;
      }
    });
    Activity performer2 = new Primitive("Object2", new Performer() {
      public Object execute() {
        i=i-1;
        return null;
      }
    });
View Full Code Here

Examples of org.eclipse.bpmn2.Performer

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.PERFORMER: {
            Performer performer = (Performer) theEObject;
            T result = casePerformer(performer);
            if (result == null)
                result = caseResourceRole(performer);
            if (result == null)
                result = caseBaseElement(performer);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.