From 6730f94e26a84c78c3225d05f66b5347c19c613f Mon Sep 17 00:00:00 2001 From: Lvbo163 Date: Tue, 12 Dec 2017 17:02:34 +0800 Subject: converter supports error element Converter support bpmn error elements(error start/end event) Issue-ID: SDC-746 Change-Id: Ie29614ea066c06aa34152570ff75bf864ea2f90e Signed-off-by: Lvbo163 --- .../sdc/workflowdesigner/model/ErrorEndEvent.java | 28 ++++++++++++++++++++++ .../workflowdesigner/model/ErrorStartEvent.java | 28 ++++++++++++++++++++++ .../parser/Bpmn4ToscaJsonParser.java | 8 +++++++ .../bpmn_element_errorEndEvent_template.xml | 4 ++++ .../bpmn_element_errorStartEvent_template.xml | 4 ++++ 5 files changed, 72 insertions(+) create mode 100644 sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java create mode 100644 sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java create mode 100644 sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorEndEvent_template.xml create mode 100644 sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorStartEvent_template.xml (limited to 'sdc-workflow-designer-server/src') diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java new file mode 100644 index 00000000..4ab9fd3a --- /dev/null +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java @@ -0,0 +1,28 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ErrorEndEvent extends Element { + @JsonProperty("parameter") + private Parameter parameter; + + public Parameter getParameter() { + return parameter; + } + + public void setParameter(Parameter parameter) { + this.parameter = parameter; + } + +} diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java new file mode 100644 index 00000000..8e4fcd44 --- /dev/null +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java @@ -0,0 +1,28 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ErrorStartEvent extends Element { + @JsonProperty("parameter") + private Parameter parameter; + + public Parameter getParameter() { + return parameter; + } + + public void setParameter(Parameter parameter) { + this.parameter = parameter; + } + +} 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 4041a9ae..1b3a8779 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 @@ -23,6 +23,8 @@ import java.util.Map; 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.ErrorEndEvent; +import org.onap.sdc.workflowdesigner.model.ErrorStartEvent; import org.onap.sdc.workflowdesigner.model.ExclusiveGateway; import org.onap.sdc.workflowdesigner.model.IntermediateCatchEvent; import org.onap.sdc.workflowdesigner.model.ParallelGateway; @@ -163,6 +165,12 @@ public class Bpmn4ToscaJsonParser { case "endEvent": element = MAPPER.readValue(jsonObject, EndEvent.class); break; + case "errorStartEvent": + element = MAPPER.readValue(jsonObject, ErrorStartEvent.class); + break; + case "errorEndEvent": + element = MAPPER.readValue(jsonObject, ErrorEndEvent.class); + break; case "intermediateCatchEvent": element = MAPPER.readValue(jsonObject, IntermediateCatchEvent.class); break; diff --git a/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorEndEvent_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorEndEvent_template.xml new file mode 100644 index 00000000..aef14d92 --- /dev/null +++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorEndEvent_template.xml @@ -0,0 +1,4 @@ + + + + diff --git a/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorStartEvent_template.xml b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorStartEvent_template.xml new file mode 100644 index 00000000..56b08479 --- /dev/null +++ b/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorStartEvent_template.xml @@ -0,0 +1,4 @@ + + + + -- cgit 1.2.3-korg