Examples of Delegation


Examples of org.jbpm.instantiation.Delegation

      "  </action>\n" +
      "</process-definition>"
    );
 
    Action action = processDefinition.getAction("burps");
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertTrue(instantiatableDelegate.getConfiguration().indexOf("a piece of configuration text")!=-1);
  }
View Full Code Here

Examples of org.jbpm.instantiation.Delegation

    );
   
    Node node = processDefinition.getNode("a");
    Event event = node.getEvent("node-enter");
    Action action = (Action) event.getActions().iterator().next();
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertEquals("org.foo.Burps", instantiatableDelegate.getClassName());
    assertEquals("constructor", instantiatableDelegate.getConfigType());
    assertTrue(instantiatableDelegate.getConfiguration().indexOf("this text should be passed in the constructor")!=-1 );
  }
View Full Code Here

Examples of org.jbpm.instantiation.Delegation

    Node node = processDefinition.getNode("a");
    assertEquals( 1, node.getLeavingTransitionsMap().size() );
    Transition transition = node.getDefaultLeavingTransition();
    Event event = transition.getEvent(Event.EVENTTYPE_TRANSITION);
    Action action = (Action) event.getActions().iterator().next();
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertEquals("org.foo.Burps", instantiatableDelegate.getClassName());
  }
View Full Code Here

Examples of org.jbpm.instantiation.Delegation

   
    Action processAction = processDefinition.getAction("scratch");
    assertEquals("scratch", processAction.getName());
    assertSame(processAction, transitionAction.getReferencedAction());
   
    Delegation instantiatableDelegate = processAction.getActionDelegation();
    assertEquals("com.itch.Scratch", instantiatableDelegate.getClassName());
  }
View Full Code Here

Examples of org.jbpm.instantiation.Delegation

      "</process-definition>");
   
    processDefinition = saveAndReload(processDefinition);
   
    Decision decision = (Decision) processDefinition.getNode("d");
    Delegation decisionDelegation = decision.decisionDelegation;
    assertNotNull(decisionDelegation);
    assertEquals("org.jbpm.graph.node.JpdlDbTest$MyDecisionHandler", decisionDelegation.getClassName());
    MyDecisionHandler decisionHandler = (MyDecisionHandler) decisionDelegation.instantiate();
    assertEquals("testing... one, two... testing", decisionHandler.decisionHandlerConfigText);
  }
View Full Code Here

Examples of org.jbpm.instantiation.Delegation

    } else if (actionElement.attribute("ref-name")!=null) {
      jpdlReader.addUnresolvedActionReference(actionElement, this);

    } else if (actionElement.attribute("class")!=null) {
      actionDelegation = new Delegation();
      actionDelegation.read(actionElement, jpdlReader);
     
    } else {
      jpdlReader.addWarning("action does not have class nor ref-name attribute "+actionElement.asXML());
    }
View Full Code Here

Examples of org.jbpm.instantiation.Delegation

    if (expression!=null) {
      decisionExpression = expression;

    } else if (decisionHandlerElement!=null) {
      decisionDelegation = new Delegation();
      decisionDelegation.read(decisionHandlerElement, jpdlReader);
    }

    Iterator iter = decisionElement.elementIterator("transition");
    while (iter.hasNext()) {
View Full Code Here

Examples of org.jbpm.instantiation.Delegation

            ) {
            swimlane.setActorIdExpression(assignmentElement.attributeValue("actor-id"));
            swimlane.setPooledActorsExpression(assignmentElement.attributeValue("pooled-actors"));
          
          } else {
            Delegation assignmentDelegation = readAssignmentDelegation(assignmentElement);
            swimlane.setAssignmentDelegation(assignmentDelegation);
          }
        } else {
          Task startTask = taskMgmtDefinition.getStartTask();
          if ( (startTask==null)
View Full Code Here

Examples of org.jbpm.instantiation.Delegation

         ) {
        task.setActorIdExpression(assignmentElement.attributeValue("actor-id"));
        task.setPooledActorsExpression(assignmentElement.attributeValue("pooled-actors"));
       
      } else {
        Delegation assignmentDelegation = readAssignmentDelegation(assignmentElement);
        task.setAssignmentDelegation(assignmentDelegation);
      }

    // if no assignment or swimlane is specified
    } else {
View Full Code Here

Examples of org.jbpm.instantiation.Delegation

   
    return task;
  }

  protected Delegation readAssignmentDelegation(Element assignmentElement) {
    Delegation assignmentDelegation = new Delegation();
    String expression = assignmentElement.attributeValue("expression");
    String actorId = assignmentElement.attributeValue("actor-id");
    String pooledActors = assignmentElement.attributeValue("pooled-actors");
   
    if (expression!=null){
        assignmentDelegation.setProcessDefinition(processDefinition);
        assignmentDelegation.setClassName("org.jbpm.identity.assignment.ExpressionAssignmentHandler");
        assignmentDelegation.setConfiguration("<expression>"+expression+"</expression>");
     
    } else {
      if ( (actorId!=null)
           || (pooledActors!=null)
         ) {
        assignmentDelegation.setProcessDefinition(processDefinition);
        assignmentDelegation.setClassName("org.jbpm.taskmgmt.assignment.ActorAssignmentHandler");
        String configuration = "";
        if (actorId!=null) {
          configuration += "<actorId>"+actorId+"</actorId>";
        }
        if (pooledActors!=null) {
          configuration += "<pooledActors>"+pooledActors+"</pooledActors>";
        }
        assignmentDelegation.setConfiguration(configuration);
       
      } else {
        assignmentDelegation.read(assignmentElement, this);
      }
    }
    return assignmentDelegation;
  }
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.