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


Java ActivityImpl.isScope方法代码示例

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


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

示例1: execute

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
public void execute(InterpretableExecution execution) {
    InterpretableExecution propagatingExecution = null;
    ActivityImpl activity = (ActivityImpl) execution.getActivity();
    if (activity.isScope()) {
        propagatingExecution = (InterpretableExecution) execution.createExecution();
        propagatingExecution.setActivity(activity);
        propagatingExecution.setTransition(execution.getTransition());
        execution.setTransition(null);
        execution.setActivity(null);
        execution.setActive(false);
        LOGGER.debug("create scope: parent {} continues as execution {}", execution, propagatingExecution);
        propagatingExecution.initialize();

    } else {
        propagatingExecution = execution;
    }

    propagatingExecution.performOperation(AtomicOperation.TRANSITION_NOTIFY_LISTENER_START);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:21,代码来源:AtomicOperationTransitionCreateScope.java

示例2: eventNotificationsCompleted

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void eventNotificationsCompleted(InterpretableExecution execution) {
    ActivityImpl activity = (ActivityImpl) execution.getActivity();
    ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();
    StartingExecution startingExecution = execution.getStartingExecution();
    if (activity == startingExecution.getInitial()) {
        execution.disposeStartingExecution();
        execution.performOperation(ACTIVITY_EXECUTE);

    } else {
        List<ActivityImpl> initialActivityStack = processDefinition.getInitialActivityStack(startingExecution.getInitial());
        int index = initialActivityStack.indexOf(activity);
        activity = initialActivityStack.get(index + 1);

        InterpretableExecution executionToUse = null;
        if (activity.isScope()) {
            executionToUse = (InterpretableExecution) execution.getExecutions().get(0);
        } else {
            executionToUse = execution;
        }
        executionToUse.setActivity(activity);
        executionToUse.performOperation(PROCESS_START_INITIAL);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:25,代码来源:AtomicOperationProcessStartInitial.java

示例3: handleEvent

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) {

    String configuration = eventSubscription.getConfiguration();
    if (configuration == null) {
        throw new ActivitiException("Compensating execution not set for compensate event subscription with id " + eventSubscription.getId());
    }

    ExecutionEntity compensatingExecution = commandContext.getExecutionEntityManager()
            .findExecutionById(configuration);

    ActivityImpl compensationHandler = eventSubscription.getActivity();

    if ((compensationHandler.getProperty(BpmnParse.PROPERTYNAME_IS_FOR_COMPENSATION) == null
            || !(Boolean) compensationHandler.getProperty(BpmnParse.PROPERTYNAME_IS_FOR_COMPENSATION))
            && compensationHandler.isScope()) {

        // descend into scope:
        List<CompensateEventSubscriptionEntity> eventsForThisScope = compensatingExecution.getCompensateEventSubscriptions();
        ScopeUtil.throwCompensationEvent(eventsForThisScope, compensatingExecution, false);

    } else {
        try {

            if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
                commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                        ActivitiEventBuilder.createActivityEvent(FlowableEngineEventType.ACTIVITY_COMPENSATE,
                                compensationHandler.getId(),
                                (String) compensationHandler.getProperty("name"),
                                compensatingExecution.getId(),
                                compensatingExecution.getProcessInstanceId(),
                                compensatingExecution.getProcessDefinitionId(),
                                (String) compensatingExecution.getActivity().getProperties().get("type"),
                                compensatingExecution.getActivity().getActivityBehavior().getClass().getCanonicalName()));
            }
            compensatingExecution.setActivity(compensationHandler);

            // executing the atomic operation makes sure activity start events are fired
            compensatingExecution.performOperation(AtomicOperation.ACTIVITY_START);

        } catch (Exception e) {
            throw new ActivitiException("Error while handling compensation event " + eventSubscription, e);
        }

    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:47,代码来源:CompensationEventHandler.java


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