Search in sources :

Example 16 with BaseElement

use of org.eclipse.bpmn2.BaseElement in project kie-wb-common by kiegroup.

the class DIZorderComparator method isChildParent.

private boolean isChildParent(BaseElement parent, BaseElement child) {
    LaneSet childLaneSet = ((Lane) parent).getChildLaneSet();
    if (childLaneSet == null) {
        return false;
    }
    List<Lane> lanes = childLaneSet.getLanes();
    for (Lane lane : lanes) {
        if (isParent(lane, child)) {
            return true;
        }
    }
    return false;
}
Also used : Lane(org.eclipse.bpmn2.Lane) LaneSet(org.eclipse.bpmn2.LaneSet)

Example 17 with BaseElement

use of org.eclipse.bpmn2.BaseElement in project kie-wb-common by kiegroup.

the class Bpmn2JsonMarshaller method findDiagramElement.

private DiagramElement findDiagramElement(BPMNPlane plane, BaseElement baseElement) {
    DiagramElement result = _diagramElements.get(baseElement.getId());
    if (result != null) {
        return result;
    }
    for (DiagramElement element : plane.getPlaneElement()) {
        if ((element instanceof BPMNEdge && ((BPMNEdge) element).getBpmnElement() == baseElement) || (element instanceof BPMNShape && ((BPMNShape) element).getBpmnElement() == baseElement)) {
            _diagramElements.put(baseElement.getId(), element);
            return element;
        }
    }
    _logger.debug("Could not find BPMNDI information for " + baseElement);
    return null;
}
Also used : DiagramElement(org.eclipse.dd.di.DiagramElement) BPMNShape(org.eclipse.bpmn2.di.BPMNShape) BPMNEdge(org.eclipse.bpmn2.di.BPMNEdge)

Example 18 with BaseElement

use of org.eclipse.bpmn2.BaseElement in project kie-wb-common by kiegroup.

the class StringElement method setStringValue.

void setStringValue(BaseElement element, String value) {
    if (element != null) {
        MetaDataType eleMetadata = DroolsFactory.eINSTANCE.createMetaDataType();
        eleMetadata.setName(name);
        eleMetadata.setMetaValue(asCData(value));
        if (element.getExtensionValues() == null || element.getExtensionValues().isEmpty()) {
            ExtensionAttributeValue extensionElement = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue();
            element.getExtensionValues().add(extensionElement);
        }
        FeatureMap.Entry eleExtensionElementEntry = new EStructuralFeatureImpl.SimpleFeatureMapEntry((EStructuralFeature.Internal) DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, eleMetadata);
        element.getExtensionValues().get(0).getValue().add(eleExtensionElementEntry);
    }
}
Also used : FeatureMap(org.eclipse.emf.ecore.util.FeatureMap) MetaDataType(org.jboss.drools.MetaDataType) EStructuralFeature(org.eclipse.emf.ecore.EStructuralFeature) ExtensionAttributeValue(org.eclipse.bpmn2.ExtensionAttributeValue)

Aggregations

SubProcess (org.eclipse.bpmn2.SubProcess)9 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)8 Bounds (org.eclipse.dd.dc.Bounds)7 Lane (org.eclipse.bpmn2.Lane)6 Process (org.eclipse.bpmn2.Process)5 SimpleFeatureMapEntry (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry)5 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)5 ArrayList (java.util.ArrayList)4 ExtensionAttributeValue (org.eclipse.bpmn2.ExtensionAttributeValue)4 FlowElement (org.eclipse.bpmn2.FlowElement)4 Artifact (org.eclipse.bpmn2.Artifact)3 FlowNode (org.eclipse.bpmn2.FlowNode)3 RootElement (org.eclipse.bpmn2.RootElement)3 List (java.util.List)2 Association (org.eclipse.bpmn2.Association)2 BaseElement (org.eclipse.bpmn2.BaseElement)2 DataInputAssociation (org.eclipse.bpmn2.DataInputAssociation)2 DataOutputAssociation (org.eclipse.bpmn2.DataOutputAssociation)2 Definitions (org.eclipse.bpmn2.Definitions)2 ItemDefinition (org.eclipse.bpmn2.ItemDefinition)2