flowable流程部署

 @Transactional
 @Override
    public Object deployModelId(String modelId, String categoryCode) {
        if (StringUtils.isBlank(modelId) || StringUtils.isBlank(categoryCode)) {
            return fail("模型Id/分类Id不能为空");
        }
        try {
            Model model = modelService.getModel(modelId.trim());
            BpmnModel bpmnModel = modelService.getBpmnModel(model);
            //流程租户标识 暂时不考虑这回事(源码from fhadmin.cn)
            String tenantId = "流程租户标识";
            Deployment deploy = repositoryService.createDeployment()
                    .name(model.getName())
                    .key(model.getKey())
                    .category(categoryCode)
                    .tenantId(tenantId)
                    .addBpmnModel(model.getKey() + ".bpmn", bpmnModel)
                    .deploy();
            return success("流程部署成功");
        } catch (Exception e) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return fail("流程部署失败,失败信息为---" + e.getMessage());
        }
    }
 
hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » flowable流程部署