summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-server/src
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2017-12-12 17:02:34 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2017-12-12 17:02:34 +0800
commit6730f94e26a84c78c3225d05f66b5347c19c613f (patch)
tree1ee62b7f4259e845de611de60bf3fb72775ad967 /sdc-workflow-designer-server/src
parent8e65c48141a6fdc259728d68508dc7819611e261 (diff)
converter supports error element
Converter support bpmn error elements(error start/end event) Issue-ID: SDC-746 Change-Id: Ie29614ea066c06aa34152570ff75bf864ea2f90e Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-server/src')
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java28
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java28
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java8
-rw-r--r--sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorEndEvent_template.xml4
-rw-r--r--sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorStartEvent_template.xml4
5 files changed, 72 insertions, 0 deletions
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java
new file mode 100644
index 00000000..4ab9fd3a
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java
@@ -0,0 +1,28 @@
+/**
+ * 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;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ErrorEndEvent extends Element {
+ @JsonProperty("parameter")
+ private Parameter parameter;
+
+ public Parameter getParameter() {
+ return parameter;
+ }
+
+ public void setParameter(Parameter parameter) {
+ this.parameter = parameter;
+ }
+
+}
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java
new file mode 100644
index 00000000..8e4fcd44
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java
@@ -0,0 +1,28 @@
+/**
+ * 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;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ErrorStartEvent extends Element {
+ @JsonProperty("parameter")
+ private Parameter parameter;
+
+ public Parameter getParameter() {
+ return parameter;
+ }
+
+ public void setParameter(Parameter parameter) {
+ this.parameter = parameter;
+ }
+
+}
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 4041a9ae..1b3a8779 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
@@ -23,6 +23,8 @@ import java.util.Map;
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.ErrorEndEvent;
+import org.onap.sdc.workflowdesigner.model.ErrorStartEvent;
import org.onap.sdc.workflowdesigner.model.ExclusiveGateway;
import org.onap.sdc.workflowdesigner.model.IntermediateCatchEvent;
import org.onap.sdc.workflowdesigner.model.ParallelGateway;
@@ -163,6 +165,12 @@ public class Bpmn4ToscaJsonParser {
case "endEvent":
element = MAPPER.readValue(jsonObject, EndEvent.class);
break;
+ case "errorStartEvent":
+ element = MAPPER.readValue(jsonObject, ErrorStartEvent.class);
+ break;
+ case "errorEndEvent":
+ element = MAPPER.readValue(jsonObject, ErrorEndEvent.class);
+ break;
case "intermediateCatchEvent":
element = MAPPER.readValue(jsonObject, IntermediateCatchEvent.class);
break;
diff --git a/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorEndEvent_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorEndEvent_template.xml
new file mode 100644
index 00000000..aef14d92
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorEndEvent_template.xml
@@ -0,0 +1,4 @@
+
+<endEvent id="${element.id}" name="${element.name}">
+ <errorEventDefinition errorRef="${element.parameter.value}" />
+</endEvent>
diff --git a/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorStartEvent_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorStartEvent_template.xml
new file mode 100644
index 00000000..56b08479
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorStartEvent_template.xml
@@ -0,0 +1,4 @@
+
+<startEvent id="${element.id}" name="${element.name}">
+ <errorEventDefinition errorRef="${element.parameter.value}" />
+</startEvent>