diff options
Diffstat (limited to 'sdc-workflow-designer-server/src')
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>
|