Search in sources :

Example 1 with DeployModelCmd

use of com.plumdo.flow.cmd.DeployModelCmd in project plumdo-work by wengwh.

the class ModelDeployResource method deployModel.

@RequestMapping(value = "/model/{modelId}/deploy", method = RequestMethod.POST, produces = "application/json", name = "模型部署")
@ResponseStatus(value = HttpStatus.CREATED)
@Transactional(propagation = Propagation.REQUIRED)
public ProcessDefinitionResponse deployModel(@PathVariable String modelId) {
    Model model = getModelFromRequest(modelId);
    Deployment deployment = managementService.executeCommand(new DeployModelCmd(model.getId()));
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult();
    return restResponseFactory.createProcessDefinitionResponse(processDefinition);
}
Also used : Model(org.flowable.engine.repository.Model) Deployment(org.flowable.engine.repository.Deployment) ProcessDefinition(org.flowable.engine.repository.ProcessDefinition) DeployModelCmd(com.plumdo.flow.cmd.DeployModelCmd) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

DeployModelCmd (com.plumdo.flow.cmd.DeployModelCmd)1 Deployment (org.flowable.engine.repository.Deployment)1 Model (org.flowable.engine.repository.Model)1 ProcessDefinition (org.flowable.engine.repository.ProcessDefinition)1 Transactional (org.springframework.transaction.annotation.Transactional)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)1