blob: 2dac093b87ba8b4e219dafb5bf4c0de9243463b2 [file] [log] [blame]
<?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"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="createInternalOrg" short-description="">
<set field="internalCtx.partyIdFrom" from-field="parameters.headpartyId"/>
<set field="internalCtx.partyIdTo" from-field="parameters.partyId"/>
<set field="internalCtx.partyRelationshipTypeId" value="GROUP_ROLLUP"/>
<set field="internalCtx.roleTypeIdFrom" value="INTERNAL_ORGANIZATIO"/>
<set field="internalCtx.roleTypeIdTo" value="INTERNAL_ORGANIZATIO"/>
<call-service service-name="createPartyRelationship" in-map-name="internalCtx"></call-service>
</simple-method>
<simple-method method-name="removeEmlpPosition" short-description="">
<entity-and list="emplPositionFulfillment" entity-name="EmplPositionFulfillment">
<field-map field-name="emplPositionId" from-field="parameters.emplPositionId"/>
<field-map field-name="partyId" from-field="parameters.partyId"/>
</entity-and>
<if-not-empty field="emplPositionFulfillment">
<set field="parameters.fromDate" from-field="emplPositionFulfillment[0].fromDate"/>
<set-service-fields service-name="deleteEmplPositionFulfillment" to-map="delFullfillCtx" map="parameters"/>
<call-service service-name="deleteEmplPositionFulfillment" in-map-name="delFullfillCtx"></call-service>
</if-not-empty>
<set-service-fields service-name="deleteEmplPosition" to-map="delEmlpCtx" map="parameters"/>
<call-service service-name="deleteEmplPosition" in-map-name="delEmlpCtx"></call-service>
</simple-method>
<simple-method method-name="removeInternalOrg" short-description="">
<entity-and list="partyRelationship" entity-name="PartyRelationship">
<field-map field-name="partyIdTo" from-field="parameters.partyId"/>
<field-map field-name="partyIdFrom" from-field="parameters.parentpartyId"/>
</entity-and>
<if-not-empty field="partyRelationship">
<set-service-fields service-name="deletePartyRelationship" map="partyRelationship[0]" to-map="deletePartyRelationship"/>
</if-not-empty>
<call-service service-name="deletePartyRelationship" in-map-name="deletePartyRelationship"></call-service>
</simple-method>
<!-- Public Holiday -->
<simple-method method-name="createPublicHoliday" short-description="Create Public Holiday">
<if-empty field="parameters.estimatedStartDate">
<add-error>
<fail-message message="The FromDate is missing"/>
</add-error>
<check-errors/>
</if-empty>
<set field="dateValue" from-field="parameters.estimatedStartDate" type="Timestamp"/>
<call-class-method method-name="getDayEnd" class-name="org.ofbiz.base.util.UtilDateTime" ret-field="dateEnd">
<field field="dateValue" type="java.sql.Timestamp"/>
</call-class-method>
<set field="parameters.estimatedCompletionDate" from-field="dateEnd"/>
<entity-and list="workEffortList" entity-name="WorkEffort">
<field-map field-name="workEffortTypeId" value="PUBLIC_HOLIDAY"/>
<field-map field-name="estimatedStartDate" from-field="parameters.estimatedStartDate"/>
</entity-and>
<if-empty field="workEffortList">
<call-service service-name="createWorkEffortAndPartyAssign" in-map-name="parameters">
<default-message resource="CommonUiLabels" property="CommonSuccessfullyCreated"/>
</call-service>
<else>
<add-error>
<fail-message message="This FromDate : ${parameters.estimatedStartDate} already exist."/>
</add-error>
<check-errors/>
</else>
</if-empty>
</simple-method>
</simple-methods>