Search in sources :

Example 1 with ActivitySpec

use of org.onap.so.db.catalog.beans.ActivitySpec in project so by onap.

the class WorkflowResource method getWorkflowActivitySpecSequence.

protected List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence(List<String> activityNames, Workflow workflow) throws Exception {
    if (activityNames == null || activityNames.isEmpty()) {
        return null;
    }
    List<WorkflowActivitySpecSequence> workflowActivitySpecs = new ArrayList<>();
    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);
        }
    }
    return workflowActivitySpecs;
}
Also used : ArrayList(java.util.ArrayList) ActivitySpec(org.onap.so.db.catalog.beans.ActivitySpec) WorkflowActivitySpecSequence(org.onap.so.db.catalog.beans.WorkflowActivitySpecSequence)

Aggregations

ArrayList (java.util.ArrayList)1 ActivitySpec (org.onap.so.db.catalog.beans.ActivitySpec)1 WorkflowActivitySpecSequence (org.onap.so.db.catalog.beans.WorkflowActivitySpecSequence)1