support bpmn gateway elements

Converter supports bpmn gateway elements(ParallelGateway, ExclusiveGateway).

Issue-ID: SDC-742

Change-Id: Id7906e0744b299f82053945254e339efe8d27ccb
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java
new file mode 100644
index 0000000..eb0f4bb
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.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 ExclusiveGateway extends Element {

+    public static String type = "exclusiveGateway";

+}

diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java
new file mode 100644
index 0000000..93fae50
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.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 ParallelGateway extends Element {

+    public static String type = "parallelGateway";

+}

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 2675657..519e77f 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,7 +21,9 @@
 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.ExclusiveGateway;

 import org.onap.sdc.workflowdesigner.model.IntermediateCatchEvent;

+import org.onap.sdc.workflowdesigner.model.ParallelGateway;

 import org.onap.sdc.workflowdesigner.model.Parameter;

 import org.onap.sdc.workflowdesigner.model.Process;

 import org.onap.sdc.workflowdesigner.model.ScriptTask;

@@ -138,6 +140,12 @@
         case "scriptTask":

             element = MAPPER.readValue(jsonObject, ScriptTask.class);

             break;

+        case "exclusiveGateway":

+            element = MAPPER.readValue(jsonObject, ExclusiveGateway.class);

+            break;

+        case "parallelGateway":

+            element = MAPPER.readValue(jsonObject, ParallelGateway.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_exclusiveGateway_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_exclusiveGateway_template.xml
new file mode 100644
index 0000000..d9ab461
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_exclusiveGateway_template.xml
@@ -0,0 +1,2 @@
+

+<exclusiveGateway id="${element.id}" name="${element.name}"></exclusiveGateway>
\ No newline at end of file
diff --git a/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_parallelGateway_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_parallelGateway_template.xml
new file mode 100644
index 0000000..2766601
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_parallelGateway_template.xml
@@ -0,0 +1,2 @@
+

+<parallelGateway id="${element.id}" name="${element.name}"></parallelGateway>
\ No newline at end of file