示例#1
0
        public static CmmnCaseDefinition getCaseDefinitionToCall(VariableScope execution, BaseCallableElement callableElement)
        {
            string caseDefinitionKey = callableElement.getDefinitionKey(execution);
            string tenantId          = callableElement.getDefinitionTenantId(execution);

            DeploymentCache deploymentCache = DeploymentCache;

            CmmnCaseDefinition caseDefinition = null;

            if (callableElement.LatestBinding)
            {
                caseDefinition = deploymentCache.findDeployedLatestCaseDefinitionByKeyAndTenantId(caseDefinitionKey, tenantId);
            }
            else if (callableElement.DeploymentBinding)
            {
                string deploymentId = callableElement.DeploymentId;
                caseDefinition = deploymentCache.findDeployedCaseDefinitionByDeploymentAndKey(deploymentId, caseDefinitionKey);
            }
            else if (callableElement.VersionBinding)
            {
                int?version = callableElement.getVersion(execution);
                caseDefinition = deploymentCache.findDeployedCaseDefinitionByKeyVersionAndTenantId(caseDefinitionKey, version, tenantId);
            }

            return(caseDefinition);
        }
示例#2
0
        public static DecisionDefinition getDecisionDefinitionToCall(VariableScope execution, BaseCallableElement callableElement)
        {
            string decisionDefinitionKey = callableElement.getDefinitionKey(execution);
            string tenantId = callableElement.getDefinitionTenantId(execution);

            DeploymentCache deploymentCache = DeploymentCache;

            DecisionDefinition decisionDefinition = null;

            if (callableElement.LatestBinding)
            {
                decisionDefinition = deploymentCache.findDeployedLatestDecisionDefinitionByKeyAndTenantId(decisionDefinitionKey, tenantId);
            }
            else if (callableElement.DeploymentBinding)
            {
                string deploymentId = callableElement.DeploymentId;
                decisionDefinition = deploymentCache.findDeployedDecisionDefinitionByDeploymentAndKey(deploymentId, decisionDefinitionKey);
            }
            else if (callableElement.VersionBinding)
            {
                int?version = callableElement.getVersion(execution);
                decisionDefinition = deploymentCache.findDeployedDecisionDefinitionByKeyVersionAndTenantId(decisionDefinitionKey, version, tenantId);
            }
            else if (callableElement.VersionTagBinding)
            {
                string versionTag = callableElement.getVersionTag(execution);
                decisionDefinition = deploymentCache.findDeployedDecisionDefinitionByKeyVersionTagAndTenantId(decisionDefinitionKey, versionTag, tenantId);
            }

            return(decisionDefinition);
        }
示例#3
0
        public static ProcessDefinitionImpl getProcessDefinitionToCall(VariableScope execution, BaseCallableElement callableElement)
        {
            string processDefinitionKey = callableElement.getDefinitionKey(execution);
            string tenantId             = callableElement.getDefinitionTenantId(execution);

            DeploymentCache deploymentCache = DeploymentCache;

            ProcessDefinitionImpl processDefinition = null;

            if (callableElement.LatestBinding)
            {
                processDefinition = deploymentCache.findDeployedLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);
            }
            else if (callableElement.DeploymentBinding)
            {
                string deploymentId = callableElement.DeploymentId;
                processDefinition = deploymentCache.findDeployedProcessDefinitionByDeploymentAndKey(deploymentId, processDefinitionKey);
            }
            else if (callableElement.VersionBinding)
            {
                int?version = callableElement.getVersion(execution);
                processDefinition = deploymentCache.findDeployedProcessDefinitionByKeyVersionAndTenantId(processDefinitionKey, version, tenantId);
            }
            else if (callableElement.VersionTagBinding)
            {
                string versionTag = callableElement.getVersionTag(execution);
                processDefinition = deploymentCache.findDeployedProcessDefinitionByKeyVersionTagAndTenantId(processDefinitionKey, versionTag, tenantId);
            }

            return(processDefinition);
        }
示例#4
0
        protected internal virtual int?getVersion(CmmnActivityExecution execution)
        {
            CmmnExecution caseExecution = (CmmnExecution)execution;

            return(CallableElement.getVersion(caseExecution));
        }