Java Code Examples for org.camunda.bpm.engine.impl.pvm.process.ActivityImpl#getActivityId()

The following examples show how to use org.camunda.bpm.engine.impl.pvm.process.ActivityImpl#getActivityId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompensationEventCoverageHandler.java    From camunda-bpm-process-test-coverage with Apache License 2.0 6 votes vote down vote up
private void addCompensationEventCoverage(EventSubscriptionEntity eventSubscription) {
  if (Api.Camunda.supportsCompensationEventCoverage()) {

      final ActivityImpl activity = eventSubscription.getActivity();

      // Get process definition key
      final ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) activity.getProcessDefinition();
      final String processDefinitionKey = processDefinition.getKey();

      // Get compensation boundary event ID
      final ActivityImpl sourceEvent = (ActivityImpl) activity.getProperty(
          BpmnProperties.COMPENSATION_BOUNDARY_EVENT.getName());

      if (sourceEvent != null) {

          final String sourceEventId = sourceEvent.getActivityId();

          // Register covered element
          final CoveredFlowNode compensationBoundaryEvent = new CoveredFlowNode(processDefinitionKey, sourceEventId);
          compensationBoundaryEvent.setEnded(true);
          coverageTestRunState.addCoveredElement(compensationBoundaryEvent);

      }

  }
}
 
Example 2
Source File: CompensationUtil.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
private static String getSubscriptionActivityId(ActivityExecution execution, String activityRef) {
  ActivityImpl activityToCompensate = ((ExecutionEntity) execution).getProcessDefinition().findActivity(activityRef);

  if (activityToCompensate.isMultiInstance()) {

    ActivityImpl flowScope = (ActivityImpl) activityToCompensate.getFlowScope();
    return flowScope.getActivityId();
  } else {

    ActivityImpl compensationHandler = activityToCompensate.findCompensationHandler();
    if (compensationHandler != null) {
      return compensationHandler.getActivityId();
    } else {
      // if activityRef = subprocess and subprocess has no compensation handler
      return activityRef;
    }
  }
}
 
Example 3
Source File: ConditionalEventDefinition.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public ConditionalEventDefinition(Condition condition, ActivityImpl conditionalActivity) {
  super(null, EventType.CONDITONAL);
  this.activityId = conditionalActivity.getActivityId();
  this.conditionalActivity = conditionalActivity;
  this.condition = condition;
}