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


Java ActivityImpl.setScope方法代码示例

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


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

示例1: executeParse

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, EventGateway gateway) {
    ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, gateway, BpmnXMLConstants.ELEMENT_GATEWAY_EVENT);
    activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createEventBasedGatewayActivityBehavior(gateway));

    activity.setAsync(gateway.isAsynchronous());
    activity.setExclusive(!gateway.isNotExclusive());
    activity.setScope(true);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:10,代码来源:EventBasedGatewayParseHandler.java

示例2: executeParse

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, SubProcess subProcess) {

    ActivityImpl activity = createActivityOnScope(bpmnParse, subProcess, BpmnXMLConstants.ELEMENT_SUBPROCESS, bpmnParse.getCurrentScope());

    activity.setAsync(subProcess.isAsynchronous());
    activity.setExclusive(!subProcess.isNotExclusive());

    boolean triggeredByEvent = false;
    if (subProcess instanceof EventSubProcess) {
        triggeredByEvent = true;
    }
    activity.setProperty("triggeredByEvent", triggeredByEvent);

    // event subprocesses are not scopes
    activity.setScope(!triggeredByEvent);
    activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createSubprocActivityBehavior(subProcess));

    bpmnParse.setCurrentScope(activity);
    bpmnParse.setCurrentSubProcess(subProcess);

    bpmnParse.processFlowElements(subProcess.getFlowElements());
    processArtifacts(bpmnParse, subProcess.getArtifacts(), activity);

    // no data objects for event subprocesses
    if (!(subProcess instanceof EventSubProcess)) {
        // parse out any data objects from the template in order to set up the necessary process variables
        Map<String, Object> variables = processDataObjects(bpmnParse, subProcess.getDataObjects(), activity);
        activity.setVariables(variables);
    }

    bpmnParse.removeCurrentScope();
    bpmnParse.removeCurrentSubProcess();

    if (subProcess.getIoSpecification() != null) {
        IOSpecification ioSpecification = createIOSpecification(bpmnParse, subProcess.getIoSpecification());
        activity.setIoSpecification(ioSpecification);
    }

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

示例3: executeParse

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, CallActivity callActivity) {

    ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, callActivity, BpmnXMLConstants.ELEMENT_CALL_ACTIVITY);
    activity.setScope(true);
    activity.setAsync(callActivity.isAsynchronous());
    activity.setExclusive(!callActivity.isNotExclusive());
    activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCallActivityBehavior(callActivity));
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:10,代码来源:CallActivityParseHandler.java

示例4: createMultiInstanceLoopCharacteristics

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
protected void createMultiInstanceLoopCharacteristics(BpmnParse bpmnParse, Activity modelActivity) {

        MultiInstanceLoopCharacteristics loopCharacteristics = modelActivity.getLoopCharacteristics();

        // Activity Behavior
        MultiInstanceActivityBehavior miActivityBehavior = null;
        ActivityImpl activity = bpmnParse.getCurrentScope().findActivity(modelActivity.getId());
        if (activity == null) {
            throw new ActivitiException("Activity " + modelActivity.getId() + " needed for multi instance cannot bv found");
        }

        if (loopCharacteristics.isSequential()) {
            miActivityBehavior = bpmnParse.getActivityBehaviorFactory().createSequentialMultiInstanceBehavior(
                    activity, (AbstractBpmnActivityBehavior) activity.getActivityBehavior());
        } else {
            miActivityBehavior = bpmnParse.getActivityBehaviorFactory().createParallelMultiInstanceBehavior(
                    activity, (AbstractBpmnActivityBehavior) activity.getActivityBehavior());
        }

        // ActivityImpl settings
        activity.setScope(true);
        activity.setProperty("multiInstance", loopCharacteristics.isSequential() ? "sequential" : "parallel");
        activity.setActivityBehavior(miActivityBehavior);

        ExpressionManager expressionManager = bpmnParse.getExpressionManager();

        // loop cardinality
        if (StringUtils.isNotEmpty(loopCharacteristics.getLoopCardinality())) {
            miActivityBehavior.setLoopCardinalityExpression(expressionManager.createExpression(loopCharacteristics.getLoopCardinality()));
        }

        // completion condition
        if (StringUtils.isNotEmpty(loopCharacteristics.getCompletionCondition())) {
            miActivityBehavior.setCompletionConditionExpression(expressionManager.createExpression(loopCharacteristics.getCompletionCondition()));
        }

        // activiti:collection
        if (StringUtils.isNotEmpty(loopCharacteristics.getInputDataItem())) {
            if (loopCharacteristics.getInputDataItem().contains("{")) {
                miActivityBehavior.setCollectionExpression(expressionManager.createExpression(loopCharacteristics.getInputDataItem()));
            } else {
                miActivityBehavior.setCollectionVariable(loopCharacteristics.getInputDataItem());
            }
        }

        // activiti:elementVariable
        if (StringUtils.isNotEmpty(loopCharacteristics.getElementVariable())) {
            miActivityBehavior.setCollectionElementVariable(loopCharacteristics.getElementVariable());
        }

        // activiti:elementIndexVariable
        if (StringUtils.isNotEmpty(loopCharacteristics.getElementIndexVariable())) {
            miActivityBehavior.setCollectionElementIndexVariable(loopCharacteristics.getElementIndexVariable());
        }

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

示例5: executeParse

import org.activiti.engine.impl.pvm.process.ActivityImpl; //导入方法依赖的package包/类
@Override
protected void executeParse(BpmnParse bpmnParse, Transaction transaction) {

    ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, transaction, BpmnXMLConstants.ELEMENT_TRANSACTION);

    activity.setAsync(transaction.isAsynchronous());
    activity.setExclusive(!transaction.isNotExclusive());

    activity.setScope(true);
    activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createTransactionActivityBehavior(transaction));

    bpmnParse.setCurrentScope(activity);

    bpmnParse.processFlowElements(transaction.getFlowElements());
    processArtifacts(bpmnParse, transaction.getArtifacts(), activity);

    bpmnParse.removeCurrentScope();

    if (transaction.getIoSpecification() != null) {
        IOSpecification ioSpecification = createIOSpecification(bpmnParse, transaction.getIoSpecification());
        activity.setIoSpecification(ioSpecification);
    }

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


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