本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}