当前位置: 首页>>代码示例>>Java>>正文


Java ActivityExecution.take方法代码示例

本文整理汇总了Java中org.activiti.engine.impl.pvm.delegate.ActivityExecution.take方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityExecution.take方法的具体用法?Java ActivityExecution.take怎么用?Java ActivityExecution.take使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.impl.pvm.delegate.ActivityExecution的用法示例。


在下文中一共展示了ActivityExecution.take方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) {
    ActivityExecution activityExecution = (ActivityExecution) execution;
    PvmTransition more = activityExecution.getActivity().findOutgoingTransition("more");
    PvmTransition done = activityExecution.getActivity().findOutgoingTransition("done");

    Integer value = (Integer) execution.getVariable(variableName);

    if (value == null) {
        execution.setVariable(variableName, from);
        activityExecution.take(more);

    } else {
        value = value + 1;

        if (value < to) {
            execution.setVariable(variableName, value);
            activityExecution.take(more);

        } else {
            activityExecution.take(done);
        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:While.java

示例2: execute

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) {
    PvmTransition transition;
    ActivityExecution activityExecution = (ActivityExecution) execution;
    String creditRating = (String) execution.getVariable("creditRating");
    if (creditRating.equals("AAA+")) {
        transition = activityExecution.getActivity().findOutgoingTransition("wow");
    } else if (creditRating.equals("Aaa-")) {
        transition = activityExecution.getActivity().findOutgoingTransition("nice");
    } else {
        transition = activityExecution.getActivity().findOutgoingTransition("default");
    }

    activityExecution.take(transition);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:15,代码来源:Decision.java

示例3: execute

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) {
    ActivityExecution activityExecution = (ActivityExecution) execution;
    String var = (String) execution.getVariable("var");

    PvmTransition transition;
    try {
        executeLogic(var);
        transition = activityExecution.getActivity().findOutgoingTransition("no-exception");
    } catch (Exception e) {
        transition = activityExecution.getActivity().findOutgoingTransition("exception");
    }
    activityExecution.take(transition);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:14,代码来源:ThrowsExceptionBehavior.java

示例4: execute

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) {
    ActivityExecution activityExecution = (ActivityExecution) execution;
    List<PvmTransition> outgoingTransitions = activityExecution.getActivity().getOutgoingTransitions();
    if (outgoingTransitions.isEmpty()) {
        activityExecution.end();
    } else {
        activityExecution.take(outgoingTransitions.get(0));
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:10,代码来源:Automatic.java

示例5: execute

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) {
    ActivityExecution activityExecution = (ActivityExecution) execution;
    PvmTransition defaultOutgoingTransition = activityExecution.getActivity().getOutgoingTransitions().get(0);
    activityExecution.take(defaultOutgoingTransition);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:6,代码来源:Automatic.java

示例6: signal

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
public void signal(ActivityExecution execution, String signalName, Object event) {
    PvmTransition transition = findTransition(execution, signalName);
    execution.take(transition);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:5,代码来源:WaitState.java

示例7: signal

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
public void signal(ActivityExecution execution, String signalName, Object signalData) throws Exception {
    PvmTransition transition = execution.getActivity().getOutgoingTransitions().get(0);
    execution.take(transition);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:5,代码来源:WaitState.java

示例8: execute

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) {
    ActivityExecution activityExecution = (ActivityExecution) execution;
    activityExecution.inactivate();
    lockConcurrentRoot(activityExecution);

    PvmActivity activity = activityExecution.getActivity();
    if (!activeConcurrentExecutionsExist(activityExecution)) {

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("inclusive gateway '{}' activates", activity.getId());
        }

        List<ActivityExecution> joinedExecutions = activityExecution.findInactiveConcurrentExecutions(activity);
        String defaultSequenceFlow = (String) activityExecution.getActivity().getProperty("default");
        List<PvmTransition> transitionsToTake = new ArrayList<>();

        for (PvmTransition outgoingTransition : activityExecution.getActivity().getOutgoingTransitions()) {

            Expression skipExpression = outgoingTransition.getSkipExpression();
            if (!SkipExpressionUtil.isSkipExpressionEnabled(activityExecution, skipExpression)) {
                if (defaultSequenceFlow == null || !outgoingTransition.getId().equals(defaultSequenceFlow)) {
                    Condition condition = (Condition) outgoingTransition.getProperty(BpmnParse.PROPERTYNAME_CONDITION);
                    if (condition == null || condition.evaluate(outgoingTransition.getId(), execution)) {
                        transitionsToTake.add(outgoingTransition);
                    }
                }
            } else if (SkipExpressionUtil.shouldSkipFlowElement(activityExecution, skipExpression)) {
                transitionsToTake.add(outgoingTransition);
            }
        }

        if (!transitionsToTake.isEmpty()) {
            activityExecution.takeAll(transitionsToTake, joinedExecutions);

        } else {

            if (defaultSequenceFlow != null) {
                PvmTransition defaultTransition = activityExecution.getActivity().findOutgoingTransition(defaultSequenceFlow);
                if (defaultTransition != null) {
                    activityExecution.take(defaultTransition);
                } else {
                    throw new ActivitiException("Default sequence flow '"
                            + defaultSequenceFlow + "' could not be not found");
                }
            } else {
                // No sequence flow could be found, not even a default one
                throw new ActivitiException(
                        "No outgoing sequence flow of the inclusive gateway '"
                                + activityExecution.getActivity().getId()
                                + "' could be selected for continuing the process");
            }
        }

    } else {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Inclusive gateway '{}' does not activate", activity.getId());
        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:61,代码来源:InclusiveGatewayActivityBehavior.java

示例9: leave

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
/**
 * The default behaviour of BPMN, taking every outgoing sequence flow (where the condition evaluates to true), is not valid for an exclusive gateway.
 * 
 * Hence, this behaviour is overridden and replaced by the correct behavior: selecting the first sequence flow which condition evaluates to true (or which hasn't got a condition) and leaving the
 * activity through that sequence flow.
 * 
 * If no sequence flow is selected (ie all conditions evaluate to false), then the default sequence flow is taken (if defined).
 */
@Override
protected void leave(ActivityExecution execution) {

    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Leaving activity '{}'", execution.getActivity().getId());
    }

    PvmTransition outgoingSeqFlow = null;
    String defaultSequenceFlow = (String) execution.getActivity().getProperty("default");
    Iterator<PvmTransition> transitionIterator = execution.getActivity().getOutgoingTransitions().iterator();
    while (outgoingSeqFlow == null && transitionIterator.hasNext()) {
        PvmTransition seqFlow = transitionIterator.next();
        Expression skipExpression = seqFlow.getSkipExpression();

        if (!SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpression)) {
            Condition condition = (Condition) seqFlow.getProperty(BpmnParse.PROPERTYNAME_CONDITION);
            if ((condition == null && (defaultSequenceFlow == null || !defaultSequenceFlow.equals(seqFlow.getId())))
                    || (condition != null && condition.evaluate(seqFlow.getId(), execution))) {
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug("Sequence flow '{}' selected as outgoing sequence flow.", seqFlow.getId());
                }
                outgoingSeqFlow = seqFlow;
            }
        } else if (SkipExpressionUtil.shouldSkipFlowElement(execution, skipExpression)) {
            outgoingSeqFlow = seqFlow;
        }
    }

    if (outgoingSeqFlow != null) {
        execution.take(outgoingSeqFlow);
    } else {

        if (defaultSequenceFlow != null) {
            PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow);
            if (defaultTransition != null) {
                execution.take(defaultTransition);
            } else {
                throw new ActivitiException("Default sequence flow '" + defaultSequenceFlow + "' not found");
            }
        } else {
            // No sequence flow could be found, not even a default one
            throw new ActivitiException("No outgoing sequence flow of the exclusive gateway '"
                    + execution.getActivity().getId() + "' could be selected for continuing the process");
        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:55,代码来源:ExclusiveGatewayActivityBehavior.java


注:本文中的org.activiti.engine.impl.pvm.delegate.ActivityExecution.take方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。