private void configureRGOReference(NonRootModelElement rgo, NonRootModelElement rto) { TransactionManager manager = TransactionManager.getSingleton(); Transaction transaction = null; String association = ElementMap.getAssociationFor(getMethodName().replaceAll("test", "")); NonRootModelElement newRto = getElement(getMethodName().replaceAll("test", ""), rto.getClass(), true); try { transaction = manager.startTransaction("Adjust RGO", new Ooaofooa[] {Ooaofooa.getDefaultInstance()}); if (rgo instanceof ProvidedExecutableProperty_c) { // need to reassign the provision Interface_c iface = Interface_c.getOneC_IOnR4003((ExecutableProperty_c) newRto); Provision_c provision = Provision_c.getOneC_POnR4501((ProvidedExecutableProperty_c) rgo); provision.Unformalize(false); provision.Formalize(iface.getId(), false); this.rgo = ProvidedExecutableProperty_c.getOneSPR_PEPOnR4501(provision); } else if (rgo instanceof RequiredExecutableProperty_c) { // need to reassign the requirement Interface_c iface = Interface_c.getOneC_IOnR4003((ExecutableProperty_c) newRto); Requirement_c requirement = Requirement_c.getOneC_ROnR4500((RequiredExecutableProperty_c) rgo); requirement.Unformalize(false); requirement.Formalize(iface.getId(), false); // need to reset the RGO this.rgo = RequiredExecutableProperty_c.getOneSPR_REPOnR4500(requirement); } else { Method getMethod = getAccessorMethod(rgo, rto); NonRootModelElement existing = (NonRootModelElement) getMethod.invoke(rto, new Object[] {rgo}); Method method = getUnrelateMethod(association, existing, rgo); method.invoke(existing, new Object[] {rgo}); method = getRelateMethod(association, newRto, rgo); method.invoke(newRto, new Object[] {rgo}); } } catch (Exception e) { fail(e.getMessage()); if (transaction != null) { manager.cancelTransaction(transaction); } } finally { if (transaction != null) { manager.endTransaction(transaction); rgoUpdateSuccessful = true; } } BaseTest.dispatchEvents(0); }