summaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/main/java
diff options
context:
space:
mode:
authorElena Kuleshov <evn@att.com>2019-06-06 01:10:32 -0400
committerElena Kuleshov <evn@att.com>2019-06-10 12:25:11 -0400
commit0bac473ab80a2f64b85df51dbaf432ecde73341e (patch)
treefbf71af99a417a9dc3f7d3dc60ad21ce4afd943c /asdc-controller/src/main/java
parentd0cd4dc3d204e80a7419c97b6b0ec59273984a99 (diff)
Beans fixes to workflow record creation
Changes to enable cascading creates and proper id referencing Issue-ID: SO-1998 Signed-off-by: Kuleshov, Elena <evn@att.com> Change-Id: I6c08fc22fbbba1d0d2b8dc04e390cd0b3de64327
Diffstat (limited to 'asdc-controller/src/main/java')
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java
index daeda2f976..a769b6a2e4 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/WorkflowResource.java
@@ -122,13 +122,14 @@ public class WorkflowResource {
VnfResourceWorkflow vnfResourceWorkflow = new VnfResourceWorkflow();
vnfResourceWorkflow.setVnfResourceModelUUID(vfResourceModelUuid);
+ vnfResourceWorkflow.setWorkflow(workflow);
List<VnfResourceWorkflow> vnfResourceWorkflows = new ArrayList<VnfResourceWorkflow>();
vnfResourceWorkflows.add(vnfResourceWorkflow);
workflow.setVnfResourceWorkflow(vnfResourceWorkflows);
List<String> activityNames = getActivityNameList(artifact.getResult());
- List<WorkflowActivitySpecSequence> wfss = getWorkflowActivitySpecSequence(activityNames);
+ List<WorkflowActivitySpecSequence> wfss = getWorkflowActivitySpecSequence(activityNames, workflow);
workflow.setWorkflowActivitySpecSequence(wfss);
workflowRepo.save(workflow);
@@ -166,17 +167,21 @@ public class WorkflowResource {
return activityNameList;
}
- protected List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence(List<String> activityNames)
- throws Exception {
+ protected List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence(List<String> activityNames,
+ Workflow workflow) throws Exception {
if (activityNames == null || activityNames.size() == 0) {
return null;
}
List<WorkflowActivitySpecSequence> workflowActivitySpecs = new ArrayList<WorkflowActivitySpecSequence>();
+ int seqNo = 1;
for (String activityName : activityNames) {
ActivitySpec activitySpec = activityRepo.findByName(activityName);
if (activitySpec != null) {
WorkflowActivitySpecSequence workflowActivitySpec = new WorkflowActivitySpecSequence();
workflowActivitySpec.setActivitySpec(activitySpec);
+ workflowActivitySpec.setWorkflow(workflow);
+ workflowActivitySpec.setSeqNo(seqNo);
+ seqNo++;
workflowActivitySpecs.add(workflowActivitySpec);
}
}