// Before creating the partyRelationShip, create the partyRoles if they don't exist
GenericValue partyToRole = null;
partyToRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", partyIdTo, "roleTypeId", roleTypeIdTo), false);
if (partyToRole == null) {
partyToRole = delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", partyIdTo, "roleTypeId", roleTypeIdTo));
partyToRole.create();
}
GenericValue partyFromRole= null;
partyFromRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", partyIdFrom, "roleTypeId", roleTypeIdFrom), false);
if (partyFromRole == null) {