Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.UserTask


            bpmConfNode.setBpmConfBase(bpmConfBase);
            bpmConfNodeManager.save(bpmConfNode);
        }

        // 配置参与者
        UserTask userTask = (UserTask) bpmnModel.getFlowElement(node.getId());
        int index = 1;
        index = this.processUserTaskConf(bpmConfNode, userTask.getAssignee(),
                0, index);

        for (String candidateUser : userTask.getCandidateUsers()) {
            index = this.processUserTaskConf(bpmConfNode, candidateUser, 1,
                    index);
        }

        for (String candidateGroup : userTask.getCandidateGroups()) {
            this.processUserTaskConf(bpmConfNode, candidateGroup, 2, index);
        }

        // 配置监听器
        this.processListener(userTask.getExecutionListeners(), bpmConfNode);
        this.processListener(userTask.getTaskListeners(), bpmConfNode);
        // 配置表单
        this.processForm(userTask, bpmConfNode);

        // 会签
        if (userTask.getLoopCharacteristics() != null) {
            BpmConfCountersign bpmConfCountersign = new BpmConfCountersign();
            bpmConfCountersign.setType(0);
            bpmConfCountersign.setRate(100);
            bpmConfCountersign.setBpmConfNode(bpmConfNode);
            bpmConfCountersign.setSequential(userTask.getLoopCharacteristics()
                    .isSequential() ? 1 : 0);
            getBpmConfCountersignManager().save(bpmConfCountersign);
        }
    }
View Full Code Here


        if (useDefaultUserTaskParser) {
            new UserTaskParseHandler().parse(bpmnParse, baseElement);
        }

        UserTask userTask = (UserTask) baseElement;
        logger.info("bpmnParse : {}, userTask : {}", bpmnParse, userTask);

        TaskDefinition taskDefinition = (TaskDefinition) bpmnParse
                .getCurrentActivity().getProperty(
                        UserTaskParseHandler.PROPERTY_TASK_DEFINITION);
View Full Code Here

    public void parse(BpmnParse bpmnParse, BaseElement baseElement) {
        if (!(baseElement instanceof UserTask)) {
            return;
        }

        UserTask userTask = (UserTask) baseElement;
        logger.info("bpmnParse : {}, userTask : {}", bpmnParse, userTask);

        TaskDefinition taskDefinition = (TaskDefinition) bpmnParse
                .getCurrentActivity().getProperty(
                        UserTaskParseHandler.PROPERTY_TASK_DEFINITION);
View Full Code Here

   
    flowElement = model.getMainProcess().getFlowElement("userTask1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof UserTask);
    assertEquals("userTask1", flowElement.getId());
    UserTask userTask = (UserTask) flowElement;
    assertTrue(userTask.getCandidateUsers().size() == 1);
    assertTrue(userTask.getCandidateGroups().size() == 1);
    assertTrue(userTask.getFormProperties().size() == 2);
   
    flowElement = model.getMainProcess().getFlowElement("subprocess1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("subprocess1", flowElement.getId());
View Full Code Here

    assertEquals("innerBoundaryEvent", boundaryEvent.getId());
   
    FlowElement taskElement = innerSubProcess.getFlowElement("usertask");
    assertNotNull(taskElement);
    assertTrue(taskElement instanceof UserTask);
    UserTask userTask = (UserTask) taskElement;
    assertEquals("usertask", userTask.getId());
    eventList = userTask.getBoundaryEvents();
    assertEquals(1, eventList.size());
    boundaryEvent = eventList.get(0);
    assertEquals("taskBoundaryEvent", boundaryEvent.getId());
  }
View Full Code Here

  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElement("usertask");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof UserTask);
    assertEquals("usertask", flowElement.getId());
    UserTask userTask = (UserTask) flowElement;
    assertEquals("usertask", userTask.getId());
    assertEquals("User task", userTask.getName());
    assertEquals("testKey", userTask.getFormKey());
    assertEquals("40", userTask.getPriority());
    assertEquals("2012-11-01", userTask.getDueDate());
    assertEquals("defaultCategory", userTask.getCategory());
   
    assertEquals("gonzo", userTask.getOwner());
    assertEquals("kermit", userTask.getAssignee());
    assertEquals(2, userTask.getCandidateUsers().size());
    assertTrue(userTask.getCandidateUsers().contains("kermit"));
    assertTrue(userTask.getCandidateUsers().contains("fozzie"));
    assertEquals(2, userTask.getCandidateGroups().size());
    assertTrue(userTask.getCandidateGroups().contains("management"));
    assertTrue(userTask.getCandidateGroups().contains("sales"));
   
    assertEquals(2, userTask.getCustomUserIdentityLinks().size());
    assertEquals(1, userTask.getCustomGroupIdentityLinks().size());
   
    assertTrue(userTask.getCustomUserIdentityLinks().get("bizAdmin").contains("kermit"));
    assertTrue(userTask.getCustomGroupIdentityLinks().get("bizAdmin").contains("management"));
    assertTrue(userTask.getCustomGroupIdentityLinks().get("bizAdmin").contains("sales"));
    assertTrue(userTask.getCustomUserIdentityLinks().get("manager").contains("fozzie"));
    assertTrue(userTask.getCustomUserIdentityLinks().get("manager").contains("gonzo"));
   
    List<FormProperty> formProperties = userTask.getFormProperties();
    assertEquals(2, formProperties.size());
    FormProperty formProperty = formProperties.get(0);
    assertEquals("formId", formProperty.getId());
    assertEquals("formName", formProperty.getName());
    assertEquals("string", formProperty.getType());
    assertEquals("variable", formProperty.getVariable());
    assertEquals("${expression}", formProperty.getExpression());
    formProperty = formProperties.get(1);
    assertEquals("formId2", formProperty.getId());
    assertEquals("anotherName", formProperty.getName());
    assertEquals("long", formProperty.getType());
    assertTrue(StringUtils.isEmpty(formProperty.getVariable()));
    assertTrue(StringUtils.isEmpty(formProperty.getExpression()));
   
    List<ActivitiListener> listeners = userTask.getTaskListeners();
    assertEquals(3, listeners.size());
    ActivitiListener listener = (ActivitiListener) listeners.get(0);
    assertTrue(ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(listener.getImplementationType()));
    assertEquals("org.test.TestClass", listener.getImplementation());
    assertEquals("create", listener.getEvent());
View Full Code Here

    }
   
    FlowElement userFlowElement = model.getMainProcess().getFlowElement("edit");
    assertNotNull(userFlowElement);
    assertTrue(userFlowElement instanceof UserTask);
    UserTask userTask = (UserTask) userFlowElement;
    for (FormProperty formProperty :userTask.getFormProperties()) {
      if (formProperty.getId().equals("duplicated")) {
        checkFormProperty(formProperty, false, true, true);
      }
      if (formProperty.getId().equals("name")) {
        checkFormProperty(formProperty, false, true, true);
View Full Code Here

   
    flowElement = model.getMainProcess().getFlowElement("userTask1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof UserTask);
    assertEquals("userTask1", flowElement.getId());
    UserTask userTask = (UserTask) flowElement;
    assertTrue(userTask.getCandidateUsers().size() == 1);
    assertTrue(userTask.getCandidateGroups().size() == 1);
    assertTrue(userTask.getFormProperties().size() == 2);
   
    flowElement = model.getMainProcess().getFlowElement("subprocess1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("subprocess1", flowElement.getId());
View Full Code Here

    assertEquals("innerBoundaryEvent", boundaryEvent.getId());
   
    FlowElement taskElement = innerSubProcess.getFlowElement("usertask");
    assertNotNull(taskElement);
    assertTrue(taskElement instanceof UserTask);
    UserTask userTask = (UserTask) taskElement;
    assertEquals("usertask", userTask.getId());
    eventList = userTask.getBoundaryEvents();
    assertEquals(1, eventList.size());
    boundaryEvent = eventList.get(0);
    assertEquals("taskBoundaryEvent", boundaryEvent.getId());
  }
View Full Code Here

    }
   
    FlowElement userFlowElement = model.getMainProcess().getFlowElement("edit");
    assertNotNull(userFlowElement);
    assertTrue(userFlowElement instanceof UserTask);
    UserTask userTask = (UserTask) userFlowElement;
    for (FormProperty formProperty :userTask.getFormProperties()) {
      if (formProperty.getId().equals("duplicated")) {
        checkFormProperty(formProperty, false, true, true);
      }
      if (formProperty.getId().equals("name")) {
        checkFormProperty(formProperty, false, true, true);
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.UserTask

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.