use of org.alien4cloud.tosca.model.workflow.activities.CallOperationWorkflowActivity in project alien4cloud by alien4cloud.
the class WorkflowUtils method createRelationshipOperationStep.
public static WorkflowStep createRelationshipOperationStep(Workflow wf, String nodeId, String relationshipId, String interfaceName, String operationName, String operationHost) {
CallOperationWorkflowActivity task = new CallOperationWorkflowActivity();
task.setInterfaceName(interfaceName);
task.setOperationName(operationName);
RelationshipWorkflowStep step = new RelationshipWorkflowStep();
step.setTarget(nodeId);
step.setTargetRelationship(relationshipId);
step.setActivity(task);
step.setName(buildStepName(wf, step, 0));
step.setOperationHost(operationHost);
return step;
}
use of org.alien4cloud.tosca.model.workflow.activities.CallOperationWorkflowActivity in project alien4cloud by alien4cloud.
the class WorkflowGraphUtils method isStepEmpty.
public static boolean isStepEmpty(WorkflowStep step, TopologyContext topologyContext) {
// No activity
if (step.getActivity() == null) {
return true;
}
// Inline activity is never empty
if (step.getActivity() instanceof DelegateWorkflowActivity || step.getActivity() instanceof SetStateWorkflowActivity || step.getActivity() instanceof InlineWorkflowActivity) {
return false;
}
CallOperationWorkflowActivity callOperationWorkflowActivity = (CallOperationWorkflowActivity) step.getActivity();
NodeTemplate nodeTemplate = topologyContext.getTopology().getNodeTemplates().get(step.getTarget());
String stepInterfaceName = ToscaNormativeUtil.getLongInterfaceName(callOperationWorkflowActivity.getInterfaceName());
String stepOperationName = callOperationWorkflowActivity.getOperationName();
if (step instanceof NodeWorkflowStep) {
return !hasImplementation(nodeTemplate, NodeType.class, topologyContext, stepInterfaceName, stepOperationName);
} else if (step instanceof RelationshipWorkflowStep) {
RelationshipWorkflowStep relationshipWorkflowStep = (RelationshipWorkflowStep) step;
RelationshipTemplate relationshipTemplate = nodeTemplate.getRelationships().get(relationshipWorkflowStep.getTargetRelationship());
return !hasImplementation(relationshipTemplate, RelationshipType.class, topologyContext, stepInterfaceName, stepOperationName);
} else {
return false;
}
}
use of org.alien4cloud.tosca.model.workflow.activities.CallOperationWorkflowActivity in project alien4cloud by alien4cloud.
the class WorkflowUtils method createOperationStep.
public static WorkflowStep createOperationStep(Workflow wf, String nodeId, String interfaceName, String operationName) {
CallOperationWorkflowActivity task = new CallOperationWorkflowActivity();
task.setInterfaceName(interfaceName);
task.setOperationName(operationName);
NodeWorkflowStep step = new NodeWorkflowStep();
step.setTarget(nodeId);
step.setActivity(task);
step.setName(buildStepName(wf, step, 0));
return step;
}
Aggregations