Search in sources :

Example 21 with ProcessDefinitionEntity

use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.

the class EventSubscriptionJobDeclaration method newJobInstance.

protected MessageEntity newJobInstance(EventSubscriptionEntity eventSubscription) {
    MessageEntity message = new MessageEntity();
    // initialize job
    message.setActivityId(eventSubscription.getActivityId());
    message.setExecutionId(eventSubscription.getExecutionId());
    message.setProcessInstanceId(eventSubscription.getProcessInstanceId());
    ProcessDefinitionEntity processDefinition = eventSubscription.getProcessDefinition();
    if (processDefinition != null) {
        message.setProcessDefinitionId(processDefinition.getId());
        message.setProcessDefinitionKey(processDefinition.getKey());
    }
    return message;
}
Also used : MessageEntity(org.camunda.bpm.engine.impl.persistence.entity.MessageEntity) ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)

Example 22 with ProcessDefinitionEntity

use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.

the class UserOperationLogContextEntryBuilder method inContextOf.

public UserOperationLogContextEntryBuilder inContextOf(JobDefinitionEntity jobDefinition) {
    entry.setJobDefinitionId(jobDefinition.getId());
    entry.setProcessDefinitionId(jobDefinition.getProcessDefinitionId());
    entry.setProcessDefinitionKey(jobDefinition.getProcessDefinitionKey());
    if (jobDefinition.getProcessDefinitionId() != null) {
        ProcessDefinitionEntity processDefinition = Context.getProcessEngineConfiguration().getDeploymentCache().findDeployedProcessDefinitionById(jobDefinition.getProcessDefinitionId());
        entry.setDeploymentId(processDefinition.getDeploymentId());
    }
    return this;
}
Also used : ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)

Example 23 with ProcessDefinitionEntity

use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.

the class DefaultConditionHandler method evaluateConditionStartByEventSubscription.

protected List<ConditionHandlerResult> evaluateConditionStartByEventSubscription(CommandContext commandContext, ConditionSet conditionSet) {
    List<EventSubscriptionEntity> subscriptions = findConditionalStartEventSubscriptions(commandContext, conditionSet);
    if (subscriptions.isEmpty()) {
        throw LOG.exceptionWhenEvaluatingConditionalStartEvent();
    }
    List<ConditionHandlerResult> results = new ArrayList<ConditionHandlerResult>();
    for (EventSubscriptionEntity subscription : subscriptions) {
        ProcessDefinitionEntity processDefinition = subscription.getProcessDefinition();
        if (!processDefinition.isSuspended()) {
            ActivityImpl activity = subscription.getActivity();
            if (evaluateCondition(conditionSet, activity)) {
                results.add(new ConditionHandlerResult(processDefinition, activity));
            }
        }
    }
    return results;
}
Also used : ActivityImpl(org.camunda.bpm.engine.impl.pvm.process.ActivityImpl) ArrayList(java.util.ArrayList) ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity) EventSubscriptionEntity(org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity)

Example 24 with ProcessDefinitionEntity

use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.

the class DeploymentCacheCfgTest method testPlugInOwnCacheImplementation.

@Test
public void testPlugInOwnCacheImplementation() {
    // given
    DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
    // when
    Cache<String, ProcessDefinitionEntity> cache = deploymentCache.getProcessDefinitionCache();
    // then
    assertThat(cache, instanceOf(MyCacheImplementation.class));
}
Also used : DeploymentCache(org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache) ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity) Test(org.junit.Test)

Example 25 with ProcessDefinitionEntity

use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.

the class FormPropertyHelper method initFormPropertiesOnScope.

public static void initFormPropertiesOnScope(VariableMap variables, PvmExecutionImpl execution) {
    ProcessDefinitionEntity pd = (ProcessDefinitionEntity) execution.getProcessDefinition();
    StartFormHandler startFormHandler = pd.getStartFormHandler();
    startFormHandler.submitFormVariables(variables, execution);
}
Also used : StartFormHandler(org.camunda.bpm.engine.impl.form.handler.StartFormHandler) ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)

Aggregations

ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)75 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)15 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)14 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)13 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)10 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)10 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)8 ArrayList (java.util.ArrayList)6 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)5 EventSubscriptionEntity (org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity)4 Deployment (org.camunda.bpm.engine.test.Deployment)4 InputStream (java.io.InputStream)3 ProcessInstanceModificationBuilderImpl (org.camunda.bpm.engine.impl.ProcessInstanceModificationBuilderImpl)3 CaseExecutionEntity (org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity)3 CommandExecutor (org.camunda.bpm.engine.impl.interceptor.CommandExecutor)3 IncidentEntity (org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity)3 ProcessInstanceWithVariablesImpl (org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl)3 Element (org.camunda.bpm.engine.impl.util.xml.Element)3 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2