1 /* Copyright (c) 2019 AT&T Intellectual Property. #
\r
3 # Licensed under the Apache License, Version 2.0 (the "License"); #
\r
4 # you may not use this file except in compliance with the License. #
\r
5 # You may obtain a copy of the License at #
\r
7 # http://www.apache.org/licenses/LICENSE-2.0 #
\r
9 # Unless required by applicable law or agreed to in writing, software #
\r
10 # distributed under the License is distributed on an "AS IS" BASIS, #
\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
\r
12 # See the License for the specific language governing permissions and #
\r
13 # limitations under the License. #
\r
14 ##############################################################################*/
\r
17 package org.oran.otf.common.model.local;
\r
19 import org.oran.otf.common.utility.gson.Convert;
\r
20 import com.fasterxml.jackson.annotation.JsonCreator;
\r
21 import com.fasterxml.jackson.annotation.JsonProperty;
\r
22 import java.io.Serializable;
\r
23 import java.util.Date;
\r
24 import java.util.List;
\r
25 import java.util.Map;
\r
26 import org.bson.types.ObjectId;
\r
28 public class BpmnInstance implements Serializable {
\r
30 private static final long serialVersionUID = 1L;
\r
32 private String processDefinitionId;
\r
33 private String deploymentId;
\r
34 private int version;
\r
35 private ObjectId bpmnFileId;
\r
36 private ObjectId resourceFileId;
\r
37 private boolean isDeployed;
\r
38 private List<TestHeadNode> testHeads;
\r
39 private List<PfloNode> pflos;
\r
40 private Map<String, Object> testDataTemplate;
\r
41 private Date createdAt;
\r
42 private Date updatedAt;
\r
43 private ObjectId createdBy;
\r
44 private ObjectId updatedBy;
\r
46 public BpmnInstance() {
\r
50 public BpmnInstance(
\r
51 @JsonProperty("processDefinitionId") String processDefinitionId,
\r
52 @JsonProperty("deploymentId") String deploymentId,
\r
53 @JsonProperty("version") int version,
\r
54 @JsonProperty("bpmnFileId") ObjectId bpmnFileId,
\r
55 @JsonProperty("resourceFileId") ObjectId resourceFileId,
\r
56 @JsonProperty("isDeployed") boolean isDeployed,
\r
57 @JsonProperty("testHeads") List<TestHeadNode> testHeads,
\r
58 @JsonProperty("plfos") List<PfloNode> pflos,
\r
59 @JsonProperty("testDataTemplate") Map<String, Object> testDataTemplate,
\r
60 @JsonProperty("createdAt") Date createdAt,
\r
61 @JsonProperty("updateAt") Date updatedAt,
\r
62 @JsonProperty("createdBy") ObjectId createdBy,
\r
63 @JsonProperty("updatedBy") ObjectId updatedBy) {
\r
64 this.processDefinitionId = processDefinitionId;
\r
65 this.deploymentId = deploymentId;
\r
66 this.version = version;
\r
67 this.bpmnFileId = bpmnFileId;
\r
68 this.resourceFileId = resourceFileId;
\r
69 this.isDeployed = isDeployed;
\r
70 this.testHeads = testHeads;
\r
71 this.testDataTemplate = testDataTemplate;
\r
72 this.createdAt = createdAt;
\r
73 this.updatedAt = updatedAt;
\r
74 this.createdBy = createdBy;
\r
75 this.updatedBy = updatedBy;
\r
78 public String getProcessDefinitionId() {
\r
79 return processDefinitionId;
\r
82 public void setProcessDefinitionId(String processDefinitionId) {
\r
83 this.processDefinitionId = processDefinitionId;
\r
86 public String getDeploymentId() {
\r
87 return deploymentId;
\r
90 public void setDeploymentId(String deploymentId) {
\r
91 this.deploymentId = deploymentId;
\r
94 public int getVersion() {
\r
98 public void setVersion(int version) {
\r
99 this.version = version;
\r
102 public ObjectId getBpmnFileId() {
\r
106 public void setBpmnFileId(ObjectId bpmnFileId) {
\r
107 this.bpmnFileId = bpmnFileId;
\r
110 public ObjectId getResourceFileId() {
\r
111 return resourceFileId;
\r
114 public void setResourceFileId(ObjectId resourceFileId) {
\r
115 this.resourceFileId = resourceFileId;
\r
118 @JsonProperty(value="isDeployed")
\r
119 public boolean isDeployed() {
\r
123 public void setDeployed(boolean deployed) {
\r
124 isDeployed = deployed;
\r
127 public List<TestHeadNode> getTestHeads() {
\r
131 public void setTestHeads(List<TestHeadNode> testHeads) {
\r
132 this.testHeads = testHeads;
\r
135 public List<PfloNode> getPflos() {
\r
139 public void setPflos(List<PfloNode> pflos) {
\r
140 this.pflos = pflos;
\r
143 public Map<String, Object> getTestDataTemplate() {
\r
144 return testDataTemplate;
\r
147 public void setTestDataTemplate(Map<String, Object> testDataTemplate) {
\r
148 this.testDataTemplate = testDataTemplate;
\r
151 public Date getCreatedAt() {
\r
155 public void setCreatedAt(Date createdAt) {
\r
156 this.createdAt = createdAt;
\r
159 public Date getUpdatedAt() {
\r
163 public void setUpdatedAt(Date updatedAt) {
\r
164 this.updatedAt = updatedAt;
\r
167 public ObjectId getCreatedBy() {
\r
171 public void setCreatedBy(ObjectId createdBy) {
\r
172 this.createdBy = createdBy;
\r
175 public ObjectId getUpdatedBy() {
\r
179 public void setUpdatedBy(ObjectId updatedBy) {
\r
180 this.updatedBy = updatedBy;
\r
183 private String getObjectIdString(ObjectId value) {
\r
184 return value == null ? "\"\"" : "\"" + value.toString() + "\"";
\r
188 public String toString() {
\r
189 return Convert.objectToJson(this);
\r