diff options
author | Lvbo163 <lv.bo163@zte.com.cn> | 2017-12-08 15:33:02 +0800 |
---|---|---|
committer | Lvbo163 <lv.bo163@zte.com.cn> | 2017-12-08 15:33:02 +0800 |
commit | b90c961f7d6dc6497485ca7d90dcf1e83036a365 (patch) | |
tree | 0e24ddbddf83cf0ae7fde79d6c00a01656b47133 /sdc-workflow-designer-server | |
parent | 6e1ff6d5c2a04da9a29fe947304d84ee16383a98 (diff) |
Add support for script task
Add support for bpmn script task.
Issue-ID: SDC-741
Change-Id: I6520c4236071ca87f7508250d23e6679df5cf357
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-server')
3 files changed, 40 insertions, 0 deletions
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java new file mode 100644 index 00000000..01d224c8 --- /dev/null +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java @@ -0,0 +1,33 @@ +/**
+ * 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 ScriptTask extends Element {
+ private String scriptFormat;
+ private String script;
+
+ public String getScriptFormat() {
+ return scriptFormat;
+ }
+
+ public void setScriptFormat(String scriptFormat) {
+ this.scriptFormat = scriptFormat;
+ }
+
+ public String getScript() {
+ return script;
+ }
+
+ public void setScript(String script) {
+ this.script = script;
+ }
+}
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 dafe83f4..26756571 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 @@ -24,6 +24,7 @@ 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.ScriptTask;
import org.onap.sdc.workflowdesigner.model.SequenceFlow;
import org.onap.sdc.workflowdesigner.model.StartEvent;
import org.slf4j.Logger;
@@ -134,6 +135,9 @@ public class Bpmn4ToscaJsonParser { case "intermediateCatchEvent":
element = MAPPER.readValue(jsonObject, IntermediateCatchEvent.class);
break;
+ case "scriptTask":
+ element = MAPPER.readValue(jsonObject, ScriptTask.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_scriptTask_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_scriptTask_template.xml new file mode 100644 index 00000000..d50e4c4b --- /dev/null +++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_scriptTask_template.xml @@ -0,0 +1,3 @@ +<scriptTask id="${element.id}" name="${element.name}" scriptFormat="${element.scriptFormat}" activiti:autoStoreVariables="false">
+ <script><![CDATA[${element.script}]]></script>
+</scriptTask>
|