Java Code Examples for org.activiti.engine.impl.pvm.delegate.ActivityExecution#isConcurrent()

The following examples show how to use org.activiti.engine.impl.pvm.delegate.ActivityExecution#isConcurrent() . 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: ScopeUtil.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
/**
 * Find the next scope execution in the parent execution hierarchy That method works different than
 * {@link #findScopeExecutionForScope(org.activiti.engine.impl.persistence.entity.ExecutionEntity, org.activiti.engine.impl.pvm.PvmScope)} which returns the most outer scope execution.
 * 
 * @param execution
 *            the execution from which to start the search
 * @return the next scope execution in the parent execution hierarchy
 */
public static ActivityExecution findScopeExecution(ActivityExecution execution) {

    while (execution.getParentId() != null && !execution.isScope()) {
        execution = execution.getParent();
    }

    if (execution != null && execution.isConcurrent()) {
        execution = execution.getParent();
    }

    return execution;

}
 
Example 2
Source File: InclusiveGatewayActivityBehavior.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
public boolean activeConcurrentExecutionsExist(ActivityExecution execution) {
    PvmActivity activity = execution.getActivity();
    if (execution.isConcurrent()) {
        for (ActivityExecution concurrentExecution : getLeaveExecutions(execution.getParent())) {
            if (concurrentExecution.isActive() && !concurrentExecution.getId().equals(execution.getId())) {
                // TODO: when is transitionBeingTaken cleared? Should we clear it?
                boolean reachable = false;
                PvmTransition pvmTransition = ((ExecutionEntity) concurrentExecution).getTransitionBeingTaken();
                if (pvmTransition != null) {
                    reachable = isReachable(pvmTransition.getDestination(), activity, new HashSet<>());
                } else {
                    reachable = isReachable(concurrentExecution.getActivity(), activity, new HashSet<>());
                }

                if (reachable) {
                    if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("an active concurrent execution found: '{}'", concurrentExecution.getActivity());
                    }
                    return true;
                }
            }
        }
    } else if (execution.isActive()) { // is this ever true?
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("an active concurrent execution found: '{}'", execution.getActivity());
        }
        return true;
    }

    return false;
}
 
Example 3
Source File: GatewayActivityBehavior.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
protected void lockConcurrentRoot(ActivityExecution execution) {
    ActivityExecution concurrentRoot = null;
    if (execution.isConcurrent()) {
        concurrentRoot = execution.getParent();
    } else {
        concurrentRoot = execution;
    }
    ((ExecutionEntity) concurrentRoot).forceUpdate();
}