@RequestMapping( value = "/{topologyId}/workflows/{workflowName}/init", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public RestResponse<Workflow> initWorkflow( @PathVariable String topologyId, @PathVariable String workflowName) { Topology topology = topologyServiceCore.getMandatoryTopology(topologyId); topologyService.checkEditionAuthorizations(topology); topologyService.throwsErrorIfReleased(topology); Workflow wf = workflowBuilderService.reinitWorkflow( workflowName, workflowBuilderService.buildTopologyContext(topology)); alienDAO.save(topology); return RestResponseBuilder.<Workflow>builder().data(wf).build(); }
@RequestMapping( value = "/{topologyId}/workflows/{workflowName}/steps/{stepId}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) public RestResponse<Workflow> removeStep( @PathVariable String topologyId, @PathVariable String workflowName, @PathVariable String stepId) { Topology topology = topologyServiceCore.getMandatoryTopology(topologyId); topologyService.checkEditionAuthorizations(topology); topologyService.throwsErrorIfReleased(topology); Workflow wf = workflowBuilderService.removeStep(topology, workflowName, stepId, false); alienDAO.save(topology); return RestResponseBuilder.<Workflow>builder().data(wf).build(); }
@Override protected void processRelationshipOperation( DeleteRelationshipOperation operation, NodeTemplate nodeTemplate, RelationshipTemplate relationshipTemplate) { Topology topology = EditionContextManager.getTopology(); log.debug( "Removing the Relationship template <" + operation.getRelationshipName() + "> from the Node template <" + operation.getNodeName() + ">, Topology <" + topology.getId() + "> ."); topologyService.unloadType(topology, relationshipTemplate.getType()); nodeTemplate.getRelationships().remove(operation.getRelationshipName()); workflowBuilderService.removeRelationship( topology, operation.getNodeName(), operation.getRelationshipName(), relationshipTemplate); }
@RequestMapping( value = "/{topologyId}/workflows/{workflowName}/activities", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public RestResponse<Workflow> addActivity( @PathVariable String topologyId, @PathVariable String workflowName, @RequestBody TopologyWorkflowAddActivityRequest activityRequest) { Topology topology = topologyServiceCore.getMandatoryTopology(topologyId); topologyService.checkEditionAuthorizations(topology); topologyService.throwsErrorIfReleased(topology); Workflow wf = workflowBuilderService.addActivity( topology, workflowName, activityRequest.getRelatedStepId(), activityRequest.isBefore(), activityRequest.getActivity()); alienDAO.save(topology); return RestResponseBuilder.<Workflow>builder().data(wf).build(); }