added svcapi ui and camunda code
[it/otf.git] / otf-service-api / src / main / java / org / oran / otf / common / model / local / BpmnInstance.java
1 /*  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
2 #                                                                              #\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
6 #                                                                              #\r
7 #       http://www.apache.org/licenses/LICENSE-2.0                             #\r
8 #                                                                              #\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
15 \r
16 \r
17 package org.oran.otf.common.model.local;\r
18 \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
27 \r
28 public class BpmnInstance implements Serializable {\r
29 \r
30   private static final long serialVersionUID = 1L;\r
31 \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
45 \r
46   public BpmnInstance() {\r
47   }\r
48 \r
49   @JsonCreator\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
76   }\r
77 \r
78   public String getProcessDefinitionId() {\r
79     return processDefinitionId;\r
80   }\r
81 \r
82   public void setProcessDefinitionId(String processDefinitionId) {\r
83     this.processDefinitionId = processDefinitionId;\r
84   }\r
85 \r
86   public String getDeploymentId() {\r
87     return deploymentId;\r
88   }\r
89 \r
90   public void setDeploymentId(String deploymentId) {\r
91     this.deploymentId = deploymentId;\r
92   }\r
93 \r
94   public int getVersion() {\r
95     return version;\r
96   }\r
97 \r
98   public void setVersion(int version) {\r
99     this.version = version;\r
100   }\r
101 \r
102   public ObjectId getBpmnFileId() {\r
103     return bpmnFileId;\r
104   }\r
105 \r
106   public void setBpmnFileId(ObjectId bpmnFileId) {\r
107     this.bpmnFileId = bpmnFileId;\r
108   }\r
109 \r
110   public ObjectId getResourceFileId() {\r
111     return resourceFileId;\r
112   }\r
113 \r
114   public void setResourceFileId(ObjectId resourceFileId) {\r
115     this.resourceFileId = resourceFileId;\r
116   }\r
117 \r
118   @JsonProperty(value="isDeployed")\r
119   public boolean isDeployed() {\r
120     return isDeployed;\r
121   }\r
122 \r
123   public void setDeployed(boolean deployed) {\r
124     isDeployed = deployed;\r
125   }\r
126 \r
127   public List<TestHeadNode> getTestHeads() {\r
128     return testHeads;\r
129   }\r
130 \r
131   public void setTestHeads(List<TestHeadNode> testHeads) {\r
132     this.testHeads = testHeads;\r
133   }\r
134 \r
135   public List<PfloNode> getPflos() {\r
136     return pflos;\r
137   }\r
138 \r
139   public void setPflos(List<PfloNode> pflos) {\r
140     this.pflos = pflos;\r
141   }\r
142 \r
143   public Map<String, Object> getTestDataTemplate() {\r
144     return testDataTemplate;\r
145   }\r
146 \r
147   public void setTestDataTemplate(Map<String, Object> testDataTemplate) {\r
148     this.testDataTemplate = testDataTemplate;\r
149   }\r
150 \r
151   public Date getCreatedAt() {\r
152     return createdAt;\r
153   }\r
154 \r
155   public void setCreatedAt(Date createdAt) {\r
156     this.createdAt = createdAt;\r
157   }\r
158 \r
159   public Date getUpdatedAt() {\r
160     return updatedAt;\r
161   }\r
162 \r
163   public void setUpdatedAt(Date updatedAt) {\r
164     this.updatedAt = updatedAt;\r
165   }\r
166 \r
167   public ObjectId getCreatedBy() {\r
168     return createdBy;\r
169   }\r
170 \r
171   public void setCreatedBy(ObjectId createdBy) {\r
172     this.createdBy = createdBy;\r
173   }\r
174 \r
175   public ObjectId getUpdatedBy() {\r
176     return updatedBy;\r
177   }\r
178 \r
179   public void setUpdatedBy(ObjectId updatedBy) {\r
180     this.updatedBy = updatedBy;\r
181   }\r
182 \r
183   private String getObjectIdString(ObjectId value) {\r
184     return value == null ? "\"\"" : "\"" + value.toString() + "\"";\r
185   }\r
186 \r
187   @Override\r
188   public String toString() {\r
189     return Convert.objectToJson(this);\r
190   }\r
191 }\r