Package org.jbpm.instantiation

Examples of org.jbpm.instantiation.Delegation


    String mailClassName = Mail.class.getName();
    if (JbpmConfiguration.Configs.hasObject("mail.class.name")) {
      mailClassName = JbpmConfiguration.Configs.getString("mail.class.name");
    }
    Delegation delegation = new Delegation(mailClassName);
    delegation.setProcessDefinition(processDefinition);
    delegation.setConfiguration(config.toString());
    return delegation;
  }
View Full Code Here


    } 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

                generatedConnections += suggestJoinNode(node);
                System.out.println("<actionNode id=\"" + node.getId() + "\" name=\"" + node.getName() + "\">");
                System.out.println("    <action type=\"expression\" dialect=\"java\" >");
                Action action = ((org.drools.jpdl.core.node.JpdlNode) node).getAction();
                if (action != null) {
                    Delegation delegation = action.getActionDelegation();
                    if (delegation != null) {
                        // System.out.println("Introspect = "+delegation.getClassName());
                        // System.out.println("replaced"+delegation.getClassName().replace(".","/"));
                        // Resource resource = ResourceFactory.newInputStreamResource(EpdlWriter.class.getResourceAsStream(delegation.getClassName().replace(".","/")));
                        // System.out.println(""+resource);
View Full Code Here

  }
 
  private static void initializeVariables(WorkItemImpl workItem, Task task, JpdlNodeInstance nodeInstance) {
    TaskController taskController = task.getTaskController();
    if (taskController != null) {
      Delegation taskControllerDelegation = taskController.getTaskControllerDelegation();
        if (taskControllerDelegation != null) {
          // TODO: delegation (API mismatch!)
        } else {
          List<VariableAccess> variableAccesses = taskController.getVariableAccesses();
          if (variableAccesses != null) {
View Full Code Here

  }
 
  public static void restoreVariables(WorkItemImpl workItem, Task task, JpdlNodeInstance nodeInstance) {
    TaskController taskController = task.getTaskController();
    if (taskController != null) {
      Delegation taskControllerDelegation = taskController.getTaskControllerDelegation();
      if (taskControllerDelegation != null) {
        // TODO: delegation (API mismatch!)
        } else {
          List<VariableAccess> variableAccesses = taskController.getVariableAccesses();
          if (variableAccesses != null) {
View Full Code Here

    }

    public void execute(NodeInstance from, String type) {
      String transitionName = null;
      try {
        Delegation decisionDelegation = getDecision().getDecisionDelegation();
        if (decisionDelegation != null) {
          DecisionHandler decisionHandler = (DecisionHandler) decisionDelegation.instantiate();
          transitionName = decisionHandler.decide(new JpdlExecutionContext());
        } else if (getDecision().getDecisionExpression() != null) {
          String decisionExpression = getDecision().getDecisionExpression();
          Object result = JbpmExpressionEvaluator.evaluate(
          decisionExpression, new JpdlExecutionContext());
View Full Code Here

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

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

    String template = element.attributeValue("template");
    String actors = element.attributeValue("actors");
    String to = element.attributeValue("to");
    String subject = jpdlReader.getProperty("subject", element);
    String text = jpdlReader.getProperty("text", element);
    Delegation delegation = jpdlReader.createMailDelegation(template, actors, to, subject, text);
    this.action = new Action(delegation);
  }
View Full Code Here

            ) {
            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

         ) {
        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 {
      // the user has to manage assignment manually, so we better warn him/her.
      addWarning("warning: no swimlane or assignment specified for task '"+taskElement.asXML()+"'");
    }

    // notify
    String notificationsText = taskElement.attributeValue("notify");
    if ( notificationsText!=null
         && ("true".equalsIgnoreCase(notificationsText)
             ||  "on".equalsIgnoreCase(notificationsText)
             || "yes".equalsIgnoreCase(notificationsText)
            )
       ) {
      String notificationEvent = Event.EVENTTYPE_TASK_ASSIGN;
      Event event = task.getEvent(notificationEvent);
      if (event==null) {
        event = new Event(notificationEvent);
        task.addEvent(event);
      }
      Delegation delegation = createMailDelegation(notificationEvent, null, null, null, null);
      Action action = new Action(delegation);
      action.setProcessDefinition(processDefinition);
      action.setName(task.getName());
      event.addAction(action);
    }
View Full Code Here

TOP

Related Classes of org.jbpm.instantiation.Delegation

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.