summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-server
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2017-12-08 14:08:41 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2017-12-08 14:08:41 +0800
commit6e1ff6d5c2a04da9a29fe947304d84ee16383a98 (patch)
tree2d52f596f6f526a9f01eb133de4c9391c8e238d1 /sdc-workflow-designer-server
parentdddc0584ea7ace73025b4eee59c0c2c5dc339084 (diff)
Support IntermediateCatchEvent
Add support for BPMN IntermediateCatchEvent Issue-ID: SDC-740 Change-Id: Ib8abda18dfc146fffcf5edb396554f6efc106c61 Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-server')
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java25
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java52
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java4
-rw-r--r--sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_intermediateCatchEvent_template.xml6
4 files changed, 87 insertions, 0 deletions
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java
new file mode 100644
index 00000000..ae6260c4
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java
@@ -0,0 +1,25 @@
+/**
+ * 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 IntermediateCatchEvent extends Element {
+ private TimerEventDefinition timerEventDefinition;
+
+ public TimerEventDefinition getTimerEventDefinition() {
+ return timerEventDefinition;
+ }
+
+ public void setTimerEventDefinition(TimerEventDefinition timerEventDefinition) {
+ this.timerEventDefinition = timerEventDefinition;
+ }
+
+}
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java
new file mode 100644
index 00000000..c7b4b829
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java
@@ -0,0 +1,52 @@
+/**
+ * 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 TimerEventDefinition {
+ private String type;
+ private String timeDuration;
+ private String timeDate;
+ private String timeCycle;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getTimeDuration() {
+ return timeDuration;
+ }
+
+ public void setTimeDuration(String timeDuration) {
+ this.timeDuration = timeDuration;
+ }
+
+ public String getTimeDate() {
+ return timeDate;
+ }
+
+ public void setTimeDate(String timeDate) {
+ this.timeDate = timeDate;
+ }
+
+ public String getTimeCycle() {
+ return timeCycle;
+ }
+
+ public void setTimeCycle(String timeCycle) {
+ this.timeCycle = timeCycle;
+ }
+
+}
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 390dc0b9..dafe83f4 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,6 +21,7 @@ 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.IntermediateCatchEvent;
import org.onap.sdc.workflowdesigner.model.Parameter;
import org.onap.sdc.workflowdesigner.model.Process;
import org.onap.sdc.workflowdesigner.model.SequenceFlow;
@@ -130,6 +131,9 @@ public class Bpmn4ToscaJsonParser {
case "endEvent":
element = MAPPER.readValue(jsonObject, EndEvent.class);
break;
+ case "intermediateCatchEvent":
+ element = MAPPER.readValue(jsonObject, IntermediateCatchEvent.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_intermediateCatchEvent_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_intermediateCatchEvent_template.xml
new file mode 100644
index 00000000..ee2365ec
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_intermediateCatchEvent_template.xml
@@ -0,0 +1,6 @@
+
+<intermediateCatchEvent id="${element.id}" name="${element.name}">
+ <timerEventDefinition>
+ <timeDuration><![CDATA[${element.timerEventDefinition.timeDuration}]]></timeDuration>
+ </timerEventDefinition>
+</intermediateCatchEvent>