if (ocopy.to instanceof OAssign.PartnerLinkRef) {
OAssign.PartnerLinkRef pLinkRef = ((OAssign.PartnerLinkRef) ocopy.to);
PartnerLinkInstance plval = _scopeFrame
.resolve(pLinkRef.partnerLink);
replaceEndpointRefence(plval, rvalue);
se = new PartnerLinkModificationEvent(((OAssign.PartnerLinkRef) ocopy.to).partnerLink.getName());
} else {
// Sneakily converting the EPR if it's not the format expected by the lvalue
if (ocopy.from instanceof OAssign.PartnerLinkRef) {
rvalue = getBpelRuntimeContext().convertEndpointReference((Element)rvalue, lvaluePtr);
if (rvalue.getNodeType() == Node.DOCUMENT_NODE)