aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2017-12-11 15:09:05 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2017-12-11 15:09:05 +0800
commit8fbae2c1cb3b4c5cb8a73b0226b9ad3bd64e3eae (patch)
treed11fc94460fcf0f7bbbfb393ada9e263db3a5dcf
parent4a62939436ddb538958c52c397befc9b1cb44435 (diff)
Converter support service task
Workflow converter support service task element of BPMN. Issue-ID: SDC-745 Change-Id: Ic4e4e839a97e35c8c9300862419153d389dba34d Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java16
-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_serviceTask_template.xml24
3 files changed, 44 insertions, 0 deletions
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java
new file mode 100644
index 00000000..407ca059
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.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 ServiceTask extends Element {
+
+}
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 519e77f1..b103f91d 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
@@ -28,6 +28,7 @@ import org.onap.sdc.workflowdesigner.model.Parameter;
import org.onap.sdc.workflowdesigner.model.Process;
import org.onap.sdc.workflowdesigner.model.ScriptTask;
import org.onap.sdc.workflowdesigner.model.SequenceFlow;
+import org.onap.sdc.workflowdesigner.model.ServiceTask;
import org.onap.sdc.workflowdesigner.model.StartEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -137,6 +138,9 @@ public class Bpmn4ToscaJsonParser {
case "intermediateCatchEvent":
element = MAPPER.readValue(jsonObject, IntermediateCatchEvent.class);
break;
+ case "serviceTask":
+ element = MAPPER.readValue(jsonObject, ServiceTask.class);
+ break;
case "scriptTask":
element = MAPPER.readValue(jsonObject, ScriptTask.class);
break;
diff --git a/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_serviceTask_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_serviceTask_template.xml
new file mode 100644
index 00000000..f5d63a23
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_serviceTask_template.xml
@@ -0,0 +1,24 @@
+
+<serviceTask id="${element.id}" name="${element.name}" activiti:class="${element.handler}">
+ <extensionElements>
+ <activiti:field name="uri">
+ <activiti:string><![CDATA[${element.url}]]></activiti:string>
+ </activiti:field>
+ <activiti:field name="method">
+ <activiti:string><![CDATA[${element.method}]]></activiti:string>
+ </activiti:field>
+ #if (${element.produces})
+ <activiti:field name="accept">
+ <activiti:string><![CDATA[${element.produces}]]></activiti:string>
+ </activiti:field>
+ #end
+ #if (${element.consumes})
+ <activiti:field name="contentType">
+ <activiti:string><![CDATA[${element.consumes}]]></activiti:string>
+ </activiti:field>
+ #end
+ <activiti:field name="parameters">
+ <activiti:string><![CDATA[${element.parameters}]]></activiti:string>
+ </activiti:field>
+ </extensionElements>
+</serviceTask>