Search in sources :

Example 1 with AttributeReference

use of org.camunda.bpm.model.xml.type.reference.AttributeReference in project camunda-bpmn-model by camunda.

the class FlowNodeImpl method updateAfterReplacement.

@SuppressWarnings("rawtypes")
public void updateAfterReplacement() {
    super.updateAfterReplacement();
    Collection<Reference> incomingReferences = getIncomingReferencesByType(SequenceFlow.class);
    for (Reference<?> reference : incomingReferences) {
        for (ModelElementInstance sourceElement : reference.findReferenceSourceElements(this)) {
            String referenceIdentifier = reference.getReferenceIdentifier(sourceElement);
            if (referenceIdentifier != null && referenceIdentifier.equals(getId()) && reference instanceof AttributeReference) {
                String attributeName = ((AttributeReference) reference).getReferenceSourceAttribute().getAttributeName();
                if (attributeName.equals(BPMN_ATTRIBUTE_SOURCE_REF)) {
                    getOutgoing().add((SequenceFlow) sourceElement);
                } else if (attributeName.equals(BPMN_ATTRIBUTE_TARGET_REF)) {
                    getIncoming().add((SequenceFlow) sourceElement);
                }
            }
        }
    }
}
Also used : AttributeReference(org.camunda.bpm.model.xml.type.reference.AttributeReference) Reference(org.camunda.bpm.model.xml.type.reference.Reference) ModelElementInstance(org.camunda.bpm.model.xml.instance.ModelElementInstance) AttributeReference(org.camunda.bpm.model.xml.type.reference.AttributeReference) SequenceFlow(org.camunda.bpm.model.bpmn.instance.SequenceFlow)

Aggregations

SequenceFlow (org.camunda.bpm.model.bpmn.instance.SequenceFlow)1 ModelElementInstance (org.camunda.bpm.model.xml.instance.ModelElementInstance)1 AttributeReference (org.camunda.bpm.model.xml.type.reference.AttributeReference)1 Reference (org.camunda.bpm.model.xml.type.reference.Reference)1