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

The following examples show how to use org.camunda.bpm.engine.impl.pvm.process.ActivityImpl#getProcessDefinition() . 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: LegacyBehavior.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
protected static boolean isActivityWrappedInMultiInstanceBody(ActivityImpl activity) {
  ScopeImpl flowScope = activity.getFlowScope();

  if (flowScope != activity.getProcessDefinition()) {
    ActivityImpl flowScopeActivity = (ActivityImpl) flowScope;

    return flowScopeActivity.getActivityBehavior() instanceof MultiInstanceActivityBehavior;
  } else {
    return false;
  }
}
 
Example 3
Source File: AsyncProcessStartMigrationValidator.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
protected boolean isTopLevelActivity(ActivityImpl activity) {
  return activity.getFlowScope() == activity.getProcessDefinition();
}