| | |
| | | extensionElement.setName(name); |
| | | attributes.forEach((key, value) -> { |
| | | ExtensionAttribute extensionAttribute = new ExtensionAttribute(key, value); |
| | | extensionAttribute.setNamespace(FLOWABLE_EXTENSIONS_NAMESPACE); |
| | | extensionElement.addAttribute(extensionAttribute); |
| | | }); |
| | | element.addExtensionElement(extensionElement); |
| | |
| | | } |
| | | Map<String, String> fieldsPermission = MapUtil.newHashMap(); |
| | | extensionElements.forEach(element -> { |
| | | String field = element.getAttributeValue(FLOWABLE_EXTENSIONS_NAMESPACE, FORM_FIELD_PERMISSION_ELEMENT_FIELD_ATTRIBUTE); |
| | | String permission = element.getAttributeValue(FLOWABLE_EXTENSIONS_NAMESPACE, FORM_FIELD_PERMISSION_ELEMENT_PERMISSION_ATTRIBUTE); |
| | | String field = element.getAttributeValue(null, FORM_FIELD_PERMISSION_ELEMENT_FIELD_ATTRIBUTE); |
| | | String permission = element.getAttributeValue(null, FORM_FIELD_PERMISSION_ELEMENT_PERMISSION_ATTRIBUTE); |
| | | if (StrUtil.isNotEmpty(field) && StrUtil.isNotEmpty(permission)) { |
| | | fieldsPermission.put(field, permission); |
| | | } |
| | |
| | | } |
| | | Map<Integer, BpmTaskRespVO.OperationButtonSetting> buttonSettings = Maps.newHashMapWithExpectedSize(extensionElements.size()); |
| | | extensionElements.forEach(element -> { |
| | | String id = element.getAttributeValue(FLOWABLE_EXTENSIONS_NAMESPACE, BUTTON_SETTING_ELEMENT_ID_ATTRIBUTE); |
| | | String displayName = element.getAttributeValue(FLOWABLE_EXTENSIONS_NAMESPACE, BUTTON_SETTING_ELEMENT_DISPLAY_NAME_ATTRIBUTE); |
| | | String enable = element.getAttributeValue(FLOWABLE_EXTENSIONS_NAMESPACE, BUTTON_SETTING_ELEMENT_ENABLE_ATTRIBUTE); |
| | | String id = element.getAttributeValue(null, BUTTON_SETTING_ELEMENT_ID_ATTRIBUTE); |
| | | String displayName = element.getAttributeValue(null, BUTTON_SETTING_ELEMENT_DISPLAY_NAME_ATTRIBUTE); |
| | | String enable = element.getAttributeValue(null, BUTTON_SETTING_ELEMENT_ENABLE_ATTRIBUTE); |
| | | if (StrUtil.isNotEmpty(id)) { |
| | | BpmTaskRespVO.OperationButtonSetting setting = new BpmTaskRespVO.OperationButtonSetting(); |
| | | buttonSettings.put(Integer.valueOf(id), setting.setDisplayName(displayName).setEnable(Boolean.parseBoolean(enable))); |
| | |
| | | |
| | | // 情况:StartEvent/EndEvent/UserTask/ServiceTask |
| | | if (currentElement instanceof StartEvent |
| | | || currentElement instanceof EndEvent |
| | | || currentElement instanceof UserTask |
| | | || currentElement instanceof ServiceTask) { |
| | | || currentElement instanceof EndEvent |
| | | || currentElement instanceof UserTask |
| | | || currentElement instanceof ServiceTask) { |
| | | // 添加元素 |
| | | FlowNode flowNode = (FlowNode) currentElement; |
| | | resultElements.add(flowNode); |
| | |
| | | && evalConditionExpress(variables, flow.getConditionExpression())); |
| | | if (matchSequenceFlow == null) { |
| | | matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(), |
| | | flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())); |
| | | flow -> ObjUtil.equal(gateway.getDefaultFlow(), flow.getId())); |
| | | // 特殊:没有默认的情况下,并且只有 1 个条件,则认为它是默认的 |
| | | if (matchSequenceFlow == null && gateway.getOutgoingFlows().size() == 1) { |
| | | matchSequenceFlow = gateway.getOutgoingFlows().get(0); |
| | |
| | | && evalConditionExpress(variables, flow.getConditionExpression())); |
| | | if (CollUtil.isEmpty(matchSequenceFlows)) { |
| | | matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(), |
| | | flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())); |
| | | flow -> ObjUtil.equal(gateway.getDefaultFlow(), flow.getId())); |
| | | // 特殊:没有默认的情况下,并且只有 1 个条件,则认为它是默认的 |
| | | if (CollUtil.isEmpty(matchSequenceFlows) && gateway.getOutgoingFlows().size() == 1) { |
| | | matchSequenceFlows = gateway.getOutgoingFlows(); |