| <?xml version="1.0" encoding="UTF-8" ?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd"> |
| |
| <!-- Party Invitation Services --> |
| <simple-method method-name="createPartyInvitation" short-description="Create a PartyInvitation"> |
| <make-value entity-name="PartyInvitation" value-field="newEntity"/> |
| <sequenced-id sequence-name="PartyInvitation" field="newEntity.partyInvitationId"/> |
| <field-to-result field="newEntity.partyInvitationId" result-name="partyInvitationId"/> |
| <if-empty field="parameters.toName"> |
| <if-not-empty field="parameters.partyId"> |
| <entity-one entity-name="Person" value-field="person" auto-field-map="false"> |
| <field-map field-name="partyId" from-field="parameters.partyId"/> |
| </entity-one> |
| <set field="parameters.toName" value="${person.firstName} ${person.middleName} ${person.lastName}"/> |
| </if-not-empty> |
| </if-empty> |
| <now-timestamp field="nowTimestamp"/> |
| <set from-field="nowTimestamp" field="newEntity.lastInviteDate"/> |
| <set-nonpk-fields map="parameters" value-field="newEntity"/> |
| <create-value value-field="newEntity"/> |
| </simple-method> |
| <simple-method method-name="updatePartyInvitation" short-description="Update a PartyInvitation"> |
| <entity-one entity-name="PartyInvitation" value-field="lookedUpValue"/> |
| <if-empty field="parameters.toName"> |
| <if-not-empty field="parameters.partyId"> |
| <entity-one entity-name="Person" value-field="person" auto-field-map="false"> |
| <field-map field-name="partyId" from-field="parameters.partyId"/> |
| </entity-one> |
| <set field="parameters.toName" value="${person.firstName} ${person.middleName} ${person.lastName}"/> |
| </if-not-empty> |
| </if-empty> |
| <set-nonpk-fields map="parameters" value-field="lookedUpValue"/> |
| <store-value value-field="lookedUpValue"/> |
| </simple-method> |
| <simple-method method-name="deletePartyInvitation" short-description="Remove a PartyInvitation"> |
| <entity-one entity-name="PartyInvitation" value-field="lookedUpValue"/> |
| <remove-value value-field="lookedUpValue"/> |
| </simple-method> |
| <simple-method method-name="createPartyInvitationGroupAssoc" short-description="Create a PartyInvitationGroupAssoc"> |
| <make-value entity-name="PartyInvitationGroupAssoc" value-field="newEntity"/> |
| <set-pk-fields map="parameters" value-field="newEntity"/> |
| <create-value value-field="newEntity"/> |
| </simple-method> |
| <simple-method method-name="deletePartyInvitationGroupAssoc" short-description="Remove a PartyInvitationGroupAssoc"> |
| <entity-one entity-name="PartyInvitationGroupAssoc" value-field="lookedUpValue"/> |
| <remove-value value-field="lookedUpValue"/> |
| </simple-method> |
| <simple-method method-name="createPartyInvitationRoleAssoc" short-description="Create a PartyInvitationRoleAssoc"> |
| <make-value entity-name="PartyInvitationRoleAssoc" value-field="newEntity"/> |
| <set-pk-fields map="parameters" value-field="newEntity"/> |
| <create-value value-field="newEntity"/> |
| </simple-method> |
| <simple-method method-name="deletePartyInvitationRoleAssoc" short-description="Remove a PartyInvitationRoleAssoc"> |
| <entity-one entity-name="PartyInvitationRoleAssoc" value-field="lookedUpValue"/> |
| <remove-value value-field="lookedUpValue"/> |
| </simple-method> |
| <simple-method method-name="acceptPartyInvitation" short-description="Accept Party Invitation"> |
| <entity-and entity-name="PartyInvitationGroupAssoc" list="partyInvitationGroupAssocs"> |
| <field-map field-name="partyInvitationId" from-field="parameters.partyInvitationId"/> |
| </entity-and> |
| <if-not-empty field="partyInvitationGroupAssocs"> |
| <set field="createPartyRelationshipCtx.partyIdTo" from-field="parameters.partyId"/> |
| <set field="createPartyRelationshipCtx.partyRelationshipTypeId" value="GROUP_ROLLUP"/> |
| <iterate list="partyInvitationGroupAssocs" entry="partyInvitationGroupAssoc"> |
| <set field="createPartyRelationshipCtx.partyIdFrom" from-field="partyInvitationGroupAssoc.partyIdTo"/> |
| <call-service service-name="createPartyRelationship" in-map-name="createPartyRelationshipCtx"/> |
| </iterate> |
| </if-not-empty> |
| <entity-and entity-name="PartyInvitationRoleAssoc" list="partyInvitationRoleAssocs"> |
| <field-map field-name="partyInvitationId" from-field="parameters.partyInvitationId"/> |
| </entity-and> |
| <if-not-empty field="partyInvitationRoleAssocs"> |
| <set field="createPartyRoleCtx.partyId" from-field="parameters.partyId"/> |
| <iterate list="partyInvitationRoleAssocs" entry="partyInvitationRoleAssoc"> |
| <entity-one entity-name="PartyRole" value-field="partyRole"> |
| <field-map field-name="roleTypeId" from-field="partyInvitationRoleAssoc.roleTypeId"/> |
| </entity-one> |
| <if-empty field="partyRole"> |
| <set field="createPartyRoleCtx.roleTypeId" from-field="partyInvitationRoleAssoc.roleTypeId"/> |
| <call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/> |
| </if-empty> |
| </iterate> |
| </if-not-empty> |
| <set field="updatePartyInvitationCtx.partyInvitationId" from-field="parameters.partyInvitationId"/> |
| <set field="updatePartyInvitationCtx.statusId" value="PARTYINV_ACCEPTED"/> |
| <call-service service-name="updatePartyInvitation" in-map-name="updatePartyInvitationCtx"/> |
| </simple-method> |
| <simple-method method-name="declinePartyInvitation" short-description="Decline Party Invitation"> |
| <set field="updatePartyInvitationCtx.partyInvitationId" from-field="parameters.partyInvitationId"/> |
| <set field="updatePartyInvitationCtx.statusId" value="PARTYINV_DECLINED"/> |
| <call-service service-name="updatePartyInvitation" in-map-name="updatePartyInvitationCtx"/> |
| </simple-method> |
| <simple-method method-name="cancelPartyInvitation" short-description="Cancel Party Invitation"> |
| <set field="updatePartyInvitationCtx.partyInvitationId" from-field="parameters.partyInvitationId"/> |
| <set field="updatePartyInvitationCtx.statusId" value="PARTYINV_CANCELLED"/> |
| <call-service service-name="updatePartyInvitation" in-map-name="updatePartyInvitationCtx"/> |
| </simple-method> |
| |
| </simple-methods> |