Package org.jbpm.instantiation

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


            swimlane.setPooledActorsExpression(assignmentElement.attributeValue("pooled-actors"));

          }
          else
          {
            Delegation assignmentDelegation = readAssignmentDelegation(assignmentElement);
            swimlane.setAssignmentDelegation(assignmentDelegation);
          }
        }
        taskMgmtDefinition.addSwimlane(swimlane);
      }
View Full Code Here

        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 inform him/her.
      log.info("process xml information: 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

    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 = new Delegation();
      assignmentDelegation.read(assignmentElement, this);
    }

    return assignmentDelegation;
  }
View Full Code Here

  {
    TaskController taskController = new TaskController();

    if (taskControllerElement.attributeValue("class") != null)
    {
      Delegation taskControllerDelegation = new Delegation();
      taskControllerDelegation.read(taskControllerElement, this);
      taskController.setTaskControllerDelegation(taskControllerDelegation);

    }
    else
    {
View Full Code Here

    {
      action = readSingleAction(timerElement);
    }
    else
    {
      Delegation delegation = createMailDelegation("task-reminder", null, null, null, null);
      action = new Action(delegation);
    }
    createTimerAction.setTimerAction(action);
    addAction(task, Event.EVENTTYPE_TASK_CREATE, createTimerAction);
View Full Code Here

    else 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

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

   
    processDefinition = saveAndReload(processDefinition);
    taskMgmtDefinition = processDefinition.getTaskMgmtDefinition();
    Swimlane boss = taskMgmtDefinition.getSwimlane("boss");
    assertNotNull(boss);
    Delegation bossAssignmentDelegation = boss.getAssignmentDelegation();
    assertNotNull(bossAssignmentDelegation);
    String assignmentHandlerClassName = bossAssignmentDelegation.getClassName();
    assertNotNull(assignmentHandlerClassName);
    assertEquals("org.jbpm.TheOneAndOnly", assignmentHandlerClassName);
  }
View Full Code Here

    TaskNode taskNode = (TaskNode) processDefinition.getNode("t");
    Task task = taskNode.getTask("clean ceiling");
    TaskController taskController = task.getTaskController();
    assertTrue( (taskController.getVariableAccesses()==null)
                || (taskController.getVariableAccesses().isEmpty()) );
    Delegation taskControllerDelegation = taskController.getTaskControllerDelegation();
    assertNotNull(taskControllerDelegation);
    assertEquals("my-own-task-controller-handler-class", taskControllerDelegation.getClassName());
  }
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.