public T findDeployedDefinitionById(String definitionId) { checkInvalidDefinitionId(definitionId); T definition = getManager().getCachedResourceDefinitionEntity(definitionId); if (definition == null) { definition = getManager() .findLatestDefinitionById(definitionId); } checkDefinitionFound(definitionId, definition); definition = resolveDefinition(definition); return definition; }
public T findDeployedDefinitionByDeploymentAndKey(String deploymentId, String definitionKey) { T definition = getManager().findDefinitionByDeploymentAndKey(deploymentId, definitionKey); checkInvalidDefinitionByDeploymentAndKey(deploymentId, definitionKey, definition); definition = resolveDefinition(definition); return definition; }
/** * @return the latest version of the definition with the given key (from any tenant) * @throws ProcessEngineException if more than one tenant has a definition with the given key */ public T findDeployedLatestDefinitionByKey(String definitionKey) { T definition = getManager() .findLatestDefinitionByKey(definitionKey); checkInvalidDefinitionByKey(definitionKey, definition); definition = resolveDefinition(definition); return definition; }
public T findDeployedLatestDefinitionByKeyAndTenantId(String definitionKey, String tenantId) { T definition = getManager() .findLatestDefinitionByKeyAndTenantId(definitionKey, tenantId); checkInvalidDefinitionByKeyAndTenantId(definitionKey, tenantId, definition); definition = resolveDefinition(definition); return definition; }
public T findDeployedDefinitionByKeyVersionAndTenantId(final String definitionKey, final Integer definitionVersion, final String tenantId) { final CommandContext commandContext = Context.getCommandContext(); T definition = commandContext.runWithoutAuthorization(new Callable<T>() { public T call() throws Exception { return getManager().findDefinitionByKeyVersionAndTenantId(definitionKey, definitionVersion, tenantId); } }); checkInvalidDefinitionByKeyVersionAndTenantId(definitionKey, definitionVersion, tenantId, definition); definition = resolveDefinition(definition); return definition; }
public T findDeployedDefinitionByKeyVersionTagAndTenantId(final String definitionKey, final String definitionVersionTag, final String tenantId) { final CommandContext commandContext = Context.getCommandContext(); T definition = commandContext.runWithoutAuthorization(new Callable<T>() { public T call() throws Exception { return getManager().findDefinitionByKeyVersionTagAndTenantId(definitionKey, definitionVersionTag, tenantId); } }); checkInvalidDefinitionByKeyVersionTagAndTenantId(definitionKey, definitionVersionTag, tenantId, definition); definition = resolveDefinition(definition); return definition; }
public T call() throws Exception { return getManager().findDefinitionByKeyVersionAndTenantId(definitionKey, definitionVersion, tenantId); } });
public InstanceType findBpmnModelInstanceForDefinition(String definitionId) { InstanceType bpmnModelInstance = instanceCache.get(definitionId); if (bpmnModelInstance == null) { DefinitionType definition = definitionCache.findDeployedDefinitionById(definitionId); bpmnModelInstance = loadAndCacheBpmnModelInstance(definition); } return bpmnModelInstance; }
public T resolveDefinition(T definition) { String definitionId = definition.getId(); String deploymentId = definition.getDeploymentId(); T cachedDefinition = cache.get(definitionId); if (cachedDefinition == null) { synchronized (this) { cachedDefinition = cache.get(definitionId); if (cachedDefinition == null) { DeploymentEntity deployment = Context .getCommandContext() .getDeploymentManager() .findDeploymentById(deploymentId); deployment.setNew(false); cacheDeployer.deployOnlyGivenResourcesOfDeployment(deployment, definition.getResourceName(), definition.getDiagramResourceName()); cachedDefinition = cache.get(definitionId); } } checkInvalidDefinitionWasCached(deploymentId, definitionId, cachedDefinition); } if (cachedDefinition != null) { cachedDefinition.updateModifiableFieldsFromEntity(definition); } return cachedDefinition; }
public T findDeployedLatestDefinitionByKeyAndTenantId(String definitionKey, String tenantId) { T definition = getManager() .findLatestDefinitionByKeyAndTenantId(definitionKey, tenantId); checkInvalidDefinitionByKeyAndTenantId(definitionKey, tenantId, definition); definition = resolveDefinition(definition); return definition; }
public T findDeployedDefinitionByKeyVersionAndTenantId(final String definitionKey, final Integer definitionVersion, final String tenantId) { final CommandContext commandContext = Context.getCommandContext(); T definition = commandContext.runWithoutAuthorization(new Callable<T>() { public T call() throws Exception { return getManager().findDefinitionByKeyVersionAndTenantId(definitionKey, definitionVersion, tenantId); } }); checkInvalidDefinitionByKeyVersionAndTenantId(definitionKey, definitionVersion, tenantId, definition); definition = resolveDefinition(definition); return definition; }
public T findDeployedDefinitionByKeyVersionTagAndTenantId(final String definitionKey, final String definitionVersionTag, final String tenantId) { final CommandContext commandContext = Context.getCommandContext(); T definition = commandContext.runWithoutAuthorization(new Callable<T>() { public T call() throws Exception { return getManager().findDefinitionByKeyVersionTagAndTenantId(definitionKey, definitionVersionTag, tenantId); } }); checkInvalidDefinitionByKeyVersionTagAndTenantId(definitionKey, definitionVersionTag, tenantId, definition); definition = resolveDefinition(definition); return definition; }
public T call() throws Exception { return getManager().findDefinitionByKeyVersionTagAndTenantId(definitionKey, definitionVersionTag, tenantId); } });
public InstanceType findBpmnModelInstanceForDefinition(String definitionId) { InstanceType bpmnModelInstance = instanceCache.get(definitionId); if (bpmnModelInstance == null) { DefinitionType definition = definitionCache.findDeployedDefinitionById(definitionId); bpmnModelInstance = loadAndCacheBpmnModelInstance(definition); } return bpmnModelInstance; }
public T resolveDefinition(T definition) { String definitionId = definition.getId(); String deploymentId = definition.getDeploymentId(); T cachedDefinition = cache.get(definitionId); if (cachedDefinition == null) { synchronized (this) { cachedDefinition = cache.get(definitionId); if (cachedDefinition == null) { DeploymentEntity deployment = Context .getCommandContext() .getDeploymentManager() .findDeploymentById(deploymentId); deployment.setNew(false); cacheDeployer.deployOnlyGivenResourcesOfDeployment(deployment, definition.getResourceName(), definition.getDiagramResourceName()); cachedDefinition = cache.get(definitionId); } } checkInvalidDefinitionWasCached(deploymentId, definitionId, cachedDefinition); } if (cachedDefinition != null) { cachedDefinition.updateModifiableFieldsFromEntity(definition); } return cachedDefinition; }
public T findDeployedDefinitionById(String definitionId) { checkInvalidDefinitionId(definitionId); T definition = getManager().getCachedResourceDefinitionEntity(definitionId); if (definition == null) { definition = getManager() .findLatestDefinitionById(definitionId); } checkDefinitionFound(definitionId, definition); definition = resolveDefinition(definition); return definition; }
/** * @return the latest version of the definition with the given key (from any tenant) * @throws ProcessEngineException if more than one tenant has a definition with the given key */ public T findDeployedLatestDefinitionByKey(String definitionKey) { T definition = getManager() .findLatestDefinitionByKey(definitionKey); checkInvalidDefinitionByKey(definitionKey, definition); definition = resolveDefinition(definition); return definition; }
public T findDeployedDefinitionByDeploymentAndKey(String deploymentId, String definitionKey) { T definition = getManager().findDefinitionByDeploymentAndKey(deploymentId, definitionKey); checkInvalidDefinitionByDeploymentAndKey(deploymentId, definitionKey, definition); definition = resolveDefinition(definition); return definition; }
public T findDeployedLatestDefinitionByKeyAndTenantId(String definitionKey, String tenantId) { T definition = getManager() .findLatestDefinitionByKeyAndTenantId(definitionKey, tenantId); checkInvalidDefinitionByKeyAndTenantId(definitionKey, tenantId, definition); definition = resolveDefinition(definition); return definition; }
public T findDeployedDefinitionByKeyVersionAndTenantId(final String definitionKey, final Integer definitionVersion, final String tenantId) { final CommandContext commandContext = Context.getCommandContext(); T definition = commandContext.runWithoutAuthorization(new Callable<T>() { public T call() throws Exception { return getManager().findDefinitionByKeyVersionAndTenantId(definitionKey, definitionVersion, tenantId); } }); checkInvalidDefinitionByKeyVersionAndTenantId(definitionKey, definitionVersion, tenantId, definition); definition = resolveDefinition(definition); return definition; }