use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class EventHandlerImpl method handleIntermediateEvent.
public void handleIntermediateEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) {
PvmExecutionImpl execution = eventSubscription.getExecution();
ActivityImpl activity = eventSubscription.getActivity();
ensureNotNull("Error while sending signal for event subscription '" + eventSubscription.getId() + "': " + "no activity associated with event subscription", "activity", activity);
if (payload instanceof Map) {
execution.setVariables((Map<String, Object>) payload);
}
if (activity.equals(execution.getActivity())) {
execution.signal("signal", null);
} else {
// and not the subprocess itself
if (activity.getActivityBehavior() instanceof EventSubProcessStartEventActivityBehavior) {
activity = (ActivityImpl) activity.getFlowScope();
}
execution.executeEventHandlerActivity(activity);
}
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class SignalEventHandler method handleStartEvent.
protected void handleStartEvent(EventSubscriptionEntity eventSubscription, Map<String, Object> payload, String businessKey, CommandContext commandContext) {
String processDefinitionId = eventSubscription.getConfiguration();
ensureNotNull("Configuration of signal start event subscription '" + eventSubscription.getId() + "' contains no process definition id.", processDefinitionId);
DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
if (processDefinition == null || processDefinition.isSuspended()) {
// ignore event subscription
LOG.debugIgnoringEventSubscription(eventSubscription, processDefinitionId);
} else {
ActivityImpl signalStartEvent = processDefinition.findActivity(eventSubscription.getActivityId());
PvmProcessInstance processInstance = processDefinition.createProcessInstance(businessKey, signalStartEvent);
processInstance.start(payload);
}
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class FoxFailedJobParseListenerTest method findActivity.
protected ActivityImpl findActivity(ProcessInstance pi, String activityId) {
ProcessInstanceWithVariablesImpl entity = (ProcessInstanceWithVariablesImpl) pi;
ProcessDefinitionEntity processDefEntity = entity.getExecutionEntity().getProcessDefinition();
assertNotNull(processDefEntity);
ActivityImpl activity = processDefEntity.findActivity(activityId);
assertNotNull(activity);
return activity;
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class FoxFailedJobParseListenerTest method testNotAsyncUserTaskParseFailedJobRetryTimeCycle.
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/parse/FoxFailedJobParseListenerTest.testUserTask.bpmn20.xml" })
public void testNotAsyncUserTaskParseFailedJobRetryTimeCycle() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("notAsyncUserTaskFailedJobRetryTimeCycle");
ActivityImpl userTask = findActivity(pi, "notAsyncTask");
checkNotContainingFoxFailedJobConfig(userTask);
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class FoxFailedJobParseListenerTest method testTimerBoundaryEventWithFailedJobRetryTimeCycle.
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/parse/FoxFailedJobParseListenerTest.testTimer.bpmn20.xml" })
public void testTimerBoundaryEventWithFailedJobRetryTimeCycle() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("boundaryEventWithFailedJobRetryTimeCycle");
ActivityImpl boundaryActivity = findActivity(pi, "boundaryTimerWithFailedJobRetryTimeCycle");
checkFoxFailedJobConfig(boundaryActivity);
}
Aggregations