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


Java ActivityExecution.executeActivity方法代码示例

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


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

示例1: executeEventHandler

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
private static void executeEventHandler(ActivityImpl borderEventActivity, ActivityExecution leavingExecution, String errorCode) {
    if (Context.getProcessEngineConfiguration() != null && Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
        Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                ActivitiEventBuilder.createErrorEvent(FlowableEngineEventType.ACTIVITY_ERROR_RECEIVED, borderEventActivity.getId(), errorCode, leavingExecution.getId(), leavingExecution.getProcessInstanceId(),
                        leavingExecution.getProcessDefinitionId()));
    }

    // The current activity of the execution will be changed in the next lines.
    // So we must make sure the activity is ended correctly here
    // The other executions (for example when doing something parallel in a subprocess, will
    // be destroyed by the destroy scope operation (but this execution will be used to do it and
    // will have list the original activity by then)
    Context.getCommandContext().getHistoryManager().recordActivityEnd((ExecutionEntity) leavingExecution);

    if (borderEventActivity.getActivityBehavior() instanceof EventSubProcessStartEventActivityBehavior) {
        InterpretableExecution execution = (InterpretableExecution) leavingExecution;
        execution.setActivity(borderEventActivity.getParentActivity());
        execution.performOperation(AtomicOperation.ACTIVITY_START); // make sure the listeners are invoked!
    } else {
        leavingExecution.executeActivity(borderEventActivity);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:23,代码来源:ErrorPropagation.java

示例2: execute

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) {
    ActivityExecution activityExecution = (ActivityExecution) execution;
    PvmActivity activity = activityExecution.getActivity();
    ActivityImpl initialActivity = (ActivityImpl) activity.getProperty(BpmnParse.PROPERTYNAME_INITIAL);

    if (initialActivity == null) {
        throw new ActivitiException("No initial activity found for subprocess "
                + activityExecution.getActivity().getId());
    }

    // initialize the template-defined data objects as variables
    initializeDataObjects(activityExecution, activity);

    if (initialActivity.getActivityBehavior() != null
            && initialActivity.getActivityBehavior() instanceof NoneStartEventActivityBehavior) { // embedded subprocess: only none start allowed
        ((ExecutionEntity) execution).setActivity(initialActivity);
        Context.getCommandContext().getHistoryManager().recordActivityStart((ExecutionEntity) execution);
    }

    activityExecution.executeActivity(initialActivity);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:23,代码来源:SubProcessActivityBehavior.java

示例3: execute

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) {
    ActivityExecution activityExecution = (ActivityExecution) execution;
    List<PvmActivity> startActivities = new ArrayList<PvmActivity>();
    for (PvmActivity activity : activityExecution.getActivity().getActivities()) {
        if (activity.getIncomingTransitions().isEmpty()) {
            startActivities.add(activity);
        }
    }

    for (PvmActivity startActivity : startActivities) {
        activityExecution.executeActivity(startActivity);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:14,代码来源:EmbeddedSubProcess.java

示例4: executeOriginalBehavior

import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
protected void executeOriginalBehavior(ActivityExecution execution, int loopCounter) {
    if (usesCollection() && collectionElementVariable != null) {
        Collection collection = null;
        if (collectionExpression != null) {
            collection = (Collection) collectionExpression.getValue(execution);
        } else if (collectionVariable != null) {
            collection = (Collection) execution.getVariable(collectionVariable);
        }

        Object value = null;
        int index = 0;
        Iterator it = collection.iterator();
        while (index <= loopCounter) {
            value = it.next();
            index++;
        }
        setLoopVariable(execution, collectionElementVariable, value);
    }

    // If loopcounter == 1, then historic activity instance already created, no need to
    // pass through executeActivity again since it will create a new historic activity
    if (loopCounter == 0) {
        callCustomActivityStartListeners(execution);
        innerActivityBehavior.execute(execution);
    } else {
        execution.executeActivity(activity);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:30,代码来源:MultiInstanceActivityBehavior.java


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