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


Java BpmnEdge类代码示例

本文整理汇总了Java中org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge的典型用法代码示例。如果您正苦于以下问题:Java BpmnEdge类的具体用法?Java BpmnEdge怎么用?Java BpmnEdge使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BpmnEdge类属于org.camunda.bpm.model.bpmn.instance.bpmndi包,在下文中一共展示了BpmnEdge类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldGenerateEdgesWhenUsingMoveToActivity

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
@Test
public void shouldGenerateEdgesWhenUsingMoveToActivity() {

  ProcessBuilder builder = Bpmn.createExecutableProcess();

  instance = builder
      .startEvent(START_EVENT_ID)
      .sequenceFlowId("s1")
      .exclusiveGateway()
      .sequenceFlowId("s2")
      .userTask(USER_TASK_ID)
      .sequenceFlowId("s3")
      .endEvent("e1")
      .moveToActivity(USER_TASK_ID)
      .sequenceFlowId("s4")
      .endEvent("e2")
      .done();

  Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
  assertEquals(4, allEdges.size());

  assertBpmnEdgeExists("s1");
  assertBpmnEdgeExists("s2");
  assertBpmnEdgeExists("s3");
  assertBpmnEdgeExists("s4");
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:27,代码来源:DiGeneratorForSequenceFlowsTest.java

示例2: setWaypoints

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
protected void setWaypoints(BpmnEdge edge) {
  BaseElement bpmnElement = edge.getBpmnElement();

  FlowNode edgeSource;
  FlowNode edgeTarget;
  if (bpmnElement instanceof SequenceFlow) {

    SequenceFlow sequenceFlow = (SequenceFlow) bpmnElement;

    edgeSource = sequenceFlow.getSource();
    edgeTarget = sequenceFlow.getTarget();

  } else if (bpmnElement instanceof Association){
    Association association = (Association) bpmnElement;

    edgeSource = (FlowNode) association.getSource();
    edgeTarget = (FlowNode) association.getTarget();
  } else {
    throw new RuntimeException("Bpmn element type not supported");
  }

  setWaypointsWithSourceAndTarget(edge, edgeSource, edgeTarget);
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:24,代码来源:AbstractBaseElementBuilder.java

示例3: shouldGenerateEdgeForSequenceFlow

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
@Test
public void shouldGenerateEdgeForSequenceFlow() {

  ProcessBuilder builder = Bpmn.createExecutableProcess();

  instance = builder
                .startEvent(START_EVENT_ID)
                .sequenceFlowId(SEQUENCE_FLOW_ID)
                .endEvent(END_EVENT_ID)
                .done();

  Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
  assertEquals(1, allEdges.size());

  assertBpmnEdgeExists(SEQUENCE_FLOW_ID);
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:17,代码来源:DiGeneratorForSequenceFlowsTest.java

示例4: shouldGenerateEdgesForSequenceFlowsUsingGateway

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
@Test
public void shouldGenerateEdgesForSequenceFlowsUsingGateway() {

  ProcessBuilder builder = Bpmn.createExecutableProcess();

  instance = builder
      .startEvent(START_EVENT_ID)
      .sequenceFlowId("s1")
      .parallelGateway("gateway")
      .sequenceFlowId("s2")
      .endEvent("e1")
      .moveToLastGateway()
      .sequenceFlowId("s3")
      .endEvent("e2")
      .done();

  Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
  assertEquals(3, allEdges.size());

  assertBpmnEdgeExists("s1");
  assertBpmnEdgeExists("s2");
  assertBpmnEdgeExists("s3");
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:24,代码来源:DiGeneratorForSequenceFlowsTest.java

示例5: shouldGenerateEdgesWhenUsingMoveToNode

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
@Test
public void shouldGenerateEdgesWhenUsingMoveToNode() {

  ProcessBuilder builder = Bpmn.createExecutableProcess();

  instance = builder
      .startEvent(START_EVENT_ID)
      .sequenceFlowId("s1")
      .exclusiveGateway()
      .sequenceFlowId("s2")
      .userTask(USER_TASK_ID)
      .sequenceFlowId("s3")
      .endEvent("e1")
      .moveToNode(USER_TASK_ID)
      .sequenceFlowId("s4")
      .endEvent("e2")
      .done();

  Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
  assertEquals(4, allEdges.size());

  assertBpmnEdgeExists("s1");
  assertBpmnEdgeExists("s2");
  assertBpmnEdgeExists("s3");
  assertBpmnEdgeExists("s4");
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:27,代码来源:DiGeneratorForSequenceFlowsTest.java

示例6: shouldGenerateEdgesWhenUsingConnectTo

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
@Test
public void shouldGenerateEdgesWhenUsingConnectTo() {

  ProcessBuilder builder = Bpmn.createExecutableProcess();

  instance = builder
      .startEvent(START_EVENT_ID)
      .sequenceFlowId("s1")
      .exclusiveGateway("gateway")
      .sequenceFlowId("s2")
      .userTask(USER_TASK_ID)
      .sequenceFlowId("s3")
      .endEvent(END_EVENT_ID)
      .moveToNode(USER_TASK_ID)
      .sequenceFlowId("s4")
      .connectTo("gateway")
      .done();

  Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
  assertEquals(4, allEdges.size());

  assertBpmnEdgeExists("s1");
  assertBpmnEdgeExists("s2");
  assertBpmnEdgeExists("s3");
  assertBpmnEdgeExists("s4");
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:27,代码来源:DiGeneratorForSequenceFlowsTest.java

示例7: registerType

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
public static void registerType(ModelBuilder modelBuilder) {
  ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(BpmnEdge.class, BPMNDI_ELEMENT_BPMN_EDGE)
    .namespaceUri(BPMNDI_NS)
    .extendsType(LabeledEdge.class)
    .instanceProvider(new ModelTypeInstanceProvider<BpmnEdge>() {
      public BpmnEdge newInstance(ModelTypeInstanceContext instanceContext) {
        return new BpmnEdgeImpl(instanceContext);
      }
    });

  bpmnElementAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_BPMN_ELEMENT)
    .qNameAttributeReference(BaseElement.class)
    .build();

  sourceElementAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_SOURCE_ELEMENT)
    .qNameAttributeReference(DiagramElement.class)
    .build();

  targetElementAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_TARGET_ELEMENT)
    .qNameAttributeReference(DiagramElement.class)
    .build();

  messageVisibleKindAttribute = typeBuilder.enumAttribute(BPMNDI_ATTRIBUTE_MESSAGE_VISIBLE_KIND, MessageVisibleKind.class)
    .build();

  SequenceBuilder sequenceBuilder = typeBuilder.sequence();

  bpmnLabelChild = sequenceBuilder.element(BpmnLabel.class)
    .build();

  typeBuilder.build();
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:33,代码来源:BpmnEdgeImpl.java

示例8: setWaypointsWithSourceAndTarget

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
@Override
protected void setWaypointsWithSourceAndTarget(BpmnEdge edge, FlowNode edgeSource, FlowNode edgeTarget) {
  BpmnShape source = findBpmnShape(edgeSource);
  BpmnShape target = findBpmnShape(edgeTarget);

  if (source != null && target != null) {
    Bounds sourceBounds = source.getBounds();
    Bounds targetBounds = target.getBounds();

    double sourceX = sourceBounds.getX();
    double sourceY = sourceBounds.getY();
    double sourceWidth = sourceBounds.getWidth();
    double sourceHeight = sourceBounds.getHeight();

    double targetX = targetBounds.getX();
    double targetY = targetBounds.getY();
    double targetHeight = targetBounds.getHeight();

    Waypoint w1 = createInstance(Waypoint.class);
    w1.setX(sourceX + sourceWidth / 2);
    w1.setY(sourceY + sourceHeight);

    Waypoint w2 = createInstance(Waypoint.class);
    w2.setX(sourceX + sourceWidth / 2);
    w2.setY(sourceY + sourceHeight + SPACE);

    Waypoint w3 = createInstance(Waypoint.class);
    w3.setX(targetX);
    w3.setY(targetY + targetHeight / 2);

    edge.addChildElement(w1);
    edge.addChildElement(w2);
    edge.addChildElement(w3);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:36,代码来源:AbstractBoundaryEventBuilder.java

示例9: createEdge

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
public BpmnEdge createEdge(BaseElement baseElement) {
  BpmnPlane bpmnPlane = findBpmnPlane();
  if (bpmnPlane != null) {


     BpmnEdge edge = createInstance(BpmnEdge.class);
     edge.setBpmnElement(baseElement);
     setWaypoints(edge);

     bpmnPlane.addChildElement(edge);
     return edge;
  }
  return null;

}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:16,代码来源:AbstractBaseElementBuilder.java

示例10: findBpmnEdge

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
protected BpmnEdge findBpmnEdge(BaseElement sequenceFlow){
  Collection<BpmnEdge> allEdges = modelInstance.getModelElementsByType(BpmnEdge.class);
  Iterator<BpmnEdge> iterator = allEdges.iterator();

  while (iterator.hasNext()) {
    BpmnEdge edge = iterator.next();
    if(edge.getBpmnElement().equals(sequenceFlow)) {
      return edge;
    }
  }
  return null;
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:13,代码来源:AbstractBaseElementBuilder.java

示例11: findBpmnEdge

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
protected BpmnEdge findBpmnEdge(String sequenceFlowId){
  Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
  Iterator<BpmnEdge> iterator = allEdges.iterator();

  while (iterator.hasNext()) {
    BpmnEdge edge = iterator.next();
    if(edge.getBpmnElement().getId().equals(sequenceFlowId)) {
      return edge;
    }
  }
  return null;
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:13,代码来源:CoordinatesGenerationTest.java

示例12: findBpmnEdge

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
protected BpmnEdge findBpmnEdge(String sequenceFlowId) {
  Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
  Iterator<BpmnEdge> iterator = allEdges.iterator();

  while (iterator.hasNext()) {
    BpmnEdge edge = iterator.next();
    if(edge.getBpmnElement().getId().equals(sequenceFlowId)) {
      return edge;
    }
  }
  return null;
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:13,代码来源:DiGeneratorForSequenceFlowsTest.java

示例13: removeBpmnEdge

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
protected void removeBpmnEdge(BaseElement element) {
  Collection<BpmnEdge> edges = modelInstance.getModelElementsByType(BpmnEdge.class);
  for (BpmnEdge edge : edges) {
    if (edge.getBpmnElement().equals(element)) {
      ModelElementInstance bpmnPlane = edge.getParentElement();
      bpmnPlane.removeChildElement(edge);
      break;
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:11,代码来源:ModifiableBpmnModelInstance.java

示例14: getDiagramElement

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
public BpmnEdge getDiagramElement() {
  return (BpmnEdge) super.getDiagramElement();
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:4,代码来源:SequenceFlowImpl.java

示例15: createBpmnEdge

import org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge; //导入依赖的package包/类
/**
 * @deprecated use {@link #createEdge(BaseElement)} instead
 */
@Deprecated
public BpmnEdge createBpmnEdge(SequenceFlow sequenceFlow) {
  return createEdge(sequenceFlow);
}
 
开发者ID:camunda,项目名称:camunda-bpmn-model,代码行数:8,代码来源:AbstractBaseElementBuilder.java


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