* Processes a partnerLink element from the BPEL process and creates a
* BPELPartnerLink object
*/
private BPELPartnerLinkElement processPartnerLinkElement( XMLStreamReader reader )
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( SCA_BPEL_NS, "service");
String scaReference = reader.getAttributeValue( SCA_BPEL_NS, "reference");
if( (scaService != null) && (scaReference != null) ) {
// It is incorrect to set both service & reference attributes
error("PartnerLinkHasBothAttr", partnerLink, reader.getAttributeValue(null, "name"));
throw new ContributionReadException( "BPEL PartnerLink "
+ reader.getAttributeValue(null, "name") +
" has both sca:reference and sca:service attributes set" );
}
// 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