use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class DefaultMigrationInstructionGenerator method generateInstructionsForActivities.
protected List<ValidatingMigrationInstruction> generateInstructionsForActivities(Collection<ActivityImpl> sourceActivities, Collection<ActivityImpl> targetActivities, boolean updateEventTriggers, ValidatingMigrationInstructions existingInstructions) {
List<ValidatingMigrationInstruction> generatedInstructions = new ArrayList<ValidatingMigrationInstruction>();
for (ActivityImpl sourceActivity : sourceActivities) {
if (!existingInstructions.containsInstructionForSourceScope(sourceActivity)) {
for (ActivityImpl targetActivity : targetActivities) {
if (isValidActivity(sourceActivity) && isValidActivity(targetActivity) && migrationActivityMatcher.matchActivities(sourceActivity, targetActivity)) {
// for conditional events the update event trigger must be set
boolean updateEventTriggersForInstruction = sourceActivity.getActivityBehavior() instanceof ConditionalEventBehavior || updateEventTriggers && UpdateEventTriggersValidator.definesPersistentEventTrigger(sourceActivity);
ValidatingMigrationInstruction generatedInstruction = new ValidatingMigrationInstructionImpl(sourceActivity, targetActivity, updateEventTriggersForInstruction);
generatedInstructions.add(generatedInstruction);
}
}
}
}
return generatedInstructions;
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class ProcessDefinitionBuilder method createActivity.
public ProcessDefinitionBuilder createActivity(String id) {
ActivityImpl activity = scopeStack.peek().createActivity(id);
scopeStack.push(activity);
processElement = activity;
transition = null;
return this;
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class ProcessDefinitionBuilder method startTransition.
public ProcessDefinitionBuilder startTransition(String destinationActivityId, String transitionId) {
if (destinationActivityId == null) {
throw new PvmException("destinationActivityId is null");
}
ActivityImpl activity = getActivity();
transition = activity.createOutgoingTransition(transitionId);
unresolvedTransitions.add(new Object[] { transition, destinationActivityId });
processElement = transition;
return this;
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class ProcessDefinitionBuilder method buildProcessDefinition.
public PvmProcessDefinition buildProcessDefinition() {
for (Object[] unresolvedTransition : unresolvedTransitions) {
TransitionImpl transition = (TransitionImpl) unresolvedTransition[0];
String destinationActivityName = (String) unresolvedTransition[1];
ActivityImpl destination = processDefinition.findActivity(destinationActivityName);
if (destination == null) {
throw new RuntimeException("destination '" + destinationActivityName + "' not found. (referenced from transition in '" + transition.getSource().getId() + "')");
}
transition.setDestination(destination);
}
return processDefinition;
}
use of org.camunda.bpm.engine.impl.pvm.process.ActivityImpl in project camunda-bpm-platform by camunda.
the class OutputVariablesPropagator method visit.
@Override
public void visit(ActivityExecution execution) {
if (isProcessInstanceOfSubprocess(execution)) {
PvmExecutionImpl superExecution = (PvmExecutionImpl) execution.getSuperExecution();
ActivityImpl activity = superExecution.getActivity();
SubProcessActivityBehavior subProcessActivityBehavior = (SubProcessActivityBehavior) activity.getActivityBehavior();
subProcessActivityBehavior.passOutputVariables(superExecution, execution);
}
}
Aggregations