diff options
author | Lvbo163 <lv.bo163@zte.com.cn> | 2017-12-08 16:32:18 +0800 |
---|---|---|
committer | Lvbo163 <lv.bo163@zte.com.cn> | 2017-12-08 16:32:18 +0800 |
commit | 4a62939436ddb538958c52c397befc9b1cb44435 (patch) | |
tree | 1dbdc49b37dea093457cfbd411e78a3b184c2bee | |
parent | b90c961f7d6dc6497485ca7d90dcf1e83036a365 (diff) |
support bpmn gateway elements
Converter supports bpmn gateway elements(ParallelGateway, ExclusiveGateway).
Issue-ID: SDC-742
Change-Id: Id7906e0744b299f82053945254e339efe8d27ccb
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
5 files changed, 44 insertions, 0 deletions
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java new file mode 100644 index 00000000..eb0f4bba --- /dev/null +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java @@ -0,0 +1,16 @@ +/**
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the Apache License, Version 2.0
+ * and the Eclipse Public License v1.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ */
+package org.onap.sdc.workflowdesigner.model;
+
+public class ExclusiveGateway extends Element {
+ public static String type = "exclusiveGateway";
+}
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java new file mode 100644 index 00000000..93fae505 --- /dev/null +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java @@ -0,0 +1,16 @@ +/**
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the Apache License, Version 2.0
+ * and the Eclipse Public License v1.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ */
+package org.onap.sdc.workflowdesigner.model;
+
+public class ParallelGateway extends Element {
+ public static String type = "parallelGateway";
+}
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java index 26756571..519e77f1 100644 --- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java @@ -21,7 +21,9 @@ import java.util.List; import org.onap.sdc.workflowdesigner.model.DataObject;
import org.onap.sdc.workflowdesigner.model.Element;
import org.onap.sdc.workflowdesigner.model.EndEvent;
+import org.onap.sdc.workflowdesigner.model.ExclusiveGateway;
import org.onap.sdc.workflowdesigner.model.IntermediateCatchEvent;
+import org.onap.sdc.workflowdesigner.model.ParallelGateway;
import org.onap.sdc.workflowdesigner.model.Parameter;
import org.onap.sdc.workflowdesigner.model.Process;
import org.onap.sdc.workflowdesigner.model.ScriptTask;
@@ -138,6 +140,12 @@ public class Bpmn4ToscaJsonParser { case "scriptTask":
element = MAPPER.readValue(jsonObject, ScriptTask.class);
break;
+ case "exclusiveGateway":
+ element = MAPPER.readValue(jsonObject, ExclusiveGateway.class);
+ break;
+ case "parallelGateway":
+ element = MAPPER.readValue(jsonObject, ParallelGateway.class);
+ break;
default:
log.warn("Ignoring node: type '" + nodeType + "' is unkown");
return null;
diff --git a/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_exclusiveGateway_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_exclusiveGateway_template.xml new file mode 100644 index 00000000..d9ab4613 --- /dev/null +++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_exclusiveGateway_template.xml @@ -0,0 +1,2 @@ +
+<exclusiveGateway id="${element.id}" name="${element.name}"></exclusiveGateway>
\ No newline at end of file diff --git a/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_parallelGateway_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_parallelGateway_template.xml new file mode 100644 index 00000000..2766601b --- /dev/null +++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_parallelGateway_template.xml @@ -0,0 +1,2 @@ +
+<parallelGateway id="${element.id}" name="${element.name}"></parallelGateway>
\ No newline at end of file |