diff options
author | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-26 10:14:05 +0800 |
---|---|---|
committer | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-26 10:17:48 +0800 |
commit | 4467f07bc4a5e54f34de0bf326688d55aa836acb (patch) | |
tree | 93be4eddcbb79009e60b6b101b8d9c2691eeb894 /sdc-workflow-designer-server/src | |
parent | 2f4f12caf3bf04249ed3a0427e36c6b0693c74dd (diff) |
support input parameters for start event
Issue-ID: SDC-397
Change-Id: I10379069e7c829d38b87819c922404829eccb1bd
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-server/src')
2 files changed, 114 insertions, 0 deletions
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java new file mode 100644 index 00000000..dae42176 --- /dev/null +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java @@ -0,0 +1,103 @@ +/**
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class Parameter {
+ private static Logger log = LoggerFactory.getLogger(Parameter.class);
+ private String description = "";
+ private String name;
+ private String position;
+ private boolean required;
+ private String type;
+
+ // body parameter may be a json object
+ private Object value;
+
+ @JsonInclude(Include.NON_NULL)
+ private String valueSource;
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPosition() {
+ return position;
+ }
+
+ public void setPosition(String position) {
+ this.position = position;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+ public String getValueSource() {
+ return valueSource;
+ }
+
+ public void setValueSource(String valueSource) {
+ this.valueSource = valueSource;
+ }
+
+ public String toString() {
+ ObjectMapper mapper = new ObjectMapper();
+ String result = null;
+ try {
+ result = mapper.writeValueAsString(this);
+ } catch (JsonProcessingException e) {
+ log.error("fail to convert parameter to json string", e);
+ }
+ return result;
+ }
+
+}
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java index 963d332b..4f5ece61 100644 --- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java @@ -11,5 +11,16 @@ */
package org.onap.sdc.workflowdesigner.model;
+import java.util.List;
+
public class StartEvent extends Element {
+ private List<Parameter> parameters;
+
+ public List<Parameter> getParameters() {
+ return parameters;
+ }
+
+ public void setParameters(List<Parameter> parameters) {
+ this.parameters = parameters;
+ }
}
|