Search in sources :

Example 1 with ResourceDefinitionEntity

use of org.camunda.bpm.engine.impl.repository.ResourceDefinitionEntity in project camunda-bpm-platform by camunda.

the class UserOperationLogContextEntryBuilder method inContextOf.

public UserOperationLogContextEntryBuilder inContextOf(TaskEntity task, List<PropertyChange> propertyChanges) {
    if (propertyChanges == null || propertyChanges.isEmpty()) {
        if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) {
            propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE);
        }
    }
    entry.setPropertyChanges(propertyChanges);
    ResourceDefinitionEntity definition = task.getProcessDefinition();
    if (definition != null) {
        entry.setProcessDefinitionKey(definition.getKey());
        entry.setDeploymentId(definition.getDeploymentId());
    } else if (task.getCaseDefinitionId() != null) {
        definition = task.getCaseDefinition();
        entry.setDeploymentId(definition.getDeploymentId());
    }
    entry.setProcessDefinitionId(task.getProcessDefinitionId());
    entry.setProcessInstanceId(task.getProcessInstanceId());
    entry.setExecutionId(task.getExecutionId());
    entry.setCaseDefinitionId(task.getCaseDefinitionId());
    entry.setCaseInstanceId(task.getCaseInstanceId());
    entry.setCaseExecutionId(task.getCaseExecutionId());
    entry.setTaskId(task.getId());
    return this;
}
Also used : ResourceDefinitionEntity(org.camunda.bpm.engine.impl.repository.ResourceDefinitionEntity)

Example 2 with ResourceDefinitionEntity

use of org.camunda.bpm.engine.impl.repository.ResourceDefinitionEntity in project camunda-bpm-platform by camunda.

the class UserOperationLogContextEntryBuilder method inContextOf.

public UserOperationLogContextEntryBuilder inContextOf(ExecutionEntity processInstance, List<PropertyChange> propertyChanges) {
    if (propertyChanges == null || propertyChanges.isEmpty()) {
        if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) {
            propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE);
        }
    }
    entry.setPropertyChanges(propertyChanges);
    entry.setProcessInstanceId(processInstance.getProcessInstanceId());
    entry.setProcessDefinitionId(processInstance.getProcessDefinitionId());
    entry.setExecutionId(processInstance.getId());
    entry.setCaseInstanceId(processInstance.getCaseInstanceId());
    ResourceDefinitionEntity definition = processInstance.getProcessDefinition();
    if (definition != null) {
        entry.setProcessDefinitionKey(definition.getKey());
        entry.setDeploymentId(definition.getDeploymentId());
    }
    return this;
}
Also used : ResourceDefinitionEntity(org.camunda.bpm.engine.impl.repository.ResourceDefinitionEntity)

Example 3 with ResourceDefinitionEntity

use of org.camunda.bpm.engine.impl.repository.ResourceDefinitionEntity in project camunda-bpm-platform by camunda.

the class DefaultDelegateInterceptor method getProcessApplicationForInvocation.

protected ProcessApplicationReference getProcessApplicationForInvocation(final DelegateInvocation invocation) {
    BaseDelegateExecution contextExecution = invocation.getContextExecution();
    ResourceDefinitionEntity contextResource = invocation.getContextResource();
    if (contextExecution != null) {
        return ProcessApplicationContextUtil.getTargetProcessApplication((CoreExecution) contextExecution);
    } else if (contextResource != null) {
        return ProcessApplicationContextUtil.getTargetProcessApplication(contextResource);
    } else {
        return null;
    }
}
Also used : BaseDelegateExecution(org.camunda.bpm.engine.delegate.BaseDelegateExecution) ResourceDefinitionEntity(org.camunda.bpm.engine.impl.repository.ResourceDefinitionEntity)

Aggregations

ResourceDefinitionEntity (org.camunda.bpm.engine.impl.repository.ResourceDefinitionEntity)3 BaseDelegateExecution (org.camunda.bpm.engine.delegate.BaseDelegateExecution)1