Package org.jbpm.taskmgmt.def

Examples of org.jbpm.taskmgmt.def.TaskMgmtDefinition


  }

  protected void readSwimlanes(Element processDefinitionElement)
  {
    Iterator<?> iter = processDefinitionElement.elementIterator("swimlane");
    TaskMgmtDefinition taskMgmtDefinition = processDefinition.getTaskMgmtDefinition();
    while (iter.hasNext())
    {
      Element swimlaneElement = (Element)iter.next();
      String swimlaneName = swimlaneElement.attributeValue("name");
      if (swimlaneName == null)
      {
        addWarning("there's a swimlane without a name");
      }
      else
      {
        Swimlane swimlane = new Swimlane(swimlaneName);
        Element assignmentElement = swimlaneElement.element("assignment");

        if (assignmentElement != null)
        {

          if ((assignmentElement.attribute("actor-id") != null) || (assignmentElement.attribute("pooled-actors") != null))
          {
            swimlane.setActorIdExpression(assignmentElement.attributeValue("actor-id"));
            swimlane.setPooledActorsExpression(assignmentElement.attributeValue("pooled-actors"));

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


  }

  public void readTasks(Element element, TaskNode taskNode)
  {
    List<?> elements = element.elements("task");
    TaskMgmtDefinition tmd = processDefinition.getTaskMgmtDefinition();
    if (elements.size() > 0)
    {
      if (tmd == null)
      {
        tmd = new TaskMgmtDefinition();
      }
      processDefinition.addDefinition(tmd);

      for (Object taskElement : elements)
      {
View Full Code Here

    return variableAccesses;
  }

  public void readStartStateTask(Element startTaskElement, StartState startState)
  {
    TaskMgmtDefinition taskMgmtDefinition = processDefinition.getTaskMgmtDefinition();
    Task startTask = readTask(startTaskElement, taskMgmtDefinition, null);
    startTask.setStartState(startState);
    if (startTask.getName() == null)
    {
      startTask.setName(startState.getName());
    }
    taskMgmtDefinition.setStartTask(startTask);
  }
View Full Code Here

  }

  // verify swimlane assignments in second pass ///////////////////////////////
  public void verifySwimlaneAssignments()
  {
    TaskMgmtDefinition taskMgmtDefinition = processDefinition.getTaskMgmtDefinition();
    if ((taskMgmtDefinition != null) && (taskMgmtDefinition.getSwimlanes() != null))
    {
      for (Swimlane swimlane : taskMgmtDefinition.getSwimlanes().values())
      {
        Task startTask = taskMgmtDefinition.getStartTask();
        Swimlane startTaskSwimlane = (startTask != null ? startTask.getSwimlane() : null);

        if ((swimlane.getAssignmentDelegation() == null)
             && (swimlane.getActorIdExpression()==null)
             && (swimlane.getPooledActorsExpression()==null)
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();
   
    processDefinition = new ProcessDefinition();
    taskMgmtDefinition = new TaskMgmtDefinition();
    processDefinition.addDefinition(taskMgmtDefinition);
    buyer = new Swimlane("buyer");
    taskMgmtDefinition.addSwimlane(buyer);
    seller = new Swimlane("seller");
    taskMgmtDefinition.addSwimlane(seller);
View Full Code Here

    assertSame(c, token.getNode());
    assertEquals(0, getNbrOfTasks(token));
  }

  private void addOneTask(Token token) {
    TaskMgmtDefinition tmd = (TaskMgmtDefinition) processDefinition.getDefinition(TaskMgmtDefinition.class);
    Task task = tmd.getTask("watch movie amadeus");
   
    TaskMgmtInstance tmi = token.getProcessInstance().getTaskMgmtInstance();
    tmi.createTaskInstance(task, token);
  }
View Full Code Here

  public static int scenario = -1;
 
  public static class CreateTasks implements ActionHandler {
    private static final long serialVersionUID = 1L;
    public void execute(ExecutionContext executionContext) throws Exception {
      TaskMgmtDefinition tmd = (TaskMgmtDefinition) executionContext.getDefinition(TaskMgmtDefinition.class);
      Task task = tmd.getTask("watch movie amadeus");
   
      // create as many task instances as the scenario prescribes :
      //  0 tasks for scenario 1
      //  1 task for scenario 2
      //  2 tasks for scenario 3
View Full Code Here

      "  </start-state>" +
      "</process-definition>");
 
    processDefinition = saveAndReload(processDefinition);
 
    TaskMgmtDefinition taskMgmtDefinition = processDefinition.getTaskMgmtDefinition();
    Swimlane initiatorSwimlaneViaStartTask = taskMgmtDefinition.getStartTask().getSwimlane();
    assertNotNull(initiatorSwimlaneViaStartTask);
   
    Swimlane initiatorSwimlaneViaDefinition = taskMgmtDefinition.getSwimlane("initiator");
    assertSame(initiatorSwimlaneViaDefinition, initiatorSwimlaneViaStartTask);
  }
View Full Code Here

      "  <swimlane name='initiator'>" +
      "    <assignment class='assignment-specified-just-to-prevent-a-warning'/>" +
      "  </swimlane>" +
      "</process-definition>"
    );
    TaskMgmtDefinition taskMgmtDefinition = processDefinition.getTaskMgmtDefinition();
    Swimlane initiatorSwimlane = taskMgmtDefinition.getSwimlane("initiator");
    assertNotNull(initiatorSwimlane);
    assertEquals("initiator", initiatorSwimlane.getName());
  }
View Full Code Here

  public static class CreateTasks implements ActionHandler {
    private static final long serialVersionUID = 1L;
    public void execute(ExecutionContext executionContext) throws Exception {
      // this piece of code is executed at runtime
      TaskMgmtDefinition taskMgmtDefinition = (TaskMgmtDefinition) executionContext.getDefinition(TaskMgmtDefinition.class);
      Task task = taskMgmtDefinition.getTask("undress");
     
      TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance();
      for (int i = 1; i<scenario; i++) {
        tmi.createTaskInstance(task, executionContext.getToken());
      }
View Full Code Here

TOP

Related Classes of org.jbpm.taskmgmt.def.TaskMgmtDefinition

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.