public static CmmnDeploymentEntityManager getCmmnDeploymentEntityManager() { return getCmmnDeploymentEntityManager(getCommandContext()); }
@Override public List<String> execute(CommandContext commandContext) { if (deploymentId == null) { throw new FlowableIllegalArgumentException("deploymentId is null"); } return CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).getDeploymentResourceNames(deploymentId); }
@Override public long executeCount(CommandContext commandContext) { checkQueryOk(); return CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).findDeploymentCountByQueryCriteria(this); }
@Override public List<CmmnDeployment> executeList(CommandContext commandContext) { checkQueryOk(); return CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).findDeploymentsByQueryCriteria(this); }
@Override public Void execute(CommandContext commandContext) { if (deploymentId == null) { throw new FlowableIllegalArgumentException("deploymentId is null"); } // Update all entities CmmnDeploymentEntity deployment = CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).findById(deploymentId); if (deployment == null) { throw new FlowableObjectNotFoundException("Could not find deployment with id " + deploymentId); } deployment.setParentDeploymentId(newParentDeploymentId); CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).update(deployment); return null; }
@Override public InputStream execute(CommandContext commandContext) { if (deploymentId == null) { throw new FlowableIllegalArgumentException("deploymentId is null"); } if (resourceName == null) { throw new FlowableIllegalArgumentException("resourceName is null"); } CmmnResourceEntity resource = CommandContextUtil.getCmmnResourceEntityManager(commandContext) .findResourceByDeploymentIdAndResourceName(deploymentId, resourceName); if (resource == null) { if (CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).findById(deploymentId) == null) { throw new FlowableObjectNotFoundException("deployment does not exist: " + deploymentId, CmmnDeploymentEntity.class); } else { throw new FlowableObjectNotFoundException("no resource found with name '" + resourceName + "' in deployment '" + deploymentId + "'", CmmnResourceEntity.class); } } return new ByteArrayInputStream(resource.getBytes()); }
protected void addFormDefinitionToCollection(List<FormDefinition> formDefinitions, String formKey, CaseDefinition caseDefinition) { FormDefinitionQuery formDefinitionQuery = formRepositoryService.createFormDefinitionQuery().formDefinitionKey(formKey); CmmnDeployment deployment = CommandContextUtil.getCmmnDeploymentEntityManager().findById(caseDefinition.getDeploymentId()); if (deployment.getParentDeploymentId() != null) { List<FormDeployment> formDeployments = formRepositoryService.createDeploymentQuery().parentDeploymentId(deployment.getParentDeploymentId()).list(); if (formDeployments != null && formDeployments.size() > 0) { formDefinitionQuery.deploymentId(formDeployments.get(0).getId()); } else { formDefinitionQuery.latestVersion(); } } else { formDefinitionQuery.latestVersion(); } FormDefinition formDefinition = formDefinitionQuery.singleResult(); if (formDefinition != null) { formDefinitions.add(formDefinition); } } }
protected void addDecisionTableToCollection(List<DmnDecisionTable> decisionTables, String decisionTableKey, CaseDefinition caseDefinition) { DmnDecisionTableQuery decisionTableQuery = dmnRepositoryService.createDecisionTableQuery().decisionTableKey(decisionTableKey); CmmnDeployment deployment = CommandContextUtil.getCmmnDeploymentEntityManager().findById(caseDefinition.getDeploymentId()); if (deployment.getParentDeploymentId() != null) { List<DmnDeployment> dmnDeployments = dmnRepositoryService.createDeploymentQuery().parentDeploymentId(deployment.getParentDeploymentId()).list(); if (dmnDeployments != null && dmnDeployments.size() > 0) { decisionTableQuery.deploymentId(dmnDeployments.get(0).getId()); } else { decisionTableQuery.latestVersion(); } } else { decisionTableQuery.latestVersion(); } DmnDecisionTable decisionTable = decisionTableQuery.singleResult(); if (decisionTable != null) { decisionTables.add(decisionTable); } } }
CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).insert(deployment); cmmnEngineConfiguration.getDeploymentManager().deploy(deployment, null); return deployment;
CmmnDeployment deployment = CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).findById(caseDefinition.getDeploymentId()); formInfo = formService.getFormInstanceModelByKeyAndParentDeploymentIdAndScopeId(planModel.getFormKey(), deployment.getParentDeploymentId(), caseInstanceId, ScopeTypes.CMMN, null, caseDefinition.getTenantId(), cmmnEngineConfiguration.isFallbackToDefaultTenant());