提交 80ff1093 编写于 作者: T Tijs Rademakers

Merge branch 'dev-vasile-686' of https://github.com/vasiledirla/Activiti into activiti6

......@@ -216,6 +216,7 @@ public interface StencilConstants {
final String PROPERTY_MULETASK_PAYLOAD_EXPRESSION = "muletaskpayloadexpression";
final String PROPERTY_MULETASK_RESULT_VARIABLE = "muletaskresultvariable";
final String PROPERTY_SEQUENCEFLOW_DEFAULT = "defaultflow";
final String PROPERTY_SEQUENCEFLOW_CONDITION = "conditionsequenceflow";
final String PROPERTY_SEQUENCEFLOW_ORDER = "sequencefloworder";
final String PROPERTY_COLLAPSED_SUBPROCESS_REFERENCE = "subprocessreference";
......
......@@ -12,20 +12,13 @@
*/
package org.activiti.editor.language.json.converter;
import java.util.Map;
import org.activiti.bpmn.model.BaseElement;
import org.activiti.bpmn.model.BpmnModel;
import org.activiti.bpmn.model.ExtensionElement;
import org.activiti.bpmn.model.FlowElement;
import org.activiti.bpmn.model.FlowElementsContainer;
import org.activiti.bpmn.model.GraphicInfo;
import org.activiti.bpmn.model.SequenceFlow;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.activiti.bpmn.model.*;
import org.apache.commons.lang3.StringUtils;
import java.util.Map;
/**
* @author Tijs Rademakers
......@@ -96,6 +89,27 @@ public class SequenceFlowJsonConverter extends BaseBpmnJsonConverter {
propertiesNode.put(PROPERTY_SEQUENCEFLOW_CONDITION, sequenceFlow.getConditionExpression());
}
if (StringUtils.isNotEmpty(sequenceFlow.getSourceRef())) {
FlowElement sourceFlowElement = container.getFlowElement(sequenceFlow.getSourceRef());
if (sourceFlowElement != null) {
String defaultFlowId = null;
if (sourceFlowElement instanceof ExclusiveGateway) {
ExclusiveGateway parentExclusiveGateway = (ExclusiveGateway) sourceFlowElement;
defaultFlowId = parentExclusiveGateway.getDefaultFlow();
} else if (sourceFlowElement instanceof Activity) {
Activity parentActivity = (Activity) sourceFlowElement;
defaultFlowId = parentActivity.getDefaultFlow();
}
if (defaultFlowId != null && defaultFlowId.equals(sequenceFlow.getId())) {
propertiesNode.put(PROPERTY_SEQUENCEFLOW_DEFAULT, true);
}
}
}
if (sequenceFlow.getExecutionListeners().size() > 0) {
BpmnJsonConverterUtil.convertListenersToJson(sequenceFlow.getExecutionListeners(), true, propertiesNode);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册