Package com.founder.fix.bpmn2extensions.fixflow

Examples of com.founder.fix.bpmn2extensions.fixflow.AssignPolicyType


   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetAssignPolicyType(AssignPolicyType newAssignPolicyType, NotificationChain msgs) {
    AssignPolicyType oldAssignPolicyType = assignPolicyType;
    assignPolicyType = newAssignPolicyType;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FixFlowPackage.DOCUMENT_ROOT__ASSIGN_POLICY_TYPE, oldAssignPolicyType, newAssignPolicyType);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here


        BpmnModelUtil.addExtensionElement(task, FixFlowPackage.Literals.DOCUMENT_ROOT__FORM_URI_VIEW, formUri);
      }
      //分配策略
      JsonNode policyTypeNode = getProperty(PROPERTY_USERTASK_POLICYTYPE, elementNode);
      if(policyTypeNode != null){
        AssignPolicyType assignPolicyType = FixFlowFactory.eINSTANCE.createAssignPolicyType();
        assignPolicyType.setId(policyTypeNode.asText());
        String expressionBody = getPropertyValueAsString(PROPERTY_USERTASK_ASSIGNEXPRESSION, elementNode);
        if(StringUtil.isNotEmpty(expressionBody)){
          Expression policyExpression = FixFlowFactory.eINSTANCE.createExpression();
          policyExpression.setValue(expressionBody);
          policyExpression.setName(expressionBody);
          assignPolicyType.setExpression(policyExpression);
        }
        BpmnModelUtil.addExtensionElement(task, FixFlowPackage.Literals.DOCUMENT_ROOT__ASSIGN_POLICY_TYPE, assignPolicyType);
      }
      //转换处理人
      JsonNode assignmentNode = getProperty(PROPERTY_USERTASK_ASSIGNMENT, elementNode);
View Full Code Here

    // 根据任务定义上不同的策略调用不同的策略分配类
    // 为了兼容老的系统,当没有找到 assignPolicyType 类型的时候 就默认按照
    // bpmn2:potentialOwner bpmn2:humanPerformer 两种类型来分配任务
    // taskDefinition

    AssignPolicyType assignPolicyType = taskDefinition.getAssignPolicyType();
    if (assignPolicyType == null) {
      List<TaskAssigneeDefinitionTo> taskAssigneeDefinitionTos = taskDefinition.getTaskAssigneeDefinitionTos();

      for (TaskAssigneeDefinitionTo taskAssigneeDefinitionTo : taskAssigneeDefinitionTos) {

        if (taskAssigneeDefinitionTo.getUserIdExpression() != null) {
          List<String> resultList = executionExpression(taskAssigneeDefinitionTo.getUserIdExpression(), executionContext);

          if (resultList.size() > 0) {
            for (String userId : resultList) {

              if (userId != null && !userId.equals("")) {

                if (taskAssigneeDefinitionTo.getIdentityLinkType().toString().equals(IdentityLinkType.assignee.toString())) {
                  // assignable.addAssigneeUser(userId,
                  // taskAssigneeDefinitionTo.getIncludeExclusion());
                  if (userId.equals("fixflow_allusers")) {
                    throw new FixFlowException("任务分配给所有人的时候不能采用独占方式分配,请重新修改节点 " + ((TaskInstance) assignable).getNodeId()
                        + " 的任务分配定义");
                  }
                  assignable.setAssignee(userId);
                } else {
                  assignable.addCandidateUser(userId, taskAssigneeDefinitionTo.getIncludeExclusion());
                }
              }
            }
          }
        }

        if (taskAssigneeDefinitionTo.getGroupIdExpression() != null) {
          List<String> resultList = executionExpression(taskAssigneeDefinitionTo.getGroupIdExpression(), executionContext);

          if (resultList.size() > 0) {
            for (String groupId : resultList) {
              if (groupId != null && !groupId.equals("")) {

                if (taskAssigneeDefinitionTo.isContainsSub) {
                  List<GroupTo> groupTos = null;
                  try {
                    groupTos = Authentication.findGroupChildMembersIncludeByGroupId(groupId,
                        taskAssigneeDefinitionTo.getGroupTypeExpression());

                  } catch (Exception e) {
                    throw new FixFlowException("节点 " + ((TaskInstance) assignable).getNodeId() + " 的任务获取子分配组出错!", e);
                  }

                  if (groupTos != null) {

                    for (GroupTo groupTo : groupTos) {
                      GroupTo groupToObj = new GroupTo(groupTo.getGroupId(), taskAssigneeDefinitionTo.getGroupTypeExpression());

                      assignable.addCandidateGroup(groupToObj, taskAssigneeDefinitionTo.getIncludeExclusion());
                    }

                  } else {
                    throw new FixFlowException("节点 " + ((TaskInstance) assignable).getNodeId() + " 的任务获取子分配组出错!");
                  }

                } else {
                  GroupTo groupTo = new GroupTo(groupId, taskAssigneeDefinitionTo.getGroupTypeExpression());

                  assignable.addCandidateGroup(groupTo, taskAssigneeDefinitionTo.getIncludeExclusion());
                }

              }

            }
          }
        }

      }
    } else {
      String typeId = assignPolicyType.getId();
      AssignPolicyConfig assignPolicyConfig = Context.getProcessEngineConfiguration().getAssignPolicyConfig();
      AssignPolicy assignPolicy = null;
      for (AssignPolicy assignPolicyObj : assignPolicyConfig.getAssignPolicy()) {
        if (assignPolicyObj.getId().equals(typeId)) {
          assignPolicy = assignPolicyObj;
View Full Code Here

TOP

Related Classes of com.founder.fix.bpmn2extensions.fixflow.AssignPolicyType

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.