/** * Processes a partnerLink element from the BPEL process and creates a * BPELPartnerLink object * * @param reader */ private BPELPartnerLinkElement processPartnerLinkElement(XMLStreamReader reader, Monitor monitor) throws ContributionReadException { BPELPartnerLinkElement partnerLink = new BPELPartnerLinkElement( reader.getAttributeValue(null, "name"), getQNameValue(reader, reader.getAttributeValue(null, "partnerLinkType")), reader.getAttributeValue(null, "myRole"), reader.getAttributeValue(null, "partnerRole")); // See if there are any SCA extension attributes String scaService = reader.getAttributeValue(BPELProcessorConstants.SCA_BPEL_NS, "service"); String scaReference = reader.getAttributeValue(BPELProcessorConstants.SCA_BPEL_NS, "reference"); if ((scaService != null) && (scaReference != null)) { // It is incorrect to set both service & reference attributes error(monitor, "PartnerLinkHasBothAttr", partnerLink, reader.getAttributeValue(null, "name")); throw new ContributionReadException("BPEL PartnerLink " + reader.getAttributeValue(null, "name") + " has both sca:reference and sca:service attributes set"); } // end if // Set the SCA type and the related name, if present if (scaService != null) partnerLink.setAsService(scaService); else if (scaReference != null) partnerLink.setAsReference(scaReference); return partnerLink; } // end processPartnerLinkElement
/** * Processes a partnerLink element from the BPEL process and creates a * BPELPartnerLink object * * @param reader */ private BPELPartnerLinkElement processPartnerLinkElement(XMLStreamReader reader, Monitor monitor) throws ContributionReadException { BPELPartnerLinkElement partnerLink = new BPELPartnerLinkElement( reader.getAttributeValue(null, "name"), getQNameValue(reader, reader.getAttributeValue(null, "partnerLinkType")), reader.getAttributeValue(null, "myRole"), reader.getAttributeValue(null, "partnerRole")); // See if there are any SCA extension attributes String scaService = reader.getAttributeValue(BPELProcessorConstants.SCA_BPEL_NS, "service"); String scaReference = reader.getAttributeValue(BPELProcessorConstants.SCA_BPEL_NS, "reference"); if ((scaService != null) && (scaReference != null)) { // It is incorrect to set both service & reference attributes error(monitor, "PartnerLinkHasBothAttr", partnerLink, reader.getAttributeValue(null, "name")); throw new ContributionReadException("BPEL PartnerLink " + reader.getAttributeValue(null, "name") + " has both sca:reference and sca:service attributes set"); } // end if // Set the SCA type and the related name, if present if (scaService != null) partnerLink.setAsService(scaService); else if (scaReference != null) partnerLink.setAsReference(scaReference); return partnerLink; } // end processPartnerLinkElement