org.flowable.bpmn.model.Association类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(12.4k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中org.flowable.bpmn.model.Association类的一些代码示例,展示了Association类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Association类的具体详情如下:
包路径:org.flowable.bpmn.model.Association
类名称:Association

Association介绍

暂无

代码示例

代码示例来源:origin: org.flowable/flowable-bpmn-model

public void setValues(Association otherElement) {
    super.setValues(otherElement);
    setSourceRef(otherElement.getSourceRef());
    setTargetRef(otherElement.getTargetRef());

    if (otherElement.getAssociationDirection() != null) {
      setAssociationDirection(otherElement.getAssociationDirection());
    }
  }
}

代码示例来源:origin: org.flowable/flowable-bpmn-converter

@Override
protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception {
  Association association = new Association();
  BpmnXMLUtil.addXMLLocation(association, xtr);
  association.setSourceRef(xtr.getAttributeValue(null, ATTRIBUTE_FLOW_SOURCE_REF));
  association.setTargetRef(xtr.getAttributeValue(null, ATTRIBUTE_FLOW_TARGET_REF));
  association.setId(xtr.getAttributeValue(null, ATTRIBUTE_ID));
  String associationDirectionString = xtr.getAttributeValue(null, ATTRIBUTE_ASSOCIATION_DIRECTION);
  if (StringUtils.isNotEmpty(associationDirectionString)) {
    AssociationDirection associationDirection = AssociationDirection.valueOf(associationDirectionString.toUpperCase());
    association.setAssociationDirection(associationDirection);
  }
  parseChildElements(getXMLElementName(), association, model, xtr);
  return association;
}

代码示例来源:origin: org.flowable/flowable-bpmn-layout

protected void handleAssociation(Association association) {
  ensureArtifactIdSet(association);
  associations.put(association.getId(), association);
}

代码示例来源:origin: org.flowable/flowable-bpmn-model

@Override
public Association clone() {
  Association clone = new Association();
  clone.setValues(this);
  return clone;
}

代码示例来源:origin: org.flowable/flowable-json-converter

@Override
  protected BaseElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    Association association = new Association();

    String sourceRef = BpmnJsonConverterUtil.lookForSourceRef(elementNode.get(EDITOR_SHAPE_ID).asText(), modelNode.get(EDITOR_CHILD_SHAPES));

    if (sourceRef != null) {
      association.setSourceRef(sourceRef);
      String targetId = elementNode.get("target").get(EDITOR_SHAPE_ID).asText();
      association.setTargetRef(BpmnJsonConverterUtil.getElementId(shapeMap.get(targetId)));
    }

    return association;
  }
}

代码示例来源:origin: org.flowable/flowable-process-validation

protected void validate(Process process, Association association, List<ValidationError> errors) {
  if (StringUtils.isEmpty(association.getSourceRef())) {
    addError(errors, Problems.ASSOCIATION_INVALID_SOURCE_REFERENCE, process, association, "association element missing attribute 'sourceRef'");
  }
  if (StringUtils.isEmpty(association.getTargetRef())) {
    addError(errors, Problems.ASSOCIATION_INVALID_TARGET_REFERENCE, process, association, "association element missing attribute 'targetRef'");
  }
}

代码示例来源:origin: org.flowable/flowable-bpmn-layout

protected void handleAssociations() {
  Hashtable<String, Object> edgeStyle = new Hashtable<>();
  edgeStyle.put(mxConstants.STYLE_ORTHOGONAL, true);
  edgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.ElbowConnector);
  edgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.0);
  edgeStyle.put(mxConstants.STYLE_ENTRY_Y, 0.5);
  graph.getStylesheet().putCellStyle(STYLE_SEQUENCEFLOW, edgeStyle);
  Hashtable<String, Object> boundaryEdgeStyle = new Hashtable<>();
  boundaryEdgeStyle.put(mxConstants.STYLE_EXIT_X, 0.5);
  boundaryEdgeStyle.put(mxConstants.STYLE_EXIT_Y, 1.0);
  boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.5);
  boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_Y, 1.0);
  boundaryEdgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.orthConnector);
  graph.getStylesheet().putCellStyle(STYLE_BOUNDARY_SEQUENCEFLOW, boundaryEdgeStyle);
  for (Association association : associations.values()) {
    Object sourceVertex = generatedVertices.get(association.getSourceRef());
    Object targetVertex = generatedVertices.get(association.getTargetRef());
    String style = null;
    if (handledFlowElements.get(association.getSourceRef()) instanceof BoundaryEvent) {
      // Sequence flow out of boundary events are handled in a different way,
      // to make them visually appealing for the eye of the dear end user.
      style = STYLE_BOUNDARY_SEQUENCEFLOW;
    } else {
      style = STYLE_SEQUENCEFLOW;
    }
    Object associationEdge = graph.insertEdge(cellParent, association.getId(), "", sourceVertex, targetVertex, style);
    generatedAssociationEdges.put(association.getId(), associationEdge);
  }
}

代码示例来源:origin: org.flowable/flowable-bpmn-converter

@Override
protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception {
  Association association = (Association) element;
  writeDefaultAttribute(ATTRIBUTE_FLOW_SOURCE_REF, association.getSourceRef(), xtw);
  writeDefaultAttribute(ATTRIBUTE_FLOW_TARGET_REF, association.getTargetRef(), xtw);
  AssociationDirection associationDirection = association.getAssociationDirection();
  if (associationDirection != null) {
    writeDefaultAttribute(ATTRIBUTE_ASSOCIATION_DIRECTION, associationDirection.getValue(), xtw);
  }
}

代码示例来源:origin: org.ow2.petals.flowable/flowable-bpmn-model

protected List<Association> findAssociationsWithTargetRefRecursive(FlowElementsContainer flowElementsContainer, String targetRef) {
  List<Association> associations = new ArrayList<>();
  for (Artifact artifact : flowElementsContainer.getArtifacts()) {
    if (artifact instanceof Association) {
      Association association = (Association) artifact;
      if (association.getTargetRef() != null && association.getTargetRef().equals(targetRef)) {
        associations.add(association);
      }
    }
  }
  for (FlowElement flowElement : flowElementsContainer.getFlowElements()) {
    if (flowElement instanceof FlowElementsContainer) {
      associations.addAll(findAssociationsWithTargetRefRecursive((FlowElementsContainer) flowElement, targetRef));
    }
  }
  return associations;
}

代码示例来源:origin: org.flowable/flowable-json-converter

if (artifact instanceof  Association){
    Association association= (Association) artifact;
    if (association.getSourceRef().equals(flowNode.getId())){
      outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(artifact.getId()));
if (artifact instanceof Association) {
  Association association = (Association) artifact;
  if (StringUtils.isNotEmpty(association.getSourceRef()) && association.getSourceRef().equals(baseElement.getId())) {
    outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(association.getId()));

代码示例来源:origin: org.flowable/flowable-engine

List<Association> associations = process.findAssociationsWithTargetRefRecursive(activity.getId());
for (Association association : associations) {
  FlowElement sourceElement = process.getFlowElement(association.getSourceRef(), true);
  if (sourceElement instanceof BoundaryEvent) {
    BoundaryEvent sourceBoundaryEvent = (BoundaryEvent) sourceElement;

代码示例来源:origin: org.ow2.petals.flowable/flowable-bpmn-model

protected List<Association> findAssociationsWithSourceRefRecursive(FlowElementsContainer flowElementsContainer, String sourceRef) {
  List<Association> associations = new ArrayList<>();
  for (Artifact artifact : flowElementsContainer.getArtifacts()) {
    if (artifact instanceof Association) {
      Association association = (Association) artifact;
      if (association.getSourceRef() != null && association.getTargetRef() != null && association.getSourceRef().equals(sourceRef)) {
        associations.add(association);
      }
    }
  }
  for (FlowElement flowElement : flowElementsContainer.getFlowElements()) {
    if (flowElement instanceof FlowElementsContainer) {
      associations.addAll(findAssociationsWithSourceRefRecursive((FlowElementsContainer) flowElement, sourceRef));
    }
  }
  return associations;
}

代码示例来源:origin: org.flowable/flowable-ui-task-rest

protected void processArtifacts(Collection<Artifact> artifactList, BpmnModel model, ArrayNode elementArray, ArrayNode flowArray, GraphicInfo diagramInfo) {
  for (Artifact artifact : artifactList) {
    if (artifact instanceof Association) {
      ObjectNode elementNode = objectMapper.createObjectNode();
      Association flow = (Association) artifact;
      elementNode.put("id", flow.getId());
      elementNode.put("type", "association");
      elementNode.put("sourceRef", flow.getSourceRef());
      elementNode.put("targetRef", flow.getTargetRef());
      fillWaypoints(flow.getId(), model, elementNode, diagramInfo);
      flowArray.add(elementNode);
    } else {
      ObjectNode elementNode = objectMapper.createObjectNode();
      elementNode.put("id", artifact.getId());
      if (artifact instanceof TextAnnotation) {
        TextAnnotation annotation = (TextAnnotation) artifact;
        elementNode.put("text", annotation.getText());
      }
      GraphicInfo graphicInfo = model.getGraphicInfo(artifact.getId());
      if (graphicInfo != null) {
        fillGraphicInfo(elementNode, graphicInfo, true);
        fillDiagramInfo(graphicInfo, diagramInfo);
      }
      String className = artifact.getClass().getSimpleName();
      elementNode.put("type", className);
      elementArray.add(elementNode);
    }
  }
}

代码示例来源:origin: org.flowable/flowable-bpmn-model

protected List<Association> findAssociationsWithTargetRefRecursive(FlowElementsContainer flowElementsContainer, String targetRef) {
  List<Association> associations = new ArrayList<>();
  for (Artifact artifact : flowElementsContainer.getArtifacts()) {
    if (artifact instanceof Association) {
      Association association = (Association) artifact;
      if (association.getTargetRef() != null && association.getTargetRef().equals(targetRef)) {
        associations.add(association);
      }
    }
  }
  for (FlowElement flowElement : flowElementsContainer.getFlowElements()) {
    if (flowElement instanceof FlowElementsContainer) {
      associations.addAll(findAssociationsWithTargetRefRecursive((FlowElementsContainer) flowElement, targetRef));
    }
  }
  return associations;
}

代码示例来源:origin: org.ow2.petals.flowable/flowable-bpmn-model

@Override
public Association clone() {
  Association clone = new Association();
  clone.setValues(this);
  return clone;
}

代码示例来源:origin: org.ow2.petals.flowable/flowable-bpmn-model

public void setValues(Association otherElement) {
    super.setValues(otherElement);
    setSourceRef(otherElement.getSourceRef());
    setTargetRef(otherElement.getTargetRef());

    if (otherElement.getAssociationDirection() != null) {
      setAssociationDirection(otherElement.getAssociationDirection());
    }
  }
}

代码示例来源:origin: org.flowable/flowable-bpmn-model

protected List<Association> findAssociationsWithSourceRefRecursive(FlowElementsContainer flowElementsContainer, String sourceRef) {
  List<Association> associations = new ArrayList<>();
  for (Artifact artifact : flowElementsContainer.getArtifacts()) {
    if (artifact instanceof Association) {
      Association association = (Association) artifact;
      if (association.getSourceRef() != null && association.getTargetRef() != null && association.getSourceRef().equals(sourceRef)) {
        associations.add(association);
      }
    }
  }
  for (FlowElement flowElement : flowElementsContainer.getFlowElements()) {
    if (flowElement instanceof FlowElementsContainer) {
      associations.addAll(findAssociationsWithSourceRefRecursive((FlowElementsContainer) flowElement, sourceRef));
    }
  }
  return associations;
}

代码示例来源:origin: org.flowable/flowable-json-converter

ObjectNode flowNode = BpmnJsonConverterUtil.createChildShape(association.getId(), STENCIL_ASSOCIATION, 172, 212, 128, 212);
ArrayNode dockersArrayNode = objectMapper.createArrayNode();
ObjectNode dockNode = objectMapper.createObjectNode();
dockNode.put(EDITOR_BOUNDS_X, model.getGraphicInfo(association.getSourceRef()).getWidth() / 2.0);
dockNode.put(EDITOR_BOUNDS_Y, model.getGraphicInfo(association.getSourceRef()).getHeight() / 2.0);
dockersArrayNode.add(dockNode);
List<GraphicInfo> graphicInfoList = model.getFlowLocationGraphicInfo(association.getId());
if (graphicInfoList.size() > 2) {
  for (int i = 1; i < graphicInfoList.size() - 1; i++) {
GraphicInfo targetGraphicInfo = model.getGraphicInfo(association.getTargetRef());
GraphicInfo flowGraphicInfo = graphicInfoList.get(graphicInfoList.size() - 1);
flowNode.set("dockers", dockersArrayNode);
ArrayNode outgoingArrayNode = objectMapper.createArrayNode();
outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(association.getTargetRef()));
flowNode.set("outgoing", outgoingArrayNode);
flowNode.set("target", BpmnJsonConverterUtil.createResourceNode(association.getTargetRef()));
propertiesNode.put(PROPERTY_OVERRIDE_ID, association.getId());

代码示例来源:origin: org.flowable/flowable-bpmn-converter

if (artifact instanceof Association) {
  Association association = (Association) artifact;
  belongsTo = collapsedSubProcessChildren.get(association.getTargetRef());

代码示例来源:origin: org.flowable/flowable-engine

protected void createAssociation(BpmnParse bpmnParse, Association association) {
  BpmnModel bpmnModel = bpmnParse.getBpmnModel();
  if (bpmnModel.getArtifact(association.getSourceRef()) != null || bpmnModel.getArtifact(association.getTargetRef()) != null) {

相关文章