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


Java BpmnModel.getFlowElement方法代码示例

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


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

示例1: processStartEvent

import org.activiti.bpmn.model.BpmnModel; //导入方法依赖的package包/类
/**
 * 配置开始事件.
 */
public void processStartEvent(Node node, BpmnModel bpmnModel, int priority,
        BpmConfBase bpmConfBase) {
    BpmConfNodeManager bpmConfNodeManager = getBpmConfNodeManager();
    BpmConfNode bpmConfNode = bpmConfNodeManager.findUnique(
            "from BpmConfNode where code=? and bpmConfBase=?",
            node.getId(), bpmConfBase);

    if (bpmConfNode == null) {
        bpmConfNode = new BpmConfNode();
        bpmConfNode.setCode(node.getId());
        bpmConfNode.setName(node.getName());
        bpmConfNode.setType(node.getType());
        bpmConfNode.setConfUser(2);
        bpmConfNode.setConfListener(0);
        bpmConfNode.setConfRule(2);
        bpmConfNode.setConfForm(0);
        bpmConfNode.setConfOperation(2);
        bpmConfNode.setConfNotice(0);
        bpmConfNode.setPriority(priority);
        bpmConfNode.setBpmConfBase(bpmConfBase);
        bpmConfNodeManager.save(bpmConfNode);
    }

    FlowElement flowElement = bpmnModel.getFlowElement(node.getId());
    // 配置监听器
    this.processListener(flowElement.getExecutionListeners(), bpmConfNode);

    StartEvent startEvent = (StartEvent) flowElement;
    // 配置表单
    this.processForm(startEvent, bpmConfNode);
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:35,代码来源:SyncProcessCmd.java

示例2: processEndEvent

import org.activiti.bpmn.model.BpmnModel; //导入方法依赖的package包/类
/**
 * 配置结束事件.
 */
public void processEndEvent(Node node, BpmnModel bpmnModel, int priority,
        BpmConfBase bpmConfBase) {
    BpmConfNodeManager bpmConfNodeManager = getBpmConfNodeManager();
    BpmConfNode bpmConfNode = bpmConfNodeManager.findUnique(
            "from BpmConfNode where code=? and bpmConfBase=?",
            node.getId(), bpmConfBase);

    if (bpmConfNode == null) {
        bpmConfNode = new BpmConfNode();
        bpmConfNode.setCode(node.getId());
        bpmConfNode.setName(node.getName());
        bpmConfNode.setType(node.getType());
        bpmConfNode.setConfUser(2);
        bpmConfNode.setConfListener(0);
        bpmConfNode.setConfRule(2);
        bpmConfNode.setConfForm(2);
        bpmConfNode.setConfOperation(2);
        bpmConfNode.setConfNotice(0);
        bpmConfNode.setPriority(priority);
        bpmConfNode.setBpmConfBase(bpmConfBase);
        bpmConfNodeManager.save(bpmConfNode);
    }

    FlowElement flowElement = bpmnModel.getFlowElement(node.getId());
    // 配置监听器
    this.processListener(flowElement.getExecutionListeners(), bpmConfNode);
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:31,代码来源:SyncProcessCmd.java

示例3: executeParse

import org.activiti.bpmn.model.BpmnModel; //导入方法依赖的package包/类
protected void executeParse(BpmnParse bpmnParse, EventGateway gateway) {
  ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, gateway, BpmnXMLConstants.ELEMENT_GATEWAY_EVENT);   
  activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createEventBasedGatewayActivityBehavior(gateway));
  activity.setScope(true);

  // find all outgoing sequence flows
  BpmnModel bpmnModel = bpmnParse.getBpmnModel();
  for (SequenceFlow sequenceFlow : gateway.getOutgoingFlows()) {
    FlowElement flowElement = bpmnModel.getFlowElement(sequenceFlow.getTargetRef());
    if (flowElement != null && flowElement instanceof IntermediateCatchEvent == false) {
      bpmnModel.addProblem("Event based gateway can only be connected to elements of type intermediateCatchEvent.", flowElement);
    }
  }
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:15,代码来源:EventBasedGatewayParseHandler.java

示例4: processUserTask

import org.activiti.bpmn.model.BpmnModel; //导入方法依赖的package包/类
/**
 * 配置用户任务.
 */
public void processUserTask(Node node, BpmnModel bpmnModel, int priority,
        BpmConfBase bpmConfBase) {
    BpmConfNodeManager bpmConfNodeManager = getBpmConfNodeManager();
    BpmConfNode bpmConfNode = bpmConfNodeManager.findUnique(
            "from BpmConfNode where code=? and bpmConfBase=?",
            node.getId(), bpmConfBase);

    if (bpmConfNode == null) {
        bpmConfNode = new BpmConfNode();
        bpmConfNode.setCode(node.getId());
        bpmConfNode.setName(node.getName());
        bpmConfNode.setType(node.getType());
        bpmConfNode.setConfUser(0);
        bpmConfNode.setConfListener(0);
        bpmConfNode.setConfRule(0);
        bpmConfNode.setConfForm(0);
        bpmConfNode.setConfOperation(0);
        bpmConfNode.setConfNotice(0);
        bpmConfNode.setPriority(priority);
        bpmConfNode.setBpmConfBase(bpmConfBase);
        bpmConfNodeManager.save(bpmConfNode);
    }

    // 配置参与者
    UserTask userTask = (UserTask) bpmnModel.getFlowElement(node.getId());
    int index = 1;
    index = this.processUserTaskConf(bpmConfNode, userTask.getAssignee(),
            0, index);

    for (String candidateUser : userTask.getCandidateUsers()) {
        index = this.processUserTaskConf(bpmConfNode, candidateUser, 1,
                index);
    }

    for (String candidateGroup : userTask.getCandidateGroups()) {
        this.processUserTaskConf(bpmConfNode, candidateGroup, 2, index);
    }

    // 配置监听器
    this.processListener(userTask.getExecutionListeners(), bpmConfNode);
    this.processListener(userTask.getTaskListeners(), bpmConfNode);
    // 配置表单
    this.processForm(userTask, bpmConfNode);

    // 会签
    if (userTask.getLoopCharacteristics() != null) {
        BpmConfCountersign bpmConfCountersign = new BpmConfCountersign();
        bpmConfCountersign.setType(0);
        bpmConfCountersign.setRate(100);
        bpmConfCountersign.setBpmConfNode(bpmConfNode);
        bpmConfCountersign.setSequential(userTask.getLoopCharacteristics()
                .isSequential() ? 1 : 0);
        getBpmConfCountersignManager().save(bpmConfCountersign);
    }

    // 更新TaskDefinition
    TaskDefinitionConnector taskDefinitionConnector = this
            .getTaskDefinitionConnector();
    TaskDefinitionDTO taskDefinitionDto = new TaskDefinitionBuilder()
            .setUserTask(userTask)
            .setProcessDefinitionId(bpmConfBase.getProcessDefinitionId())
            .build();
    taskDefinitionConnector.create(taskDefinitionDto);
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:68,代码来源:SyncProcessCmd.java


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