Updated all simple methods to use the new attributes

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@667748 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Scott Gray
2008-06-14 06:03:12 +00:00
parent 1c835f04cf
commit 5e401fcd53
116 changed files with 2757 additions and 2757 deletions
@@ -36,7 +36,7 @@ under the License.
<set from-field="agreementId" field="newEntity.agreementId"/>
<field-to-result field-name="agreementId" result-name="agreementId"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -81,7 +81,7 @@ under the License.
<set from-field="agreementIdTo" field="createAgreementItemInMap.agreementId"/>
<call-service service-name="createAgreementItem" in-map-name="createAgreementItemInMap"/>
</iterate>
<if-compare field-name="parameters.copyAgreementTerms" value="Y" operator="equals">
<if-compare field="parameters.copyAgreementTerms" value="Y" operator="equals">
<get-related value-name="agreement" relation-name="AgreementTerm" list-name="agreementTerms"/>
<iterate list-name="agreementTerms" entry-name="agreementTerm">
<clear-field field-name="createAgreementTermInMap"/>
@@ -90,7 +90,7 @@ under the License.
<call-service service-name="createAgreementTerm" in-map-name="createAgreementTermInMap"/>
</iterate>
</if-compare>
<if-compare field-name="parameters.copyAgreementProducts" value="Y" operator="equals">
<if-compare field="parameters.copyAgreementProducts" value="Y" operator="equals">
<get-related value-name="agreement" relation-name="AgreementProductAppl" list-name="agreementProductAppls"/>
<iterate list-name="agreementProductAppls" entry-name="agreementProductAppl">
<clear-field field-name="createAgreementProductApplInMap"/>
@@ -99,7 +99,7 @@ under the License.
<call-service service-name="createAgreementProductAppl" in-map-name="createAgreementProductApplInMap"/>
</iterate>
</if-compare>
<if-compare field-name="parameters.copyAgreementParties" value="Y" operator="equals">
<if-compare field="parameters.copyAgreementParties" value="Y" operator="equals">
<get-related value-name="agreement" relation-name="AgreementPartyApplic" list-name="agreementPartyApplic"/>
<iterate list-name="agreementPartyApplics" entry-name="agreementPartyApplic">
<clear-field field-name="createAgreementPartyApplicInMap"/>
@@ -119,7 +119,7 @@ under the License.
<set from-field="parameters.agreementId" field="newEntity.agreementId"/>
<!-- create a non existing ID -->
<if-empty field-name="parameters.agreementItemSeqId">
<if-empty field="parameters.agreementItemSeqId">
<make-next-seq-id value-name="newEntity" seq-field-name="agreementItemSeqId"/>
<set from-field="agreementItemSeqId" field="newEntity.agreementItemSeqId"/>
<else>
@@ -311,7 +311,7 @@ under the License.
<!--AgreementWorkEffortAppl-->
<simple-method method-name="createAgreementWorkEffortAppl" short-description="Create a link between a WorkEffort and a Agreement Appl">
<entity-one entity-name="AgreementWorkEffortAppl" value-name="agreementWorkEffortAppl"/>
<if-not-empty field-name="agreementWorkEffortAppl">
<if-not-empty field="agreementWorkEffortAppl">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingAgreementWorkEffortApplAlreadyExists"/></add-error>
<check-errors/>
<else>
@@ -327,4 +327,4 @@ under the License.
<remove-value value-name="agreementWorkEffortAppl"/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -42,7 +42,7 @@ under the License.
<make-value entity-name="WorkEffortCostCalc" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
<create-value value-name="newEntity"/>
@@ -35,7 +35,7 @@ under the License.
<set field="organizationPartyId" from-field="finAccount.organizationPartyId"/>
<!-- Figure out which GlAccount to post to using finAccount.postToGlAccountId or if not specified then use FinAccountTypeGlAccount -->
<if-not-empty field-name="finAccount.postToGlAccountId">
<if-not-empty field="finAccount.postToGlAccountId">
<set field="glAccountId" from-field="finAccount.postToGlAccountId"/>
<else>
@@ -43,7 +43,7 @@ under the License.
<field-map field-name="organizationPartyId"/>
<field-map field-name="finAccountTypeId" env-name="finAccount.finAccountTypeId"/>
</entity-one>
<if-not-empty field-name="finAccountTypeGlAccount">
<if-not-empty field="finAccountTypeGlAccount">
<set field="glAccountId" from-field="finAccountTypeGlAccount.glAccountId"/>
</if-not-empty>
</else>
@@ -77,7 +77,7 @@ under the License.
if from account refill product purchase pull from special account where those funds wait;
if purchase on account, balance like bank acount received or something -->
<if>
<condition><if-compare field-name="finAccountTrans.finAccountTransTypeId" operator="equals" value="DEPOSIT"/></condition>
<condition><if-compare field="finAccountTrans.finAccountTransTypeId" operator="equals" value="DEPOSIT"/></condition>
<then>
<!-- TODO: somehow check to see if the deposit was not from a product, or didn't get into the general CUSTOMER CREDITS 213000 account -->
@@ -93,7 +93,7 @@ under the License.
<set field="createAcctgTransAndEntriesMap.acctgTransTypeId" value="RECEIPT"/>
</then>
<else-if>
<condition><if-compare field-name="finAccountTrans.finAccountTransTypeId" operator="equals" value="WITHDRAWAL"/></condition>
<condition><if-compare field="finAccountTrans.finAccountTransTypeId" operator="equals" value="WITHDRAWAL"/></condition>
<then>
<!-- TODO: somehow determine if this is an order placed against the account or some other type of withdrawal -->
@@ -105,7 +105,7 @@ under the License.
</then>
</else-if>
<else-if>
<condition><if-compare field-name="finAccountTrans.finAccountTransTypeId" operator="equals" value="ADJUSTMENT"/></condition>
<condition><if-compare field="finAccountTrans.finAccountTransTypeId" operator="equals" value="ADJUSTMENT"/></condition>
<then>
<!-- TODO: what to do for an adjustment? for now nothing, will error out below -->
@@ -119,13 +119,13 @@ under the License.
</if>
<!-- Make sure we have the glAccountId, glAccountIdOffset, organizationPartyId -->
<if-empty field-name="mainAcctgTransEntry.glAccountId">
<if-empty field="mainAcctgTransEntry.glAccountId">
<add-error><fail-message message="Cannot post FinAccountTrans with ID [${parameters.finAccountTransId}] to GL, could not find Main glAccountId"/></add-error>
</if-empty>
<if-empty field-name="offsetAcctgTransEntry.glAccountId">
<if-empty field="offsetAcctgTransEntry.glAccountId">
<add-error><fail-message message="Cannot post FinAccountTrans with ID [${parameters.finAccountTransId}] to GL, could not find Offset glAccountId"/></add-error>
</if-empty>
<if-empty field-name="organizationPartyId">
<if-empty field="organizationPartyId">
<add-error><fail-message message="Cannot post FinAccountTrans with ID [${parameters.finAccountTransId}] to GL, could not find organizationPartyId"/></add-error>
</if-empty>
<check-errors/>
@@ -31,7 +31,7 @@ under the License.
<call-simple-method method-name="getArithmeticSettingsInline"/>
<!-- if no statusId set to default to FNACT_ACTIVE -->
<if-empty field-name="parameters.statusId">
<if-empty field="parameters.statusId">
<set field="parameters.statusId" value="FNACT_ACTIVE"/>
</if-empty>
@@ -39,21 +39,21 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.finAccountId">
<if-empty field="newEntity.finAccountId">
<sequenced-id-to-env sequence-name="FinAccount" env-name="finAccountId"/>
<to-string field-name="finAccountId"/>
<set from-field="finAccountId" field="newEntity.finAccountId"/>
</if-empty>
<!-- set the currency if none is already set -->
<if-empty field-name="newEntity.currencyUomId">
<if-empty field="newEntity.currencyUomId">
<property-to-field resource="general" property="currency.uom.id.default" field-name="defaultCurrency"/>
<set field="newEntity.currencyUomId" from-field="defaultCurrency"/>
</if-empty>
<!-- set the refundable flag from the type; if not set -->
<if-empty field-name="newEntity.isRefundable">
<if-empty field="newEntity.isRefundable">
<entity-one entity-name="FinAccountType" value-name="finAccountType">
<field-map field-name="finAccountTypeId" env-name="parameters.finAccountTypeId"/>
</entity-one>
@@ -61,9 +61,9 @@ under the License.
<condition>
<and>
<not>
<if-empty field-name="finAccountType.isRefundable"/>
<if-empty field="finAccountType.isRefundable"/>
</not>
<if-compare field-name="finAccountType.isRefundable" value="Y" operator="equals"/>
<if-compare field="finAccountType.isRefundable" value="Y" operator="equals"/>
</and>
</condition>
<then>
@@ -95,19 +95,19 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="parameters.statusId"></if-empty></not>
<if-compare-field operator="not-equals" field-name="lookedUpValue.statusId" to-field-name="parameters.statusId"></if-compare-field>
<not><if-empty field="parameters.statusId"></if-empty></not>
<if-compare-field operator="not-equals" field="lookedUpValue.statusId" to-field="parameters.statusId"></if-compare-field>
</and>
</condition>
<then>
<!-- if the record exists there should be a statusId, but just in case make it so it won't blow up -->
<if-not-empty field-name="lookedUpValue.statusId">
<if-not-empty field="lookedUpValue.statusId">
<!-- if statusId change is not in the StatusValidChange list, complain... -->
<entity-one entity-name="StatusValidChange" value-name="statusValidChange" auto-field-map="false">
<field-map field-name="statusId" env-name="lookedUpValue.statusId"/>
<field-map field-name="statusIdTo" env-name="parameters.statusId"/>
</entity-one>
<if-empty field-name="statusValidChange">
<if-empty field="statusValidChange">
<!-- no valid change record found? return an error... -->
<add-error><fail-property resource="CommonUiLabels" property="CommonErrorNoStatusValidChange"/></add-error>
<check-errors/>
@@ -146,7 +146,7 @@ under the License.
<order-by field-name="-statusDate"/>
</entity-and>
<first-from-list entry-name="oldFinAccountStatus" list-name="oldFinAccountStatusList"/>
<if-not-empty field-name="oldFinAccountStatus">
<if-not-empty field="oldFinAccountStatus">
<set field="oldFinAccountStatus.statusEndDate" from-field="nowTimestamp"/>
<store-value value-name="oldFinAccountStatus"/>
</if-not-empty>
@@ -167,10 +167,10 @@ under the License.
<sequenced-id-to-env sequence-name="FinAccountTrans" env-name="newEntity.finAccountTransId"/>
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="newEntity.transactionDate">
<if-empty field="newEntity.transactionDate">
<set from-field="nowTimestamp" field="newEntity.transactionDate"/>
</if-empty>
<if-empty field-name="newEntity.entryDate">
<if-empty field="newEntity.entryDate">
<set from-field="nowTimestamp" field="newEntity.entryDate"/>
</if-empty>
@@ -181,7 +181,7 @@ under the License.
<calculate field-name="newEntity.amount" decimal-scale="${roundingDecimals}" rounding-mode="${roundingMode}">
<calcop operator="get" field-name="newEntity.amount"/>
</calculate>
<if-compare-field field-name="newEntity.amount" operator="not-equals" to-field-name="originalAmount" type="BigDecimal">
<if-compare-field field="newEntity.amount" to-field="originalAmount" operator="not-equals" type="BigDecimal">
<log level="warning" message="In createFinAccountTrans had to round the amount from [${originalAmount}] to [${newEntity.amount}]"></log>
</if-compare-field>
@@ -195,7 +195,7 @@ under the License.
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<set-nonpk-fields value-name="newEntity" map-name="parameters"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -221,10 +221,10 @@ under the License.
<sequenced-id-to-env sequence-name="FinAccountAuth" env-name="newEntity.finAccountAuthId"/>
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="newEntity.authorizationDate">
<if-empty field="newEntity.authorizationDate">
<set from-field="nowTimestamp" field="newEntity.authorizationDate"/>
</if-empty>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -233,7 +233,7 @@ under the License.
<calculate field-name="newEntity.amount" decimal-scale="${roundingDecimals}" rounding-mode="${roundingMode}">
<calcop operator="get" field-name="newEntity.amount"/>
</calculate>
<if-compare-field field-name="newEntity.amount" operator="not-equals" to-field-name="originalAmount" type="BigDecimal">
<if-compare-field field="newEntity.amount" to-field="originalAmount" operator="not-equals" type="BigDecimal">
<log level="warning" message="In createFinAccountAuth had to round the amount from [${originalAmount}] to [${newEntity.amount}]"></log>
</if-compare-field>
@@ -242,7 +242,7 @@ under the License.
</simple-method>
<simple-method method-name="expireFinAccountAuth" short-description="Expire a Financial Account Authorization">
<entity-one entity-name="FinAccountAuth" value-name="finAccountAuth"/>
<if-empty field-name="parameters.expireDateTime">
<if-empty field="parameters.expireDateTime">
<now-timestamp-to-env env-name="finAccountAuth.thruDate"/>
<else>
<set from-field="parameters.expireDatetime" field="finAccountAuth.thruDate"/>
@@ -253,7 +253,7 @@ under the License.
<!-- Some methods to maintain FinAccount.actualBalance and FinAccount.availableBalance -->
<simple-method method-name="updateFinAccountBalancesFromTrans" short-description="">
<if-not-empty field-name="parameters.finAccountId">
<if-not-empty field="parameters.finAccountId">
<set field="finAccountId" from-field="parameters.finAccountId"/>
<else>
<entity-one entity-name="FinAccountTrans" value-name="mainFinAccountTrans"/>
@@ -264,7 +264,7 @@ under the License.
<call-simple-method method-name="inlineUpdateFinAccountActualAndAvailableBalance"/>
</simple-method>
<simple-method method-name="updateFinAccountBalancesFromAuth" short-description="">
<if-not-empty field-name="parameters.finAccountId">
<if-not-empty field="parameters.finAccountId">
<set field="finAccountId" from-field="parameters.finAccountId"/>
<else>
<entity-one entity-name="FinAccountAuth" value-name="mainFinAccountAuth"/>
@@ -286,14 +286,14 @@ under the License.
<set field="actualBalanceSum" value="0" type="BigDecimal"/>
<iterate entry-name="finAccountTrans" list-name="finAccountTransList">
<if>
<condition><if-compare field-name="finAccountTrans.finAccountTransTypeId" operator="equals" value="DEPOSIT"/></condition>
<condition><if-compare field="finAccountTrans.finAccountTransTypeId" operator="equals" value="DEPOSIT"/></condition>
<then><set field="amountForCalc" from-field="finAccountTrans.amount"/></then>
<else-if>
<condition><if-compare field-name="finAccountTrans.finAccountTransTypeId" operator="equals" value="WITHDRAWAL"/></condition>
<condition><if-compare field="finAccountTrans.finAccountTransTypeId" operator="equals" value="WITHDRAWAL"/></condition>
<then><calculate field-name="amountForCalc"><calcop operator="negative" field-name="finAccountTrans.amount"/></calculate></then>
</else-if>
<else-if>
<condition><if-compare field-name="finAccountTrans.finAccountTransTypeId" operator="equals" value="ADJUSTMENT"/></condition>
<condition><if-compare field="finAccountTrans.finAccountTransTypeId" operator="equals" value="ADJUSTMENT"/></condition>
<then><set field="amountForCalc" from-field="finAccountTrans.amount"/></then>
</else-if>
</if>
@@ -32,12 +32,12 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<!-- create a non existing ID if not supplied -->
<if-empty field-name="parameters.fixedAssetId">
<if-empty field="parameters.fixedAssetId">
<sequenced-id-to-env sequence-name="FixedAsset" env-name="newEntity.fixedAssetId"/>
<else>
<!-- check the Duplicate ID> -->
<entity-one entity-name="FixedAsset" value-name="fixedAsset"/>
<if-not-empty field-name="fixedAsset">
<if-not-empty field="fixedAsset">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingFixedAssetIdAlreadyExists"/></add-error>
<log level="info" message="${AccountingUiLabels.AccountingFixedAssetIdAlreadyExists} "/>
</if-not-empty>
@@ -68,7 +68,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -120,7 +120,7 @@ under the License.
<!-- Check, should not exist already -->
<entity-one entity-name="FixedAssetStdCost" value-name="fixedAssetStdCost"/>
<if-not-empty field-name="fixedAssetStdCost">
<if-not-empty field="fixedAssetStdCost">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingFixedAssetStdCostAlreadyExists"/></add-error>
</if-not-empty>
<check-errors/>
@@ -168,7 +168,7 @@ under the License.
<make-value value-name="newEntity" entity-name="FixedAssetRegistration"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
<create-value value-name="newEntity"/>
@@ -190,7 +190,7 @@ under the License.
<make-next-seq-id value-name="newEntity" seq-field-name="maintHistSeqId"/> <!-- this finds the next sub-sequence ID -->
<field-to-result field-name="newEntity.maintHistSeqId" result-name="maintHistSeqId"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-not-empty field-name="parameters.productMaintSeqId">
<if-not-empty field="parameters.productMaintSeqId">
<entity-one entity-name="FixedAsset" value-name="fixedAsset"/>
<entity-one entity-name="ProductMaint" value-name="productMaint">
<field-map field-name="productId" env-name="fixedAsset.instanceOfProductId"/>
@@ -198,14 +198,14 @@ under the License.
</entity-one>
<set field="newEntity.productMaintTypeId" from-field="productMaint.productMaintTypeId"/>
</if-not-empty >
<if-not-empty field-name="productMaint.maintTemplateWorkEffortId">
<if-not-empty field="productMaint.maintTemplateWorkEffortId">
<set field="maintTemplateWorkEffortId" from-field="productMaint.maintTemplateWorkEffortId"/>
<else>
<!-- User can still pick a Template workEffort -->
<set field="maintTemplateWorkEffortId" from-field="parameters.maintTemplateWorkEffortId"/>
</else>
</if-not-empty>
<if-not-empty field-name="maintTemplateWorkEffortId">
<if-not-empty field="maintTemplateWorkEffortId">
<set field="duplicateTemplateWorkEffortMap.oldWorkEffortId" from-field="maintTemplateWorkEffortId"/>
<sequenced-id-to-env sequence-name="WorkEffort" env-name="duplicateTemplateWorkEffortMap.workEffortId"/>
@@ -234,7 +234,7 @@ under the License.
<simple-method method-name="updateFixedAssetMaint" short-description="Update an existing FixedAsset Maintenance">
<entity-one entity-name="FixedAssetMaint" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<if-not-empty field-name="parameters.productMaintSeqId">
<if-not-empty field="parameters.productMaintSeqId">
<entity-one entity-name="FixedAsset" value-name="fixedAsset"/>
<entity-one entity-name="ProductMaint" value-name="productMaint">
<field-map field-name="productId" env-name="fixedAsset.instanceOfProductId"/>
@@ -270,20 +270,20 @@ under the License.
<simple-method method-name="createFixedAssetMaintOrder" short-description="Create a FixedAsset Maintenance Order">
<!-- Check, should exist orderId and orderItemId -->
<entity-one entity-name="OrderHeader" value-name="lookedUpValue"/>
<if-empty field-name="lookedUpValue">
<if-empty field="lookedUpValue">
<set field="orderId" from-field="parameters.orderId"/>
<add-error><fail-property resource="AccountingUiLabels" property="AccountingOrderWithIdNotFound"/></add-error>
</if-empty>
<check-errors/>
<!-- Check if user has not passed in orderItemSeqId then get list of OrderItems from database and default to first item -->
<if-empty field-name="orderItemSeqId" map-name="parameters">
<if-empty field="parameters.orderItemSeqId">
<entity-and entity-name="OrderItem" list-name="orderItems">
<field-map field-name="orderId" env-name="parameters.orderId"/>
</entity-and>
<if-not-empty field-name="orderItems">
<if-not-empty field="orderItems">
<set field="orderItem" from-field="orderItems[0]"/>
<if-not-empty field-name="orderItem">
<if-not-empty field="orderItem">
<set field="parameters.orderItemSeqId" from-field="orderItem.orderItemSeqId"/>
</if-not-empty>
</if-not-empty>
@@ -291,7 +291,7 @@ under the License.
<else>
<!-- Check, should exist orderId and orderItemId -->
<entity-one entity-name="OrderItem" value-name="lookedUpValue"/>
<if-empty field-name="lookedUpValue">
<if-empty field="lookedUpValue">
<set field="orderItemSeqId" from-field="parameters.orderItemSeqId"/>
<add-error><fail-property resource="AccountingUiLabels" property="AccountingOrderItemWithIdNotFound"/></add-error>
</if-empty>
@@ -314,7 +314,7 @@ under the License.
<make-value entity-name="PartyFixedAssetAssignment" value-name="newEntity"/>
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<set-nonpk-fields value-name="newEntity" map-name="parameters"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp"/>
</if-empty>
@@ -339,7 +339,7 @@ under the License.
<set field="purchaseCost" from-field="parameters.purchaseCost" type="Double"/>
<set field="salvageValue" from-field="parameters.salvageValue" type="Double"/>
<call-object-method obj-field-name="parameters.usageYears" method-name="intValue" ret-field-name="intUsageYears"/>
<if-not-empty field-name="parameters.fixedAssetId">
<if-not-empty field="parameters.fixedAssetId">
<set field="depreciation" value="0.0" type="Double"/>
<!--FORMULA : depreciation = (purchaseCost - salvageValue) / (expectedEndOfLife - dateAcquired) -->
<calculate field-name="depreciation" decimal-scale="2" type="Double">
@@ -376,7 +376,7 @@ under the License.
<set field="purchaseCost" from-field="parameters.purchaseCost" type="Double"/>
<set field="salvageValue" from-field="parameters.salvageValue" type="Double"/>
<call-object-method obj-field-name="parameters.usageYears" method-name="intValue" ret-field-name="intUsageYears"/>
<if-not-empty field-name="parameters.fixedAssetId">
<if-not-empty field="parameters.fixedAssetId">
<loop count="${intUsageYears}">
<set field="depreciation" value="0.0" type="Double"/>
<!--FORMULA : depreciation = (NBV - salvageValue) * 2 / (expectedEndOfLife - dateAcquired) -->
@@ -418,7 +418,7 @@ under the License.
<simple-method method-name="calculateFixedAssetDepreciation" short-description="Service to calculate the yearly depreciation from dateAcquired year to current financial year">
<entity-one entity-name="FixedAsset" value-name="fixedAsset"/>
<if-empty field-name="fixedAsset">
<if-empty field="fixedAsset">
<add-error><fail-property resource="ManufacturingUiLabels" property="ManufacturingFixedAssetNotExist"/></add-error>
<check-errors/>
</if-empty>
@@ -426,7 +426,7 @@ under the License.
<set field="endIndex" value="4" type="Integer"/>
<!-- Extract asset end of life year from field expectedEndOfLife -->
<if-not-empty field-name="fixedAsset.expectedEndOfLife">
<if-not-empty field="fixedAsset.expectedEndOfLife">
<set field="expectedEndOfLife" from-field="fixedAsset.expectedEndOfLife"/>
<to-string field-name="expectedEndOfLife"/>
<call-object-method method-name="substring" obj-field-name="expectedEndOfLife" ret-field-name="expEndOfLifeYear">
@@ -440,7 +440,7 @@ under the License.
</if-not-empty>
<!-- Extract asset acquired year from field dateAcquired -->
<if-not-empty field-name="fixedAsset.dateAcquired">
<if-not-empty field="fixedAsset.dateAcquired">
<set field="dateAcquired" from-field="fixedAsset.dateAcquired"/>
<to-string field-name="dateAcquired"/>
<call-object-method method-name="substring" obj-field-name="dateAcquired" ret-field-name="assetAcquiredYear">
@@ -454,7 +454,7 @@ under the License.
</if-not-empty>
<!-- if any asset's salvage value is empty then set it by 0 -->
<if-empty field-name="fixedAsset.salvageValue">
<if-empty field="fixedAsset.salvageValue">
<set field="salvageValue" value="0.0" type="Double"/>
<else>
<set field="salvageValue" from-field="fixedAsset.salvageValue"/>
@@ -480,7 +480,7 @@ under the License.
<entity-and entity-name="FixedAssetDepMethod" list-name="fixedAssetDepMethods" filter-by-date="true">
<field-map field-name="fixedAssetId" env-name="parameters.fixedAssetId"/>
</entity-and>
<if-not-empty field-name="fixedAssetDepMethods">
<if-not-empty field="fixedAssetDepMethods">
<first-from-list list-name="fixedAssetDepMethods" entry-name="fixedAssetDepMethod"/>
<get-related-one relation-name="CustomMethod" value-name="fixedAssetDepMethod" to-value-name="customMethod"/>
<log level="info" message="Depreciation service name for the FixedAsset ${parameters.fixedAssetId} is ${customMethod.customMethodName}"/>
@@ -30,12 +30,12 @@ under the License.
<if>
<condition>
<if-compare field-name="partyAcctgPreference.invoiceSequenceEnumId" operator="equals" value="INVSQ_ENF_SEQ"/>
<if-compare field="partyAcctgPreference.invoiceSequenceEnumId" operator="equals" value="INVSQ_ENF_SEQ"/>
</condition>
<then>
<log level="info" message="In createInvoice sequence enum INVSQ_ENF_SEQ"/>
<!-- this is sequential sequencing, we can't skip a number, also it must be a unique sequence per partyIdFrom -->
<if-not-empty field-name="partyAcctgPreference.lastInvoiceNumber">
<if-not-empty field="partyAcctgPreference.lastInvoiceNumber">
<calculate field-name="partyAcctgPreference.lastInvoiceNumber" type="Long">
<calcop operator="add" field-name="partyAcctgPreference.lastInvoiceNumber"/>
<number value="1"/>
@@ -49,14 +49,14 @@ under the License.
</then>
<else-if>
<condition>
<if-compare field-name="partyAcctgPreference.invoiceSequenceEnumId" operator="equals" value="INVSQ_RESTARTYR"/>
<if-compare field="partyAcctgPreference.invoiceSequenceEnumId" operator="equals" value="INVSQ_RESTARTYR"/>
</condition>
<then>
<log level="info" message="In createInvoice sequence enum INVSQ_RESTARTYR"/>
<!-- this is sequential sequencing, we can't skip a number; except that it is restarted each fiscal year -->
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="partyAcctgPreference.lastInvoiceRestartDate">
<if-empty field="partyAcctgPreference.lastInvoiceRestartDate">
<!-- if no lastInvoiceRestartDate then it's easy, just start now with 1 -->
<calculate field-name="partyAcctgPreference.lastInvoiceNumber" type="Long"><number value="1"/></calculate>
<set from-field="nowTimestamp" field="partyAcctgPreference.lastInvoiceRestartDate"/>
@@ -72,8 +72,8 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="partyAcctgPreference.lastInvoiceRestartDate" operator="less" to-field-name="curYearFiscalStartDate" type="Timestamp"/>
<if-compare-field field-name="nowTimestamp" operator="greater-equals" to-field-name="curYearFiscalStartDate" type="Timestamp"/>
<if-compare-field field="partyAcctgPreference.lastInvoiceRestartDate" to-field="curYearFiscalStartDate" operator="less" type="Timestamp"/>
<if-compare-field field="nowTimestamp" to-field="curYearFiscalStartDate" operator="greater-equals" type="Timestamp"/>
</and>
</condition>
<then>
@@ -106,7 +106,7 @@ under the License.
<log level="info" message="In createInvoice sequence enum INVSQ_STANDARD"/>
<!-- default to the default sequencing: INVSQ_STANDARD -->
<set from-field="parameters.invoiceId" field="invoiceIdTemp"/>
<if-empty field-name="invoiceIdTemp">
<if-empty field="invoiceIdTemp">
<sequenced-id-to-env sequence-name="Invoice" env-name="invoiceIdTemp"/>
<else>
<!-- check the provided ID -->
@@ -131,7 +131,7 @@ under the License.
<!-- call getNextInvoiceId service with the parameters.partyIdFrom when invoice Id is not suplied
else use it from the input -->
<if-empty field-name="parameters.invoiceId">
<if-empty field="parameters.invoiceId">
<set field="getNextInvoiceIdMap.partyId" from-field="parameters.partyIdFrom"/>
<call-service service-name="getNextInvoiceId" in-map-name="getNextInvoiceIdMap">
<result-to-field result-name="invoiceId" field-name="newEntity.invoiceId"/>
@@ -142,10 +142,10 @@ under the License.
</if-empty>
<field-to-result field-name="newEntity.invoiceId" result-name="invoiceId"/>
<if-empty field-name="parameters.invoiceDate">
<if-empty field="parameters.invoiceDate">
<set from-field="nowTimestamp" field="newEntity.invoiceDate"/>
</if-empty>
<if-empty field-name="parameters.currencyUomId">
<if-empty field="parameters.currencyUomId">
<set from-field="partyAcctgPreference.baseCurrencyUomId" field="newEntity.currencyUomId"/>
</if-empty>
@@ -169,7 +169,7 @@ under the License.
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="invoice.invoiceDate" from-field="nowTimestamp"/>
<set field="invoice.statusId" value="INVOICE_IN_PROCESS"/>
<if-not-empty field-name="parameters.invoiceTypeId">
<if-not-empty field="parameters.invoiceTypeId">
<set field="invoice.invoiceTypeId" from-field="parameters.invoiceTypeId"/>
</if-not-empty>
<set-service-fields service-name="createInvoice" map-name="invoice" to-map-name="newInvoice"/>
@@ -205,13 +205,13 @@ under the License.
<find-by-primary-key entity-name="Invoice" map-name="lookupPKMap" value-name="lookedUpValue"/>
<!-- only try to update content if the status is in process.... -->
<if-compare field-name="statusId" map-name="lookedUpValue" operator="equals" value="INVOICE_IN_PROCESS">
<if-compare field="lookedUpValue.statusId" operator="equals" value="INVOICE_IN_PROCESS">
<clone-value value-name="lookedUpValue" new-value-name="savedValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<!-- only save if something has changed, do not update status here -->
<set from-field="savedValue.statusId" field="lookedUpValue.statusId"/> <!-- get old status back -->
<if-compare-field field-name="lookedUpValue" operator="not-equals" to-field-name="savedValue" type="Object">
<if-compare-field field="lookedUpValue" to-field="savedValue" operator="not-equals" type="Object">
<store-value value-name="lookedUpValue"/> <!-- update all non status and key fields -->
</if-compare-field>
<else>
@@ -222,7 +222,7 @@ under the License.
</if-compare>
<!-- check if there is a status change if yes call invoice status update service -->
<if-compare-field field-name="parameters.statusId" operator="not-equals" to-field-name="savedValue.statusId">
<if-compare-field field="parameters.statusId" to-field="savedValue.statusId" operator="not-equals">
<set from-field="parameters.invoiceId" field="inputMap.invoiceId"/>
<set from-field="parameters.statusId" field="inputMap.statusId"/>
<now-timestamp-to-env env-name="inputMap.statusDate"/>
@@ -246,14 +246,14 @@ under the License.
<make-value value-name="newEntity" entity-name="InvoiceItem"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.invoiceItemSeqId">
<if-empty field="newEntity.invoiceItemSeqId">
<make-next-seq-id value-name="newEntity" seq-field-name="invoiceItemSeqId"/> <!-- this finds the next sub-sequence ID -->
<!--field-to-result field-name="newEntity.invoiceItemSeqId" result-name="invoiceItemSeqId"/-->
</if-empty>
<!-- if there is no amount and a productItem is supplied fill the amount(price) and description from the product record
TODO: there are return adjustments now that make this code very broken. The check for price was added as a quick fix. -->
<if-empty field-name="parameters.amount">
<if-not-empty field-name="parameters.productId">
<if-empty field="parameters.amount">
<if-not-empty field="parameters.productId">
<entity-one entity-name="Product" value-name="product"/>
<set from-field="product.description" field="newEntity.description"/>
<set from-field="product" field="calculateProductPriceMap.product"/>
@@ -262,7 +262,7 @@ under the License.
</call-service>
</if-not-empty>
</if-empty>
<if-empty field-name="newEntity.amount">
<if-empty field="newEntity.amount">
<add-error>
<fail-message message="The amount value is mandatory"/>
</add-error>
@@ -282,8 +282,8 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<!-- check if the productNumber is updated, when yes retrieve product description and price -->
<if-not-empty field-name="productId">
<if-compare-field field-name="productId" map-name="savedValue" operator="not-equals" to-map-name="lookedUpValue">
<if-not-empty field="productId">
<if-compare-field to-field="lookedUpValue." field="savedValue.productId" operator="not-equals">
<entity-one entity-name="Product" value-name="product"/>
<set from-field="product.description" field="lookedUpValue.description"/>
@@ -293,12 +293,12 @@ under the License.
</call-service>
</if-compare-field>
</if-not-empty>
<if-empty field-name="newEntity.amount">
<if-empty field="newEntity.amount">
<add-error>
<fail-message message="The amount value is mandatory"/>
</add-error>
</if-empty>
<if-compare-field field-name="lookedUpValue" operator="not-equals" to-field-name="savedValue" type="Object">
<if-compare-field field="lookedUpValue" to-field="savedValue" operator="not-equals" type="Object">
<store-value value-name="lookedUpValue"/>
</if-compare-field>
</simple-method>
@@ -309,7 +309,7 @@ under the License.
<set field="paymentApplicationMap.invoiceId" from-field="parameters.invoiceId"/>
<set field="paymentApplicationMap.invoiceItemSeqId" from-field="parameters.invoiceItemSeqId"/>
<if-not-empty field-name="parameters.invoiceItemSeqId">
<if-not-empty field="parameters.invoiceItemSeqId">
<!-- check if there are specific item paymentApplications when yes remove those -->
<remove-by-and entity-name="PaymentApplication" map-name="paymentApplicationMap"/>
<else><!-- update global application with a null sequence number -->
@@ -325,19 +325,19 @@ under the License.
<entity-one entity-name="PaymentApplication" value-name="paymentApplication">
<field-map field-name="paymentApplicationId" value="${parameters.paymentApplicationId}"/>
</entity-one>
<if-empty field-name="paymentApplication">
<if-empty field="paymentApplication">
<add-error>
<fail-message message="Cannot find payment application record [${parameters.paymentApplicationId}]"/>
</add-error>
<check-errors/>
</if-empty>
<!-- payment -->
<if-not-empty field-name="paymentApplication.paymentId">
<if-not-empty field="paymentApplication.paymentId">
<entity-one entity-name="Payment" value-name="payment">
<field-map field-name="paymentId" value="${paymentApplication.paymentId}"/>
</entity-one>
<if-not-empty field-name="payment">
<if-compare field-name="payment.statusId" operator="equals" value="PMNT_CONFIRMED">
<if-not-empty field="payment">
<if-compare field="payment.statusId" operator="equals" value="PMNT_CONFIRMED">
<add-error><fail-message message="PaymentID [${payment.paymentId}] has status 'confirmed', cannot remove application."/></add-error>
</if-compare>
<check-errors/>
@@ -346,17 +346,17 @@ under the License.
</if-not-empty>
<property-to-field resource="AccountingUiLabels" property="AccountingPaymentApplRemoved" field-name="successMessage"/>
<!-- check invoice -->
<if-not-empty field-name="paymentApplication.invoiceId">
<if-not-empty field="paymentApplication.invoiceId">
<entity-one entity-name="Invoice" value-name="invoice">
<field-map field-name="invoiceId" value="${paymentApplication.invoiceId}"/>
</entity-one>
<if-empty field-name="invoice">
<if-empty field="invoice">
<add-error><fail-message message="Invoice not found, invoice Id: ${paymentApplication.invoiceId}"/></add-error>
<log level="info" message="Invoice not found, invoice Id: ${invoiceId}"/>
<check-errors/>
</if-empty>
<!-- if the invoice is already PAID, then set it back to READY and clear out the paidDate -->
<if-compare field-name="invoice.statusId" operator="equals" value="INVOICE_PAID">
<if-compare field="invoice.statusId" operator="equals" value="INVOICE_PAID">
<set field="invoiceStatusMap.invoiceId" value="${paymentApplication.invoiceId}" />
<set field="invoiceStatusMap.statusId" value="INVOICE_READY"/>
<now-timestamp-to-env env-name="nowTimestamp"/>
@@ -368,17 +368,17 @@ under the License.
<property-to-field resource="AccountingUiLabels" property="AccountingPaymentApplToInvoice" field-name="toMessage"/>
</if-not-empty>
<!-- invoice item -->
<if-not-empty field-name="paymentApplication.invoiceItemSeqId">
<if-not-empty field="paymentApplication.invoiceItemSeqId">
<field-to-result field-name="paymentApplication.invoiceItemSeqId" result-name="invoiceItemSeqId"/>
<property-to-field resource="AccountingUiLabels" property="AccountingApplicationToInvoiceItem" field-name="toMessage"/>
</if-not-empty>
<!-- toPayment -->
<if-not-empty field-name="paymentApplication.toPaymentId">
<if-not-empty field="paymentApplication.toPaymentId">
<entity-one entity-name="Payment" value-name="toPayment">
<field-map field-name="paymentId" value="${paymentApplication.toPaymentId}"/>
</entity-one>
<if-not-empty field-name="toPayment">
<if-compare field-name="toPayment.statusId" operator="equals" value="PMNT_CONFIRMED">
<if-not-empty field="toPayment">
<if-compare field="toPayment.statusId" operator="equals" value="PMNT_CONFIRMED">
<add-error><fail-message message="Related payment [${toPayment.paymentId}] has status 'confirmed', cannot remove application."/></add-error>
</if-compare>
<check-errors/>
@@ -387,12 +387,12 @@ under the License.
<field-to-result field-name="paymentApplication.toPaymentId" result-name="toPaymentId"/>
</if-not-empty>
<!-- billing account -->
<if-not-empty field-name="paymentApplication.billingAccountId">
<if-not-empty field="paymentApplication.billingAccountId">
<field-to-result field-name="paymentApplication.billingAccountId" result-name="billingAccountId"/>
<property-to-field resource="AccountingUiLabels" property="AccountingPaymentApplToBillingAccount" field-name="toMessage"/>
</if-not-empty>
<!-- tax authority -->
<if-not-empty field-name="paymentApplication.taxAuthGeoId">
<if-not-empty field="paymentApplication.taxAuthGeoId">
<field-to-result field-name="paymentApplication.taxAuthGeoId" result-name="taxAuthGeoId"/>
<property-to-field resource="AccountingUiLabels" property="AccountingPaymentApplToTaxAuth" field-name="toMessage"/>
</if-not-empty>
@@ -406,7 +406,7 @@ under the License.
<make-value value-name="newEntity" entity-name="InvoiceRole"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.datetimePerformed"><now-timestamp-to-env env-name="newEntity.datetimePerformed"/></if-empty>
<if-empty field="newEntity.datetimePerformed"><now-timestamp-to-env env-name="newEntity.datetimePerformed"/></if-empty>
<create-value value-name="newEntity"/>
</simple-method>
@@ -419,26 +419,26 @@ under the License.
<simple-method method-name="setInvoiceStatus" short-description="Set The Invoice Status">
<entity-one entity-name="Invoice" value-name="invoice"/>
<field-to-result field-name="invoice.statusId" result-name="oldStatusId"/>
<if-compare-field field-name="invoice.statusId" operator="not-equals" to-field-name="parameters.statusId">
<if-compare-field field="invoice.statusId" to-field="parameters.statusId" operator="not-equals">
<entity-one entity-name="StatusValidChange" value-name="statusChange" auto-field-map="false">
<field-map field-name="statusId" env-name="invoice.statusId"/>
<field-map field-name="statusIdTo" env-name="parameters.statusId"/>
</entity-one>
<if-empty field-name="statusChange">
<if-empty field="statusChange">
<add-error><fail-message message="Status is not a valid change"/></add-error>
<log level="error" message="Cannot change from ${invoice.statusId} to ${parameters.statusId}"/>
<check-errors/>
<else>
<!-- if new status is paid check if the complete invoice is applied. -->
<if-compare field-name="parameters.statusId" operator="equals" value="INVOICE_PAID">
<if-compare field="parameters.statusId" operator="equals" value="INVOICE_PAID">
<set field="notApplied" type="Double" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}"/>
<if-compare field-name="notApplied" operator="not-equals" value="0.00" type="Double">
<if-compare field="notApplied" operator="not-equals" value="0.00" type="Double">
<add-error><fail-message message="Cannot change status to 'paid', invoice ${invoice.invoiceId} has an unapplied balance of [${notApplied}]"/></add-error>
<check-errors/>
</if-compare>
<!-- if it's OK to mark invoice paid, use parameter for paidDate -->
<if-empty field-name="parameters.paidDate">
<if-empty field="parameters.paidDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="invoice.paidDate"/>
<else>
@@ -447,8 +447,8 @@ under the License.
</if-empty>
</if-compare>
<if-not-empty field-name="invoice.paidDate">
<if-compare field-name="parameters.statusId" operator="equals" value="INVOICE_READY">
<if-not-empty field="invoice.paidDate">
<if-compare field="parameters.statusId" operator="equals" value="INVOICE_READY">
<clear-field field-name="invoice.paidDate" />
</if-compare>
</if-not-empty>
@@ -460,13 +460,13 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.statusDate">
<if-empty field="newEntity.statusDate">
<now-timestamp-to-env env-name="newEntity.statusDate"/>
</if-empty>
<create-value value-name="newEntity"/>
<!-- if new status is cancelled remove existing payment applications. -->
<if-compare field-name="parameters.statusId" operator="equals" value="INVOICE_CANCELLED">
<if-compare field="parameters.statusId" operator="equals" value="INVOICE_CANCELLED">
<set field="removePaymentApplicationMap.invoiceId" from-field="parameters.invoiceId"/>
<remove-by-and entity-name="PaymentApplication" map-name="removePaymentApplicationMap"/>
</if-compare>
@@ -489,10 +489,10 @@ under the License.
<simple-method method-name="copyInvoiceToTemplate" short-description="copy a invoice to a InvoiceType starting with 'template'">
<set field="parameters.invoiceIdToCopyFrom" from-field="parameters.invoiceId"/>
<if-compare field-name="parameters.invoiceTypeId" operator="equals" value="SALES_INVOICE">
<if-compare field="parameters.invoiceTypeId" operator="equals" value="SALES_INVOICE">
<set field="parameters.invoiceTypeId" value="SALES_INV_TEMPLATE"/>
</if-compare>
<if-compare field-name="parameters.invoiceTypeId" operator="equals" value="PURCHASE_INVOICE">
<if-compare field="parameters.invoiceTypeId" operator="equals" value="PURCHASE_INVOICE">
<set field="parameters.invoiceTypeId" value="PUR_INV_TEMPLATE"/>
</if-compare>
<call-simple-method method-name="copyInvoice"/>
@@ -502,13 +502,13 @@ under the License.
<simple-method method-name="InvoiceStatusInProgress" short-description="Check if the invoiceStatus is in progress">
<!-- find the current header record -->
<entity-one entity-name="Invoice" value-name="headerValue"/>
<if-empty field-name="headerValue">
<if-empty field="headerValue">
<add-error><fail-message message="Invoice not found, invoice Id: ${invoiceId}"/></add-error>
<log level="info" message="Invoice not found, invoice Id: ${invoiceId}"/>
<check-errors/>
</if-empty>
<!-- check if the status is in progress... -->
<if-compare field-name="headerValue.statusId" operator="not-equals" value="INVOICE_IN_PROCESS">
<if-compare field="headerValue.statusId" operator="not-equals" value="INVOICE_IN_PROCESS">
<add-error><fail-message message="Can only update Invoice, when status is in-process...is now: ${headerValue.statusId}"/></add-error>
<log level="info" message="Can only update Invoice, when status is in-process...is now: ${headerValue.statusId}"/>
</if-compare>
@@ -526,4 +526,4 @@ under the License.
<set-nonpk-fields value-name="lookedUpValue" map-name="parameters"/>
<store-value value-name="lookedUpValue"/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -34,7 +34,7 @@ under the License.
<iterate entry-name="affiliatePartyRelationship" list-name="affiliatePartyRelationshipList">
<!-- calculate a commission for each commission partner, identified by affiliatePartyRelationship.partyIdTo -->
<if>
<condition><if-compare field-name="affiliatePartyRelationship.roleTypeIdTo" operator="equals" value="AFFILIATE"/></condition>
<condition><if-compare field="affiliatePartyRelationship.roleTypeIdTo" operator="equals" value="AFFILIATE"/></condition>
<then>
<!-- calculate a simple commission with a base amount + a percentage of the payment -->
<calculate field-name="commissionAmount" type="Double">
@@ -52,7 +52,7 @@ under the License.
</then>
<else-if>
<!-- NOTE: this is just an example of another type of commission partner associated with a customer, doesn't really exist -->
<condition><if-compare field-name="affiliatePartyRelationship.roleTypeIdTo" operator="equals" value="TIERED_COMMISSION"/></condition>
<condition><if-compare field="affiliatePartyRelationship.roleTypeIdTo" operator="equals" value="TIERED_COMMISSION"/></condition>
<then></then>
</else-if>
</if>
@@ -37,7 +37,7 @@ under the License.
</simple-method>
<simple-method method-name="updateAcctgTrans" short-description="Update an AcctgTrans">
<entity-one entity-name="AcctgTrans" value-name="lookedUpValue"/>
<if-compare field-name="lookedUpValue.isPosted" operator="equals" value="Y">
<if-compare field="lookedUpValue.isPosted" operator="equals" value="Y">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingTransactionHasBeenAlreadyPosted"/></add-error>
<check-errors/>
</if-compare>
@@ -49,7 +49,7 @@ under the License.
</simple-method>
<simple-method method-name="deleteAcctgTrans" short-description="Delete an AcctgTrans">
<entity-one entity-name="AcctgTrans" value-name="lookedUpValue"/>
<if-compare field-name="lookedUpValue.isPosted" operator="equals" value="Y">
<if-compare field="lookedUpValue.isPosted" operator="equals" value="Y">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingTransactionHasBeenAlreadyPosted"/></add-error>
<check-errors/>
</if-compare>
@@ -68,7 +68,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<entity-one entity-name="AcctgTrans" value-name="acctgTrans"/>
<if-compare field-name="acctgTrans.isPosted" operator="equals" value="Y">
<if-compare field="acctgTrans.isPosted" operator="equals" value="Y">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingTransactionHasBeenAlreadyPosted"/></add-error>
<check-errors/>
</if-compare>
@@ -80,18 +80,18 @@ under the License.
<call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
<result-to-field result-name="partyAccountingPreference" field-name="partyAcctgPreference"/>
</call-service>
<if-empty field-name="parameters.currencyUomId">
<if-empty field="parameters.currencyUomId">
<set from-field="partyAcctgPreference.baseCurrencyUomId" field="newEntity.currencyUomId"/>
</if-empty>
<!-- if the amount field is empty, then determine it from the origAmount and origCurrencyUomId fields:
if origCurrencyUomId is different from the base currency of the organization, then the amount value will be converted -->
<if-empty field-name="newEntity.amount">
<if-not-empty field-name="newEntity.origAmount">
<if-empty field-name="newEntity.origCurrencyUomId">
<if-empty field="newEntity.amount">
<if-not-empty field="newEntity.origAmount">
<if-empty field="newEntity.origCurrencyUomId">
<set field="newEntity.origCurrencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/>
</if-empty>
<if-compare-field field-name="newEntity.origCurrencyUomId" operator="not-equals" to-field-name="newEntity.currencyUomId">
<if-compare-field field="newEntity.origCurrencyUomId" to-field="newEntity.currencyUomId" operator="not-equals">
<clear-field field-name="convertUomInMap"/>
<set field="convertUomInMap.originalValue" from-field="newEntity.origAmount" type="Double"/>
<set field="convertUomInMap.uomId" from-field="newEntity.origCurrencyUomId"/>
@@ -107,7 +107,7 @@ under the License.
</if-not-empty>
</if-empty>
<if-empty field-name="newEntity.acctgTransEntryTypeId">
<if-empty field="newEntity.acctgTransEntryTypeId">
<set field="newEntity.acctgTransEntryTypeId" value="_NA_"/>
</if-empty>
@@ -120,7 +120,7 @@ under the License.
</simple-method>
<simple-method method-name="updateAcctgTransEntry" short-description="Update Entry To AcctgTrans">
<entity-one entity-name="AcctgTrans" value-name="acctgTrans"/>
<if-compare field-name="acctgTrans.isPosted" operator="equals" value="Y">
<if-compare field="acctgTrans.isPosted" operator="equals" value="Y">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingTransactionHasBeenAlreadyPosted"/></add-error>
<check-errors/>
</if-compare>
@@ -133,7 +133,7 @@ under the License.
</simple-method>
<simple-method method-name="deleteAcctgTransEntry" short-description="Remove Entry From AcctgTrans">
<entity-one entity-name="AcctgTrans" value-name="acctgTrans"/>
<if-compare field-name="acctgTrans.isPosted" operator="equals" value="Y">
<if-compare field="acctgTrans.isPosted" operator="equals" value="Y">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingTransactionHasBeenAlreadyPosted"/></add-error>
<check-errors/>
</if-compare>
@@ -159,7 +159,7 @@ under the License.
<calculate field-name="debitTotal" type="BigDecimal"><number value="0"/></calculate>
<calculate field-name="creditTotal" type="BigDecimal"><number value="0"/></calculate>
<iterate entry-name="acctgTransEntry" list-name="acctgTransEntryList">
<if-compare field-name="debitCreditFlag" map-name="acctgTransEntry" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<calculate field-name="debitTotal" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
<calcop operator="add">
<calcop operator="get" field-name="debitTotal"/>
@@ -167,7 +167,7 @@ under the License.
</calcop>
</calculate>
<else>
<if-compare field-name="debitCreditFlag" map-name="acctgTransEntry" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<calculate field-name="creditTotal" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
<calcop operator="add">
<calcop operator="get" field-name="creditTotal"/>
@@ -201,7 +201,7 @@ under the License.
<simple-method method-name="postAcctgTrans" short-description="Post a AcctgTrans">
<!-- make sure the AcctgTrans has not already been posted -->
<entity-one entity-name="AcctgTrans" value-name="acctgTrans" auto-field-map="true"/>
<if-compare field-name="acctgTrans.isPosted" operator="equals" value="Y">
<if-compare field="acctgTrans.isPosted" operator="equals" value="Y">
<add-error><fail-message message="AcctgTrans [${parameters.acctgTransId}] has already been posted. Not posting again"/></add-error>
</if-compare>
<check-errors/>
@@ -211,10 +211,10 @@ under the License.
<call-service service-name="calculateAcctgTransTrialBalance" in-map-name="trialBalanceCallMap">
<results-to-map map-name="trialBalanceResultMap"/>
</call-service>
<if-compare field-name="trialBalanceResultMap.debitCreditDifference" operator="greater-equals" value="0.01" type="Double">
<if-compare field="trialBalanceResultMap.debitCreditDifference" operator="greater-equals" value="0.01" type="Double">
<add-error><fail-message message="Not posting GL Accounting Transaction with ID [${parameters.acctgTransId}] because the trial balance failed: Debit Total=${trialBalanceResultMap.debitTotal} Credit Total=${trialBalanceResultMap.creditTotal} Debit/Credit Difference=${trialBalanceResultMap.debitCreditDifference}"/></add-error>
</if-compare>
<if-compare field-name="trialBalanceResultMap.debitCreditDifference" operator="less-equals" value="-0.01" type="Double">
<if-compare field="trialBalanceResultMap.debitCreditDifference" operator="less-equals" value="-0.01" type="Double">
<add-error><fail-message message="Not posting GL Accounting Transaction with ID [${parameters.acctgTransId}] because the trial balance failed: Debit Total=${trialBalanceResultMap.debitTotal} Credit Total=${trialBalanceResultMap.creditTotal} Debit/Credit Difference=${trialBalanceResultMap.debitCreditDifference}"/></add-error>
</if-compare>
@@ -224,10 +224,10 @@ under the License.
</entity-condition>
<!-- check the scheduled posting date, but only if it's set -->
<if-not-empty field-name="acctgTrans.scheduledPostingDate">
<if-not-empty field="acctgTrans.scheduledPostingDate">
<set field="scheduledPostingDate" from-field="acctgTrans.scheduledPostingDate"/>
<set field="beforeScheduled" value="${bsh: org.ofbiz.base.util.UtilDateTime.nowTimestamp().before(scheduledPostingDate)}"/>
<if-compare field-name="beforeScheduled" operator="equals" value="true" type="Boolean">
<if-compare field="beforeScheduled" operator="equals" value="true" type="Boolean">
<add-error><fail-message message="Not posting GL Accounting Transaction with ID [${parameters.acctgTransId}] because it's not scheduled to be posted yet. The scheduled posting date is [${acctgTrans.scheduledPostingDate}]"/></add-error>
</if-compare>
</if-not-empty>
@@ -243,7 +243,7 @@ under the License.
<!-- also check if the glAccountId, amount, currencyUomId fields are all set -->
<iterate entry-name="acctgTransEntry" list-name="acctgTransEntryList">
<!-- we want to do this for each organizationPartyId, so only do this if we haven't already found the list for the current org -->
<if-empty field-name="customTimePeriodListByOrganizationPartyIdMap.${acctgTransEntry.organizationPartyId}">
<if-empty field="customTimePeriodListByOrganizationPartyIdMap.${acctgTransEntry.organizationPartyId}">
<clear-field field-name="findCustomTimePeriodCallMap"/>
<clear-field field-name="customTimePeriodList"/>
@@ -256,12 +256,12 @@ under the License.
<result-to-field result-name="customTimePeriodList"/>
</call-service>
<if-empty field-name="customTimePeriodList">
<if-empty field="customTimePeriodList">
<add-error><fail-message message="Could not find a CustomTimePeriod (fiscal period) for the Transaction Date [${acctgTrans.transactionDate}] (is for Organization Party with ID [${acctgTransEntry.organizationPartyId}])"/></add-error>
</if-empty>
<!-- now do the actual isClose check -->
<iterate entry-name="customTimePeriod" list-name="customTimePeriodList">
<if-compare field-name="customTimePeriod.isClosed" operator="equals" value="Y">
<if-compare field="customTimePeriod.isClosed" operator="equals" value="Y">
<add-error><fail-message message="CustomTimePeriod (fiscal period) [${customTimePeriod.customTimePeriodId}] is CLOSED, cannot post to it (is for the Transaction Date [${acctgTrans.transactionDate}] and Organization Party with ID [${acctgTransEntry.organizationPartyId}])"/></add-error>
</if-compare>
</iterate>
@@ -269,14 +269,14 @@ under the License.
<!-- save this customTimePeriodList for the current entry for later use -->
<set from-field="customTimePeriodList" field="customTimePeriodListByOrganizationPartyIdMap.${acctgTransEntry.organizationPartyId}"/>
</if-empty>
<if-empty field-name="acctgTransEntry.glAccountId">
<if-empty field="acctgTransEntry.glAccountId">
<add-error><fail-message message="Gl account id is not set for [${acctgTransEntry.acctgTransEntrySeqId}] or mapping not found for account type ${acctgTransEntry.glAccountTypeId}"/></add-error>
</if-empty>
<if-empty field-name="acctgTransEntry.amount">
<if-empty field="acctgTransEntry.amount">
<add-error><fail-message message="Amount not set for [${acctgTransEntry.acctgTransEntrySeqId}] or failed to convert the original amount ${acctgTransEntry.origAmount} with currency ${acctgTransEntry.origCurrencyUomId}"/></add-error>
</if-empty>
<!--
<if-empty field-name="acctgTransEntry.currencyUomId">
<if-empty field="acctgTransEntry.currencyUomId">
<add-error><fail-message message="Currency is not set for [${acctgTransEntry.acctgTransEntrySeqId}]"/></add-error>
</if-empty>
-->
@@ -284,20 +284,20 @@ under the License.
<!-- DONE with initial tests/checks, see if we are good to go or not... -->
<if-compare field-name="parameters.verifyOnly" operator="equals" value="Y">
<if-not-empty field-name="error_list">
<if-compare field="parameters.verifyOnly" operator="equals" value="Y">
<if-not-empty field="error_list">
<field-to-result field-name="error_list" result-name="successMessageList"/>
</if-not-empty>
<return/>
<else>
<!-- if there are errors and we have an error journal assign to the journal and return -->
<if-not-empty field-name="error_list">
<if-not-empty field="error_list">
<iterate list-name="acctgTransEntryList" entry-name="acctgTransEntry">
<set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="acctgTransEntry.organizationPartyId"/>
<call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
<result-to-field result-name="partyAccountingPreference" field-name="partyAcctgPreference"/>
</call-service>
<if-empty field-name="partyAcctgPreference.errorGlJournalId">
<if-empty field="partyAcctgPreference.errorGlJournalId">
<!-- if no error journal is set, then return the error messages -->
<check-errors/>
<else>
@@ -336,11 +336,11 @@ under the License.
<get-related-one relation-name="ParentGlAccountClass" value-name="glAccountClass" to-value-name="parentGlAccountClass"/>
<!-- test if the account is a DEBIT account -->
<set field="isDebit" value="${bsh:org.ofbiz.accounting.util.UtilAccounting.isDebitAccount(glAccount)}"/>
<if-compare field-name="isDebit" operator="equals" value="true">
<if-compare field-name="debitCreditFlag" map-name="acctgTransEntry" operator="equals" value="D">
<if-compare field="isDebit" operator="equals" value="true">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<set from-field="acctgTransEntry.amount" field="postingAmount"/>
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<calculate field-name="postingAmount" type="BigDecimal">
<calcop field-name="acctgTransEntry.amount" operator="negative"/>
</calculate>
@@ -350,11 +350,11 @@ under the License.
<else>
<!-- otherwise, test if the account is credit -->
<set field="isCredit" value="${bsh:org.ofbiz.accounting.util.UtilAccounting.isCreditAccount(glAccount)}"/>
<if-compare field-name="isCredit" operator="equals" value="true">
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="isCredit" operator="equals" value="true">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<set from-field="acctgTransEntry.amount" field="postingAmount"/>
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<calculate field-name="postingAmount" type="BigDecimal">
<calcop field-name="acctgTransEntry.amount" operator="negative"/>
</calculate>
@@ -390,7 +390,7 @@ under the License.
<field-map field-name="customTimePeriodId" env-name="customTimePeriod.customTimePeriodId"/>
</entity-one>
<!-- if no glAccountHistory create a new empty one -->
<if-empty field-name="glAccountHistory">
<if-empty field="glAccountHistory">
<make-value value-name="glAccountHistory" entity-name="GlAccountHistory"/>
<set from-field="acctgTransEntry.glAccountId" field="glAccountHistory.glAccountId"/>
<set from-field="acctgTransEntry.organizationPartyId" field="glAccountHistory.organizationPartyId"/>
@@ -401,7 +401,7 @@ under the License.
</if-empty>
<!-- update GlAccountHistory's debit and credit totals -->
<if-compare field-name="debitCreditFlag" map-name="acctgTransEntry" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<calculate field-name="postedDebits" map-name="glAccountHistory" type="BigDecimal">
<calcop operator="add">
<calcop operator="get" field-name="amount" map-name="acctgTransEntry"/>
@@ -409,7 +409,7 @@ under the License.
</calcop>
</calculate>
<else>
<if-compare field-name="debitCreditFlag" map-name="acctgTransEntry" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<calculate field-name="postedCredits" map-name="glAccountHistory" type="BigDecimal">
<calcop operator="add">
<calcop operator="get" field-name="amount" map-name="acctgTransEntry"/>
@@ -27,7 +27,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<!-- GlAccount uses a sequenced id, so get the next one now and set it... -->
<if-empty field-name="parameters.glAccountId">
<if-empty field="parameters.glAccountId">
<sequenced-id-to-env sequence-name="GlAccount" env-name="newEntity.glAccountId"/>
<else>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
@@ -171,7 +171,7 @@ under the License.
<results-to-map map-name="trialBalanceResultMap"/>
</call-service>
<if-compare field-name="trialBalanceResultMap.debitCreditDifference" operator="not-equals" value="0" type="Double">
<if-compare field="trialBalanceResultMap.debitCreditDifference" operator="not-equals" value="0" type="Double">
<add-error><fail-message message="Not posting GL Journal with ID [${parameters.glJournalId}] because the trial balance failed: Debit Total=${trialBalanceResultMap.debitTotal} Credit Total=${trialBalanceResultMap.creditTotal} Debit/Credit Difference=${trialBalanceResultMap.debitCreditDifference}"/></add-error>
<check-errors/>
</if-compare>
@@ -226,7 +226,7 @@ under the License.
<simple-method method-name="createGlReconciliationEntry" short-description="Add Entry To GlReconciliation">
<!-- first of all, make sure that the AcctgTransEntry is not already reconciled -->
<entity-one entity-name="AcctgTransEntry" value-name="acctgTransEntry"/>
<if-compare field-name="acctgTransEntry.reconcileStatusId" operator="equals" value="AES_RECONCILED">
<if-compare field="acctgTransEntry.reconcileStatusId" operator="equals" value="AES_RECONCILED">
<add-error><fail-message message="The accounting transaction entry ${acctgTransEntry.acctgTransId}/${acctgTransEntry.acctgTransEntrySeqId} is already reconciled: cannot reconcile."/></add-error>
<check-errors/>
</if-compare>
@@ -265,7 +265,7 @@ under the License.
<!-- ========== GL Posting Services ========== -->
<simple-method method-name="completeAcctgTransEntries" short-description="Completes, if possible, the AcctgTransEntries using the mappings defined in the gl setup">
<entity-one entity-name="AcctgTrans" value-name="acctgTrans"/>
<if-compare field-name="acctgTrans.isPosted" operator="equals" value="Y">
<if-compare field="acctgTrans.isPosted" operator="equals" value="Y">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingTransactionHasBeenAlreadyPosted"/></add-error>
<check-errors/>
</if-compare>
@@ -273,7 +273,7 @@ under the License.
<iterate list-name="acctgTransEntries" entry-name="acctgTransEntry">
<!-- if the glAccountId is empty, but we have a glAccountTypeId, then we will determine the
correct glAccountId from the gl setup settings -->
<if-empty field-name="acctgTransEntry.glAccountId">
<if-empty field="acctgTransEntry.glAccountId">
<clear-field field-name="getGlAccountFromAccountTypeInMap"/>
<set field="getGlAccountFromAccountTypeInMap.organizationPartyId" from-field="acctgTransEntry.organizationPartyId"/>
<set field="getGlAccountFromAccountTypeInMap.acctgTransTypeId" from-field="acctgTrans.acctgTransTypeId"/>
@@ -288,13 +288,13 @@ under the License.
<result-to-field result-name="glAccountId" field-name="acctgTransEntry.glAccountId"/>
</call-service>
</if-empty>
<if-empty field-name="acctgTransEntry.origAmount">
<if-empty field="acctgTransEntry.origAmount">
<set field="acctgTransEntry.origAmount" from-field="acctgTransEntry.amount"/>
</if-empty>
<entity-one entity-name="GlAccountType" value-name="glAccountType" use-cache="true" auto-field-map="false">
<field-map field-name="glAccountTypeId" env-name="acctgTransEntry.glAccountTypeId"/>
</entity-one>
<if-empty field-name="glAccountType">
<if-empty field="glAccountType">
<clear-field field-name="acctgTransEntry.glAccountTypeId"/>
</if-empty>
<store-value value-name="acctgTransEntry"/>
@@ -313,25 +313,25 @@ under the License.
<field-map field-name="partyId" env-name="acctgTransEntry.organizationPartyId"/>
<field-map field-name="roleTypeId" value="INTERNAL_ORGANIZATIO"/>
</entity-one>
<if-empty field-name="partyRole">
<if-empty field="partyRole">
<log level="warning" message="The party with id [${acctgTransEntry.organizationPartyId}] is not an internal organization; the following accounting transaction will be ignored: ${acctgTransEntry}"/>
<else>
<set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="acctgTransEntry.organizationPartyId"/>
<call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
<result-to-field result-name="partyAccountingPreference" field-name="partyAcctgPreference"/>
</call-service>
<if-empty field-name="partyAcctgPreference">
<if-empty field="partyAcctgPreference">
<log level="warning" message="The internal organization with id [${acctgTransEntry.organizationPartyId}] has no PartyAcctgPreference setting; the following accounting transaction will be ignored: ${acctgTransEntry}"/>
<else>
<!-- if the amount field is empty, then determine it from the origAmount and origCurrencyUomId fields:
if origCurrencyUomId is different from the base currency of the organization, then the amount value will be converted -->
<if-empty field-name="acctgTransEntry.amount">
<if-not-empty field-name="acctgTransEntry.origAmount">
<if-empty field-name="acctgTransEntry.origCurrencyUomId">
<if-empty field="acctgTransEntry.amount">
<if-not-empty field="acctgTransEntry.origAmount">
<if-empty field="acctgTransEntry.origCurrencyUomId">
<set field="acctgTransEntry.origCurrencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/>
</if-empty>
<set field="acctgTransEntry.currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/>
<if-compare-field field-name="acctgTransEntry.origCurrencyUomId" operator="not-equals" to-field-name="acctgTransEntry.currencyUomId">
<if-compare-field field="acctgTransEntry.origCurrencyUomId" to-field="acctgTransEntry.currencyUomId" operator="not-equals">
<clear-field field-name="convertUomInMap"/>
<set field="convertUomInMap.originalValue" from-field="acctgTransEntry.origAmount" type="Double"/>
<set field="convertUomInMap.uomId" from-field="acctgTransEntry.origCurrencyUomId"/>
@@ -348,7 +348,7 @@ under the License.
</if-empty>
<!-- if the glAccountId is empty, but we have a glAccountTypeId, then we will determine the
correct glAccountId from the gl setup settings -->
<if-empty field-name="acctgTransEntry.glAccountId">
<if-empty field="acctgTransEntry.glAccountId">
<clear-field field-name="getGlAccountFromAccountTypeInMap"/>
<set field="getGlAccountFromAccountTypeInMap.organizationPartyId" from-field="acctgTransEntry.organizationPartyId"/>
<set field="getGlAccountFromAccountTypeInMap.acctgTransTypeId" from-field="parameters.acctgTransTypeId"/>
@@ -363,13 +363,13 @@ under the License.
<result-to-field result-name="glAccountId" field-name="acctgTransEntry.glAccountId"/>
</call-service>
</if-empty>
<if-empty field-name="acctgTransEntry.origAmount">
<if-empty field="acctgTransEntry.origAmount">
<set field="acctgTransEntry.origAmount" from-field="acctgTransEntry.amount"/>
</if-empty>
<entity-one entity-name="GlAccountType" value-name="glAccountType" use-cache="true" auto-field-map="false">
<field-map field-name="glAccountTypeId" env-name="acctgTransEntry.glAccountTypeId"/>
</entity-one>
<if-empty field-name="glAccountType">
<if-empty field="glAccountType">
<clear-field field-name="acctgTransEntry.glAccountTypeId"/>
</if-empty>
<set field="normalizedAcctgTransEntries[]" from-field="acctgTransEntry"/>
@@ -379,10 +379,10 @@ under the License.
</if-empty>
</iterate>
<if-not-empty field-name="normalizedAcctgTransEntries">
<if-not-empty field="normalizedAcctgTransEntries">
<!-- now do the posting. First, create the AcctgTrans entity -->
<set-service-fields service-name="createAcctgTrans" map-name="parameters" to-map-name="createAcctgTransParams"/>
<if-empty field-name="createAcctgTransParams.transactionDate">
<if-empty field="createAcctgTransParams.transactionDate">
<now-timestamp-to-env env-name="createAcctgTransParams.transactionDate"/>
</if-empty>
<call-service service-name="createAcctgTrans" in-map-name="createAcctgTransParams">
@@ -392,7 +392,7 @@ under the License.
<!-- Next, create the AcctgTransEntry entities one by one -->
<iterate list-name="normalizedAcctgTransEntries" entry-name="acctgTransEntry">
<!-- if any amount is negative, then get the absolute (positive) value of that amount, and flip the Debit/Credit flag -->
<if-compare field-name="acctgTransEntry.origAmount" operator="less" value="0">
<if-compare field="acctgTransEntry.origAmount" operator="less" value="0">
<log level="verbose" message="${acctgTransEntry} is going to get inverted"/>
<calculate field-name="acctgTransEntry.origAmount">
<calcop field-name="acctgTransEntry.origAmount" operator="negative"/>
@@ -400,10 +400,10 @@ under the License.
<calculate field-name="acctgTransEntry.amount">
<calcop field-name="acctgTransEntry.amount" operator="negative"/>
</calculate>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<set value="C" field="acctgTransEntry.debitCreditFlag"/>
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<set value="D" field="acctgTransEntry.debitCreditFlag"/>
</if-compare>
</else>
@@ -429,9 +429,9 @@ under the License.
<simple-method method-name="getGlAccountFromAccountType" short-description="Look up a GlAccountId from GlAccountTypeId">
<!-- if this is an inventory variance then the glAccountTypeId contains the varianceReasonId; the value is used to lookup the account id in the VarianceReasonGlAccount entity -->
<if-compare field-name="parameters.acctgTransTypeId" operator="equals" value="ITEM_VARIANCE">
<if-compare field="parameters.acctgTransTypeId" operator="equals" value="ITEM_VARIANCE">
<call-simple-method method-name="getVarianceReasonGlAccountInline"/>
<if-not-empty field-name="varianceReasonGlAccount.glAccountId">
<if-not-empty field="varianceReasonGlAccount.glAccountId">
<field-to-result field-name="varianceReasonGlAccount.glAccountId" result-name="glAccountId"/>
<return/>
</if-not-empty>
@@ -440,14 +440,14 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="parameters.glAccountTypeId"/></not>
<not><if-empty field-name="parameters.partyId"/></not>
<not><if-empty field-name="parameters.roleTypeId"/></not>
<not><if-empty field="parameters.glAccountTypeId"/></not>
<not><if-empty field="parameters.partyId"/></not>
<not><if-empty field="parameters.roleTypeId"/></not>
</and>
</condition>
<then>
<call-simple-method method-name="getPartyGlAccountInline"/>
<if-not-empty field-name="partyGlAccount.glAccountId">
<if-not-empty field="partyGlAccount.glAccountId">
<field-to-result field-name="partyGlAccount.glAccountId" result-name="glAccountId"/>
<return/>
</if-not-empty>
@@ -458,51 +458,51 @@ under the License.
<and>
<or>
<and>
<if-compare field-name="parameters.acctgTransTypeId" operator="equals" value="OUTGOING_PAYMENT"/>
<if-compare field-name="parameters.debitCreditFlag" operator="equals" value="C"/>
<if-compare field="parameters.acctgTransTypeId" operator="equals" value="OUTGOING_PAYMENT"/>
<if-compare field="parameters.debitCreditFlag" operator="equals" value="C"/>
</and>
<and>
<if-compare field-name="parameters.acctgTransTypeId" operator="equals" value="INCOMING_PAYMENT"/>
<if-compare field-name="parameters.debitCreditFlag" operator="equals" value="D"/>
<if-compare field="parameters.acctgTransTypeId" operator="equals" value="INCOMING_PAYMENT"/>
<if-compare field="parameters.debitCreditFlag" operator="equals" value="D"/>
</and>
</or>
<not><if-empty field-name="parameters.paymentId"/></not>
<not><if-empty field="parameters.paymentId"/></not>
</and>
</condition>
<then>
<entity-one entity-name="Payment" value-name="payment"/>
<get-related-one value-name="payment" relation-name="PaymentMethod" to-value-name="paymentMethod"/>
<if-not-empty field-name="paymentMethod.glAccountId">
<if-not-empty field="paymentMethod.glAccountId">
<field-to-result field-name="paymentMethod.glAccountId" result-name="glAccountId"/>
<return/>
</if-not-empty>
<if-compare field-name="payment.paymentMethodTypeId" operator="equals" value="CREDIT_CARD">
<if-compare field="payment.paymentMethodTypeId" operator="equals" value="CREDIT_CARD">
<get-related-one value-name="payment" relation-name="CreditCard" to-value-name="creditCard"/>
<call-simple-method method-name="getCreditCardTypeGlAccountInline"/>
<if-not-empty field-name="creditCardTypeGlAccount.glAccountId">
<if-not-empty field="creditCardTypeGlAccount.glAccountId">
<field-to-result field-name="creditCardTypeGlAccount.glAccountId" result-name="glAccountId"/>
<return/>
</if-not-empty>
</if-compare>
<call-simple-method method-name="getPaymentMethodTypeGlAccountInline"/>
<if-not-empty field-name="paymentMethodTypeGlAccount.glAccountId">
<if-not-empty field="paymentMethodTypeGlAccount.glAccountId">
<field-to-result field-name="paymentMethodTypeGlAccount.glAccountId" result-name="glAccountId"/>
<return/>
</if-not-empty>
<return/>
</then>
</if>
<if-not-empty field-name="parameters.productId">
<if-not-empty field="parameters.productId">
<call-simple-method method-name="getProductGlAccountInline"/>
<!-- if nothing found look if the parameters.productId is member of any ProductCategory in ProductCategoryGlAccount -->
<if-empty field-name="productGlAccount.glAccountId">
<if-empty field="productGlAccount.glAccountId">
<entity-and entity-name="ProductCategoryMember" list-name="productCategoryMembers" filter-by-date="true">
<field-map field-name="productId" env-name="parameters.productId"/>
<order-by field-name="-fromDate"/>
</entity-and>
<iterate list-name="productCategoryMembers" entry-name="productCategoryMember">
<call-simple-method method-name="getProductCategoryGlAccountInline"/>
<if-not-empty field-name="productCategoryGlAccount.glAccountId">
<if-not-empty field="productCategoryGlAccount.glAccountId">
<field-to-result field-name="productCategoryGlAccount.glAccountId" result-name="glAccountId"/>
<return/>
</if-not-empty>
@@ -518,22 +518,22 @@ under the License.
<and>
<or>
<and>
<if-compare field-name="parameters.acctgTransTypeId" operator="equals" value="PURCHASE_INVOICE"/>
<if-compare field-name="parameters.debitCreditFlag" operator="equals" value="D"/>
<if-compare field="parameters.acctgTransTypeId" operator="equals" value="PURCHASE_INVOICE"/>
<if-compare field="parameters.debitCreditFlag" operator="equals" value="D"/>
</and>
<and>
<if-compare field-name="parameters.acctgTransTypeId" operator="equals" value="SALES_INVOICE"/>
<if-compare field-name="parameters.debitCreditFlag" operator="equals" value="C"/>
<if-compare field="parameters.acctgTransTypeId" operator="equals" value="SALES_INVOICE"/>
<if-compare field="parameters.debitCreditFlag" operator="equals" value="C"/>
</and>
</or>
<not><if-empty field-name="parameters.invoiceId"/></not>
<not><if-empty field-name="parameters.glAccountTypeId"/></not>
<not><if-empty field="parameters.invoiceId"/></not>
<not><if-empty field="parameters.glAccountTypeId"/></not>
</and>
</condition>
<then>
<if-not-empty field-name="parameters.productId">
<if-compare field-name="parameters.acctgTransTypeId" operator="equals" value="PURCHASE_INVOICE">
<if-not-empty field="parameters.productId">
<if-compare field="parameters.acctgTransTypeId" operator="equals" value="PURCHASE_INVOICE">
<set field="parameters.glAccountTypeId" value="UNINVOICED_SHIP_RCPT"/>
<call-simple-method method-name="getGlAccountTypeDefaultInline"/>
<set field="glAccountTypeDefault" from-field="lookedUpValue"/>
@@ -543,20 +543,20 @@ under the License.
<set field="glAccountTypeDefault" from-field="lookedUpValue"/>
</else>
</if-compare>
<if-not-empty field-name="glAccountTypeDefault.glAccountId">
<if-not-empty field="glAccountTypeDefault.glAccountId">
<field-to-result field-name="glAccountTypeDefault.glAccountId" result-name="glAccountId"/>
<return/>
</if-not-empty>
</if-not-empty>
<call-simple-method method-name="getInvoiceItemTypeGlAccountInline"/>
<if-not-empty field-name="invoiceItemTypeGlAccount.glAccountId">
<if-not-empty field="invoiceItemTypeGlAccount.glAccountId">
<field-to-result field-name="invoiceItemTypeGlAccount.glAccountId" result-name="glAccountId"/>
<return/>
</if-not-empty>
<entity-one entity-name="InvoiceItemType" value-name="invoiceItemType">
<field-map field-name="invoiceItemTypeId" env-name="parameters.glAccountTypeId"/>
</entity-one>
<if-not-empty field-name="invoiceItemType.defaultGlAccountId">
<if-not-empty field="invoiceItemType.defaultGlAccountId">
<field-to-result field-name="invoiceItemType.defaultGlAccountId" result-name="glAccountId"/>
<return/>
</if-not-empty>
@@ -564,7 +564,7 @@ under the License.
</then>
</if>
<!-- if nothing found or if no such parameters were passed (lookedUpValue empty in both cases), try GlAccountTypeDefault -->
<if-empty field-name="lookedUpValue.glAccountId">
<if-empty field="lookedUpValue.glAccountId">
<call-simple-method method-name="getGlAccountTypeDefaultInline"/>
</if-empty>
<field-to-result field-name="lookedUpValue.glAccountId" result-name="glAccountId"/>
@@ -572,7 +572,7 @@ under the License.
<simple-method method-name="getInventoryItemOwner" short-description="Get an ownerPartyId from inventoryItemId">
<entity-one entity-name="InventoryItem" value-name="inventoryItem"/>
<if-empty field-name="inventoryItem.ownerPartyId">
<if-empty field="inventoryItem.ownerPartyId">
<get-related-one value-name="inventoryItem" relation-name="Facility" to-value-name="facility"/>
<field-to-result field-name="facility.ownerPartyId" result-name="ownerPartyId"/>
<else>
@@ -596,7 +596,7 @@ under the License.
<result-to-field result-name="lastClosedDate"/>
<result-to-field result-name="lastClosedTimePeriod"/>
</call-service>
<if-empty field-name="lastClosedDate">
<if-empty field="lastClosedDate">
<add-error><fail-message message="Unable to find a last closed date for time period [${customTimePeriod.customTimePeriodId}] of type [${customTimePeriod.customTimePeriodId}] for organization [${customTimePeriod.organizationPartyId}]"/></add-error>
</if-empty>
<check-errors/>
@@ -672,12 +672,12 @@ under the License.
<condition>
<or>
<and>
<if-compare field-name="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D"/>
<if-compare field-name="isCreditAccount" operator="equals" value="true" type="Boolean"/>
<if-compare field="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D"/>
<if-compare field="isCreditAccount" operator="equals" value="true" type="Boolean"/>
</and>
<and>
<if-compare field-name="acctgTransAndEntry.debitCreditFlag" operator="equals" value="C"/>
<if-compare field-name="isDebitAccount" operator="equals" value="true" type="Boolean"/>
<if-compare field="acctgTransAndEntry.debitCreditFlag" operator="equals" value="C"/>
<if-compare field="isDebitAccount" operator="equals" value="true" type="Boolean"/>
</and>
</or>
</condition>
@@ -687,7 +687,7 @@ under the License.
</calculate>
</then>
</if>
<if-compare field-name="isExpenseAccount" operator="equals" value="true" type="Boolean">
<if-compare field="isExpenseAccount" operator="equals" value="true" type="Boolean">
<calculate field-name="amount">
<calcop field-name="amount" operator="negative"/>
</calculate>
@@ -710,12 +710,12 @@ under the License.
<field-map field-name="customTimePeriodId" env-name="customTimePeriod.customTimePeriodId"/>
<field-map field-name="glAccountId" env-name="profitLossAccount.glAccountId"/>
</entity-one>
<if-not-empty field-name="profitLossAccountHistory">
<if-not-empty field="profitLossAccountHistory">
<!-- already posted: verify if numbers match -->
<call-class-method class-name="org.ofbiz.accounting.util.UtilAccounting" method-name="getNetBalance" ret-field-name="postedBalance">
<field field-name="profitLossAccountHistory" type="GenericValue"/>
</call-class-method>
<if-compare-field field-name="postedBalance" operator="not-equals" to-field-name="totalAmount" type="Double">
<if-compare-field field="postedBalance" to-field="totalAmount" operator="not-equals" type="Double">
<add-error><fail-message message="There is already a posted balance [${postedBalance}] that doesn't match with the current one [${totalAmount}]."/></add-error>
</if-compare-field>
<check-errors/>
@@ -756,7 +756,7 @@ under the License.
<set field="glAccountHistory.endingBalance" from-field="endingBalance" type="Double"/>
<store-value value-name="glAccountHistory"/>
</iterate>
<if-not-empty field-name="lastClosedTimePeriod">
<if-not-empty field="lastClosedTimePeriod">
<entity-condition entity-name="GlAccountAndHistory" list-name="lastPeriodGlAccountAndHistories">
<condition-list combine="and">
<condition-expr field-name="organizationPartyId" operator="equals" env-name="customTimePeriod.organizationPartyId"/>
@@ -776,7 +776,7 @@ under the License.
<field-map field-name="customTimePeriodId" env-name="customTimePeriod.customTimePeriodId"/>
<field-map field-name="glAccountId" env-name="lastPeriodGlAccountHistory.glAccountId"/>
</entity-one>
<if-empty field-name="thisPeriodGlAccountHistory">
<if-empty field="thisPeriodGlAccountHistory">
<make-value entity-name="GlAccountHistory" value-name="thisPeriodGlAccountHistory"/>
<set field="thisPeriodGlAccountHistory.customTimePeriodId" from-field="customTimePeriod.customTimePeriodId"/>
<set field="thisPeriodGlAccountHistory.organizationPartyId" from-field="customTimePeriod.organizationPartyId"/>
@@ -840,12 +840,12 @@ under the License.
<condition>
<or>
<and>
<if-compare field-name="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D"/>
<if-compare field-name="isCreditAccount" operator="equals" value="true" type="Boolean"/>
<if-compare field="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D"/>
<if-compare field="isCreditAccount" operator="equals" value="true" type="Boolean"/>
</and>
<and>
<if-compare field-name="acctgTransAndEntry.debitCreditFlag" operator="equals" value="C"/>
<if-compare field-name="isDebitAccount" operator="equals" value="true" type="Boolean"/>
<if-compare field="acctgTransAndEntry.debitCreditFlag" operator="equals" value="C"/>
<if-compare field="isDebitAccount" operator="equals" value="true" type="Boolean"/>
</and>
</or>
</condition>
@@ -855,7 +855,7 @@ under the License.
</calculate>
</then>
</if>
<if-compare field-name="isExpenseAccount" operator="equals" value="true" type="Boolean">
<if-compare field="isExpenseAccount" operator="equals" value="true" type="Boolean">
<calculate field-name="amount">
<calcop field-name="amount" operator="negative"/>
</calculate>
@@ -930,12 +930,12 @@ under the License.
<condition>
<or>
<and>
<if-compare field-name="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D"/>
<if-compare field-name="isCreditAccount" operator="equals" value="true" type="Boolean"/>
<if-compare field="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D"/>
<if-compare field="isCreditAccount" operator="equals" value="true" type="Boolean"/>
</and>
<and>
<if-compare field-name="acctgTransAndEntry.debitCreditFlag" operator="equals" value="C"/>
<if-compare field-name="isDebitAccount" operator="equals" value="true" type="Boolean"/>
<if-compare field="acctgTransAndEntry.debitCreditFlag" operator="equals" value="C"/>
<if-compare field="isDebitAccount" operator="equals" value="true" type="Boolean"/>
</and>
</or>
</condition>
@@ -945,7 +945,7 @@ under the License.
</calculate>
</then>
</if>
<if-compare field-name="isExpenseAccount" operator="equals" value="true" type="Boolean">
<if-compare field="isExpenseAccount" operator="equals" value="true" type="Boolean">
<calculate field-name="amount">
<calcop field-name="amount" operator="negative"/>
</calculate>
@@ -953,15 +953,15 @@ under the License.
<calculate field-name="totalNetIncome" type="Double">
<calcop field-name="totalNetIncome" operator="add"><calcop field-name="amount" operator="get"/></calcop>
</calculate>
<if-compare field-name="isExpenseAccount" operator="equals" value="true" type="Boolean">
<if-empty field-name="glAccountTotalsExpenseMap.${glAccount.glAccountId}">
<if-compare field="isExpenseAccount" operator="equals" value="true" type="Boolean">
<if-empty field="glAccountTotalsExpenseMap.${glAccount.glAccountId}">
<set field="glAccountTotalsExpenseMap.${glAccount.glAccountId}" value="0.0" type="Double"/>
</if-empty>
<calculate field-name="glAccountTotalsExpenseMap.${glAccount.glAccountId}" type="Double">
<calcop field-name="glAccountTotalsExpenseMap.${glAccount.glAccountId}" operator="add"><calcop field-name="amount" operator="get"/></calcop>
</calculate>
<else>
<if-empty field-name="glAccountTotalsProfitMap.${glAccount.glAccountId}">
<if-empty field="glAccountTotalsProfitMap.${glAccount.glAccountId}">
<set field="glAccountTotalsProfitMap.${glAccount.glAccountId}" value="0.0" type="Double"/>
</if-empty>
<calculate field-name="glAccountTotalsProfitMap.${glAccount.glAccountId}" type="Double">
@@ -1015,12 +1015,12 @@ under the License.
<result-to-field result-name="lastClosedDate"/>
<result-to-field result-name="lastClosedTimePeriod"/>
</call-service>
<if-empty field-name="lastClosedDate">
<if-empty field="lastClosedDate">
<add-error><fail-message message="Unable to find a last closed date for time period for organization [${customTimePeriod.organizationPartyId}]"/></add-error>
</if-empty>
<check-errors/>
<if-not-empty field-name="lastClosedTimePeriod">
<if-not-empty field="lastClosedTimePeriod">
<entity-condition entity-name="GlAccountAndHistory" list-name="glAccountAndHistories">
<condition-list combine="and">
<condition-expr field-name="organizationPartyId" operator="equals" env-name="parameters.organizationPartyId"/>
@@ -1071,12 +1071,12 @@ under the License.
</entity-condition>
<iterate list-name="acctgTransAndEntries" entry-name="acctgTransAndEntry">
<set field="amount" from-field="acctgTransAndEntry.amount" type="Double"/>
<if-compare field-name="acctgTransAndEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransAndEntry.debitCreditFlag" operator="equals" value="C">
<calculate field-name="amount">
<calcop field-name="amount" operator="negative"/>
</calculate>
</if-compare>
<if-empty field-name="glAccountTotalsAssetMap.${acctgTransAndEntry.glAccountId}">
<if-empty field="glAccountTotalsAssetMap.${acctgTransAndEntry.glAccountId}">
<set field="glAccountTotalsAssetMap.${acctgTransAndEntry.glAccountId}" value="0.0" type="Double"/>
</if-empty>
<calculate field-name="glAccountTotalsAssetMap.${acctgTransAndEntry.glAccountId}" type="Double">
@@ -1098,12 +1098,12 @@ under the License.
</entity-condition>
<iterate list-name="acctgTransAndEntries" entry-name="acctgTransAndEntry">
<set field="amount" from-field="acctgTransAndEntry.amount" type="Double"/>
<if-compare field-name="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D">
<calculate field-name="amount">
<calcop field-name="amount" operator="negative"/>
</calculate>
</if-compare>
<if-empty field-name="glAccountTotalsLiabilityMap.${acctgTransAndEntry.glAccountId}">
<if-empty field="glAccountTotalsLiabilityMap.${acctgTransAndEntry.glAccountId}">
<set field="glAccountTotalsLiabilityMap.${acctgTransAndEntry.glAccountId}" value="0.0" type="Double"/>
</if-empty>
<calculate field-name="glAccountTotalsLiabilityMap.${acctgTransAndEntry.glAccountId}" type="Double">
@@ -1125,12 +1125,12 @@ under the License.
</entity-condition>
<iterate list-name="acctgTransAndEntries" entry-name="acctgTransAndEntry">
<set field="amount" from-field="acctgTransAndEntry.amount" type="Double"/>
<if-compare field-name="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransAndEntry.debitCreditFlag" operator="equals" value="D">
<calculate field-name="amount">
<calcop field-name="amount" operator="negative"/>
</calculate>
</if-compare>
<if-empty field-name="glAccountTotalsEquityMap.${acctgTransAndEntry.glAccountId}">
<if-empty field="glAccountTotalsEquityMap.${acctgTransAndEntry.glAccountId}">
<set field="glAccountTotalsEquityMap.${acctgTransAndEntry.glAccountId}" value="0.0" type="Double"/>
</if-empty>
<calculate field-name="glAccountTotalsEquityMap.${acctgTransAndEntry.glAccountId}" type="Double">
@@ -1151,8 +1151,8 @@ under the License.
<field-map field-name="organizationPartyId" env-name="parameters.organizationPartyId"/>
<field-map field-name="glAccountTypeId" value="RETAINED_EARNINGS"/>
</entity-one>
<if-not-empty field-name="retainedEarningsAccount">
<if-empty field-name="glAccountTotalsEquityMap.${retainedEarningsAccount.glAccountId}">
<if-not-empty field="retainedEarningsAccount">
<if-empty field="glAccountTotalsEquityMap.${retainedEarningsAccount.glAccountId}">
<set field="glAccountTotalsEquityMap.${retainedEarningsAccount.glAccountId}" value="0.0" type="Double"/>
</if-empty>
<calculate field-name="glAccountTotalsEquityMap.${retainedEarningsAccount.glAccountId}" type="Double">
@@ -1209,7 +1209,7 @@ under the License.
<calculate field-name="amount">
<calcop field-name="amount" operator="negative"/>
</calculate>
<if-empty field-name="assetBalancesMap.${period1AssetBalance.glAccountId}">
<if-empty field="assetBalancesMap.${period1AssetBalance.glAccountId}">
<set field="assetBalancesMap.${period1AssetBalance.glAccountId}" value="0.0" type="Double"/>
</if-empty>
<calculate field-name="assetBalancesMap.${period1AssetBalance.glAccountId}" type="Double">
@@ -1225,7 +1225,7 @@ under the License.
<calculate field-name="amount">
<calcop field-name="amount" operator="negative"/>
</calculate>
<if-empty field-name="liabilityBalancesMap.${period1LiabilityBalance.glAccountId}">
<if-empty field="liabilityBalancesMap.${period1LiabilityBalance.glAccountId}">
<set field="liabilityBalancesMap.${period1LiabilityBalance.glAccountId}" value="0.0" type="Double"/>
</if-empty>
<calculate field-name="liabilityBalancesMap.${period1LiabilityBalance.glAccountId}" type="Double">
@@ -1241,7 +1241,7 @@ under the License.
<calculate field-name="amount">
<calcop field-name="amount" operator="negative"/>
</calculate>
<if-empty field-name="equityBalancesMap.${period1EquityBalance.glAccountId}">
<if-empty field="equityBalancesMap.${period1EquityBalance.glAccountId}">
<set field="equityBalancesMap.${period1EquityBalance.glAccountId}" value="0.0" type="Double"/>
</if-empty>
<calculate field-name="equityBalancesMap.${period1EquityBalance.glAccountId}" type="Double">
@@ -1305,7 +1305,7 @@ under the License.
<set field="creditEntry.productId" from-field="inventoryItem.productId"/>
<set field="creditEntry.origAmount" from-field="origAmount"/>
<set field="creditEntry.origCurrencyUomId" from-field="inventoryItem.currencyUomId"/>
<if-not-empty field-name="billToCustomer">
<if-not-empty field="billToCustomer">
<set field="creditEntry.partyId" from-field="billToCustomer.partyId"/>
<set field="creditEntry.roleTypeId" from-field="billToCustomer.roleTypeId"/>
</if-not-empty>
@@ -1318,7 +1318,7 @@ under the License.
<set field="debitEntry.productId" from-field="inventoryItem.productId"/>
<set field="debitEntry.origAmount" from-field="origAmount"/>
<set field="debitEntry.origCurrencyUomId" from-field="inventoryItem.currencyUomId"/>
<if-not-empty field-name="billToCustomer">
<if-not-empty field="billToCustomer">
<set field="debitEntry.partyId" from-field="billToCustomer.partyId"/>
<set field="debitEntry.roleTypeId" from-field="billToCustomer.roleTypeId"/>
</if-not-empty>
@@ -1363,7 +1363,7 @@ under the License.
<set field="creditEntry.productId" from-field="inventoryItem.productId"/>
<set field="creditEntry.origAmount" from-field="origAmount"/>
<set field="creditEntry.origCurrencyUomId" from-field="inventoryItem.currencyUomId"/>
<if-not-empty field-name="billToCustomer">
<if-not-empty field="billToCustomer">
<set field="creditEntry.partyId" from-field="billToCustomer.partyId"/>
<set field="creditEntry.roleTypeId" from-field="billToCustomer.roleTypeId"/>
</if-not-empty>
@@ -1376,7 +1376,7 @@ under the License.
<set field="debitEntry.productId" from-field="inventoryItem.productId"/>
<set field="debitEntry.origAmount" from-field="origAmount"/>
<set field="debitEntry.origCurrencyUomId" from-field="inventoryItem.currencyUomId"/>
<if-not-empty field-name="billToCustomer">
<if-not-empty field="billToCustomer">
<set field="debitEntry.partyId" from-field="billToCustomer.partyId"/>
<set field="debitEntry.roleTypeId" from-field="billToCustomer.roleTypeId"/>
</if-not-empty>
@@ -1401,7 +1401,7 @@ under the License.
<entity-one entity-name="ShipmentReceipt" value-name="shipmentReceipt"/>
<get-related-one value-name="shipmentReceipt" relation-name="InventoryItem" to-value-name="inventoryItem"/>
<get-related-one value-name="shipmentReceipt" relation-name="Shipment" to-value-name="shipment"/>
<if-not-empty field-name="shipmentReceipt.returnId">
<if-not-empty field="shipmentReceipt.returnId">
<set field="creditAccountTypeId" value="COGS_ACCOUNT"/>
<else>
<set field="creditAccountTypeId" value="UNINVOICED_SHIP_RCPT"/>
@@ -1463,7 +1463,7 @@ under the License.
<order-by field-name="-effectiveDate"/>
</entity-condition>
<first-from-list list-name="inventoryItemDetails" entry-name="oldInventoryItemDetail"/>
<if-not-empty field-name="oldInventoryItemDetail">
<if-not-empty field="oldInventoryItemDetail">
<calculate field-name="origAmount" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
<calcop operator="multiply" field-name="newinventoryItem.quantityOnHandTotal">
<calcop operator="subtract">
@@ -1605,8 +1605,8 @@ under the License.
<field-map field-name="workEffortId" env-name="parameters.workEffortId"/>
</entity-one>
<get-related-one value-name="workEffort" relation-name="Facility" to-value-name="facility"/>
<if-compare field-name="workEffort.workEffortTypeId" operator="equals" value="PROD_ORDER_TASK">
<if-not-empty field-name="workEffort.workEffortParentId">
<if-compare field="workEffort.workEffortTypeId" operator="equals" value="PROD_ORDER_TASK">
<if-not-empty field="workEffort.workEffortParentId">
<entity-and entity-name="WorkEffortGoodStandard" list-name="workEffortGoodStandards">
<field-map field-name="workEffortId" env-name="workEffort.workEffortParentId"/>
<field-map field-name="workEffortGoodStdTypeId" value="PRUN_PROD_DELIV"/>
@@ -1627,7 +1627,7 @@ under the License.
<!-- Debit -->
<make-value entity-name="AcctgTransEntry" value-name="debitEntry"/>
<set field="debitEntry.debitCreditFlag" value="D"/>
<if-not-empty field-name="costComponentCalc.offsettingGlAccountTypeId">
<if-not-empty field="costComponentCalc.offsettingGlAccountTypeId">
<set field="debitEntry.glAccountTypeId" value="costComponentCalc.offsettingGlAccountTypeId"/>
<else>
<set field="debitEntry.glAccountTypeId" value="WIP_INVENTORY"/>
@@ -1659,7 +1659,7 @@ under the License.
<entity-one entity-name="InventoryItem" value-name="inventoryItem"/>
<!-- TODO: handle serialized inventory -->
<if-not-empty field-name="inventoryItem.quantityOnHandTotal">
<if-not-empty field="inventoryItem.quantityOnHandTotal">
<calculate field-name="origAmount" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
<calcop operator="multiply">
<calcop operator="get" field-name="inventoryItem.quantityOnHandTotal"/>
@@ -1730,8 +1730,8 @@ under the License.
<entity-one entity-name="WorkEffort" value-name="workEffort">
<field-map field-name="workEffortId" env-name="parameters.workEffortId"/>
</entity-one>
<if-compare field-name="workEffort.workEffortTypeId" operator="equals" value="PROD_ORDER_TASK">
<if-not-empty field-name="workEffort.workEffortParentId">
<if-compare field="workEffort.workEffortTypeId" operator="equals" value="PROD_ORDER_TASK">
<if-not-empty field="workEffort.workEffortParentId">
<entity-and entity-name="WorkEffortGoodStandard" list-name="workEffortGoodStandards">
<field-map field-name="workEffortId" env-name="workEffort.workEffortParentId"/>
<field-map field-name="workEffortGoodStdTypeId" value="PRUN_PROD_DELIV"/>
@@ -1838,7 +1838,7 @@ under the License.
<field field-name="payment" type="org.ofbiz.entity.GenericValue"/>
</call-class-method>
<if-compare field-name="isReceiptValue" operator="equals" value="true" type="Boolean">
<if-compare field="isReceiptValue" operator="equals" value="true" type="Boolean">
<set field="origCurrencyUomId" from-field="payment.currencyUomId"/>
<set field="organizationPartyId" from-field="payment.partyIdTo"/>
<set field="partyId" from-field="payment.partyIdFrom"/>
@@ -1868,7 +1868,7 @@ under the License.
<set field="creditEntry.debitCreditFlag" value="C"/>
<set field="creditEntry.origAmount" from-field="paymentApplication.amountApplied"/>
<set field="creditEntry.origCurrencyUomId" from-field="origCurrencyUomId"/>
<if-not-empty field-name="paymentApplication.overrideGlAccountId">
<if-not-empty field="paymentApplication.overrideGlAccountId">
<set field="creditEntry.glAccountId" from-field="paymentApplication.overrideGlAccountId"/>
<else>
<set field="creditEntry.glAccountId" from-field="payment.overrideGlAccountId"/>
@@ -1891,7 +1891,7 @@ under the License.
<calcop operator="get" field-name="amountAppliedTotal"/>
</calcop>
</calculate>
<if-compare field-name="diffAmount" operator="greater" value="0" type="BigDecimal">
<if-compare field="diffAmount" operator="greater" value="0" type="BigDecimal">
<!-- credit for diff amount-->
<make-value entity-name="AcctgTransEntry" value-name="creditEntryWithDiffAmount"/>
<set field="creditEntryWithDiffAmount.debitCreditFlag" value="C"/>
@@ -1926,12 +1926,12 @@ under the License.
<set field="totalAmountFromInvoice" type="BigDecimal" value="0"/>
<entity-one entity-name="Invoice" value-name="invoice"/>
<if-compare field-name="invoice.invoiceTypeId" operator="equals" value="PURCHASE_INVOICE">
<if-compare field="invoice.invoiceTypeId" operator="equals" value="PURCHASE_INVOICE">
<get-related value-name="invoice" relation-name="InvoiceItem" list-name="invoiceItems"/>
<iterate list-name="invoiceItems" entry-name="invoiceItem">
<set field="amountFromOrder" type="BigDecimal" value="0"/>
<set field="amountFromInvoice" type="BigDecimal" value="0"/>
<if-empty field-name="invoiceItem.quantity">
<if-empty field="invoiceItem.quantity">
<set field="invoiceItem.quantity" value="1"/>
</if-empty>
<calculate field-name="amountFromInvoice" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
@@ -1962,8 +1962,8 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="amountFromInvoice" operator="not-equals" to-field-name="amountFromOrder"/>
<if-compare field-name="amountFromOrder" operator="greater" value="0" type="BigDecimal"/>
<if-compare-field field="amountFromInvoice" to-field="amountFromOrder" operator="not-equals"/>
<if-compare field="amountFromOrder" operator="greater" value="0" type="BigDecimal"/>
</and>
</condition>
<then>
@@ -1993,7 +1993,7 @@ under the License.
<set field="debitEntry.productId" from-field="invoiceItem.productId"/>
<set field="debitEntry.glAccountTypeId" from-field="invoiceItem.invoiceItemTypeId"/>
<set field="debitEntry.glAccountId" from-field="invoiceItem.overrideGlAccountId"/>
<if-compare field-name="amountFromOrder" operator="greater" value="0" type="BigDecimal">
<if-compare field="amountFromOrder" operator="greater" value="0" type="BigDecimal">
<set field="origAmount" from-field="amountFromOrder"/>
<else>
<set field="origAmount" from-field="amountFromInvoice"/>
@@ -2036,13 +2036,13 @@ under the License.
<set field="totalOrigAmount" value="0"/>
<entity-one entity-name="Invoice" value-name="invoice"/>
<if-compare field-name="invoice.invoiceTypeId" value="SALES_INVOICE" operator="equals">
<if-compare field="invoice.invoiceTypeId" value="SALES_INVOICE" operator="equals">
<entity-and entity-name="InvoiceItem" list-name="invoiceItems">
<field-map field-name="invoiceId" env-name="parameters.invoiceId" />
</entity-and>
<iterate list-name="invoiceItems" entry-name="invoiceItem">
<!-- TODO: handle serialized inventory -->
<if-empty field-name="invoiceItem.quantity">
<if-empty field="invoiceItem.quantity">
<set field="invoiceItem.quantity" value="1"/>
</if-empty>
<calculate field-name="origAmount" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
@@ -2066,7 +2066,7 @@ under the License.
<set field="creditEntry.origAmount" from-field="origAmount"/>
<set field="creditEntry.origCurrencyUomId" from-field="invoice.currencyUomId"/>
<set field="creditEntry.glAccountId" from-field="invoiceItem.overrideGlAccountId"/>
<if-not-empty field-name="invoiceItem.taxAuthPartyId">
<if-not-empty field="invoiceItem.taxAuthPartyId">
<set field="creditEntry.partyId" from-field="invoiceItem.taxAuthPartyId"/>
<set field="creditEntry.roleTypeId" value="TAX_AUTHORITY"/>
</if-not-empty>
@@ -2105,7 +2105,7 @@ under the License.
<field field-name="payment" type="org.ofbiz.entity.GenericValue"/>
</call-class-method>
<if-compare value="true" field-name="isDisbursement" operator="equals" type="Boolean">
<if-compare value="true" field="isDisbursement" operator="equals" type="Boolean">
<set field="organizationPartyId" from-field="payment.partyIdFrom"/>
<set field="partyId" from-field="payment.partyIdTo"/>
<set field="roleTypeId" value="BILL_FROM_VENDOR"/>
@@ -2137,10 +2137,10 @@ under the License.
<set field="debitEntry.origCurrencyUomId" from-field="payment.currencyUomId"/>
<set field="debitEntry.glAccountTypeId" from-field="debitGlAccountTypeId"/>
<set field="debitEntry.organizationPartyId" from-field="organizationPartyId"/>
<if-not-empty field-name="paymentApplication.overrideGlAccountId">
<if-not-empty field="paymentApplication.overrideGlAccountId">
<set field="debitEntry.glAccountId" from-field="paymentApplication.overrideGlAccountId"/>
<else>
<if-not-empty field-name="paymentApplication.taxAuthGeoId">
<if-not-empty field="paymentApplication.taxAuthGeoId">
<entity-one entity-name="TaxAuthorityGlAccount" value-name="taxAuthorityGlAccount">
<field-map field-name="organizationPartyId" env-name="organizationPartyId" />
<field-map field-name="taxAuthGeoId" env-name="paymentApplication.taxAuthGeoId"/>
@@ -2167,7 +2167,7 @@ under the License.
<calcop operator="get" field-name="amountAppliedTotal"/>
</calcop>
</calculate>
<if-compare field-name="amount" operator="greater" value="0" type="BigDecimal">
<if-compare field="amount" operator="greater" value="0" type="BigDecimal">
<make-value entity-name="AcctgTransEntry" value-name="debitEntryWithDiffAmount"/>
<set field="debitEntryWithDiffAmount.debitCreditFlag" value="D"/>
<set field="debitEntryWithDiffAmount.origAmount" from-field="amount"/>
@@ -2215,11 +2215,11 @@ under the License.
<clone-value value-name="acctgTransEntry" new-value-name="newAcctgTransEntry"/>
<set-service-fields to-map-name="createAcctgTransAndEntryInMap" service-name="createAcctgTransEntry" map-name="newAcctgTransEntry"/>
<set field="createAcctgTransAndEntryInMap.acctgTransId" from-field="newAcctgTrans.acctgTransId"/>
<if-compare field-name="parameters.revert" operator="equals" value="Y">
<if-compare field-name="newAcctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="parameters.revert" operator="equals" value="Y">
<if-compare field="newAcctgTransEntry.debitCreditFlag" operator="equals" value="D">
<set field="createAcctgTransAndEntryInMap.debitCreditFlag" value="C"/>
</if-compare>
<if-compare field-name="newAcctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="newAcctgTransEntry.debitCreditFlag" operator="equals" value="C">
<set field="createAcctgTransAndEntryInMap.debitCreditFlag" value="D"/>
</if-compare>
<else>
@@ -2239,7 +2239,7 @@ under the License.
<call-class-method class-name="org.ofbiz.accounting.util.UtilAccounting" method-name="isReceipt" ret-field-name="isReceipt">
<field field-name="payment" type="org.ofbiz.entity.GenericValue"/>
</call-class-method>
<if-compare field-name="isReceipt" operator="equals" type="Boolean" value="true">
<if-compare field="isReceipt" operator="equals" type="Boolean" value="true">
<entity-one entity-name="PaymentGlAccountTypeMap" value-name="paymentGlAccountTypeMap">
<field-map field-name="paymentTypeId" env-name="payment.paymentTypeId"/>
<field-map field-name="organizationPartyId" env-name="payment.partyIdTo"/>
@@ -2296,7 +2296,7 @@ under the License.
<set field="createAcctgTransAndEntriesInMap.glFiscalTypeId" value="ACTUAL"/>
<set field="createAcctgTransAndEntriesInMap.paymentId" from-field="paymentApplication.paymentId"/>
<set field="createAcctgTransAndEntriesInMap.invoiceId" from-field="paymentApplication.invoiceId"/>
<if-compare field-name="isReceipt" operator="equals" type="Boolean" value="true">
<if-compare field="isReceipt" operator="equals" type="Boolean" value="true">
<set field="createAcctgTransAndEntriesInMap.partyId" from-field="payment.partyIdFrom"/>
<set field="createAcctgTransAndEntriesInMap.roleTypeId" value="BILL_TO_CUSTOMER"/>
<else>
@@ -2385,4 +2385,4 @@ under the License.
<field-map field-name="glAccountTypeId" env-name="parameters.glAccountTypeId"/>
</entity-one>
</simple-method>
</simple-methods>
</simple-methods>
@@ -29,7 +29,7 @@ under the License.
<set from-field="billingAccountId" field="newEntity.billingAccountId"/>
<field-to-result field-name="billingAccountId" result-name="billingAccountId"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -47,7 +47,7 @@ under the License.
<make-value value-name="newEntity" entity-name="BillingAccountRole"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -38,7 +38,7 @@ under the License.
<default-message>Credit Card successfully created.</default-message>
<result-to-request result-name="paymentMethodId"/>
</call-service>
<if-compare map-name="parameters" field-name="contactMechId" operator="equals" value="_NEW_">
<if-compare field="parameters.contactMechId" operator="equals" value="_NEW_">
<set value="address" field="_response_code_"/>
<set value="POSTAL_ADDRESS" field="preContactMechTypeId"/>
<set value="BILLING_LOCATION" field="contactMechPurposeTypeId"/>
@@ -58,7 +58,7 @@ under the License.
<default-message>Credit Card Info successfully updated.</default-message>
<result-to-request result-name="paymentMethodId" request-name="paymentMethodId"/>
</call-service>
<if-compare map-name="parameters" field-name="contactMechId" operator="equals" value="_NEW_">
<if-compare field="parameters.contactMechId" operator="equals" value="_NEW_">
<set value="address" field="_response_code_"/>
<set value="POSTAL_ADDRESS" field="preContactMechTypeId"/>
<set value="BILLING_LOCATION" field="contactMechPurposeTypeId"/>
@@ -32,11 +32,11 @@ under the License.
<call-service service-name="capturePayment" in-map-name="captureParams" error-code="ignore-error">
<result-to-field map-name="captureResult" result-name="responseMessage" />
</call-service>
<if-compare map-name="captureResult" operator="equals" field-name="responseMessage" value="error">
<if-compare operator="equals" field="captureResult.responseMessage" value="error">
<field-to-list map-name="orderHeaderAndPaymentPref" field-name="orderId" list-name="badOrders" />
</if-compare>
</iterate>
<if-not-empty field-name="badOrders">
<if-not-empty field="badOrders">
<string-to-field string="mail.smtp.host" field-name="sendType" map-name="emailParams" />
<property-to-field resource="payment" property="mailhost" field-name="sendVia" map-name="emailParams"/>
@@ -56,19 +56,19 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="PaymentMethod"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="PaymentMethod" map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-compare map-name="lookedUpValue" field-name="paymentMethodTypeId" operator="equals" value="CREDIT_CARD">
<if-compare field="lookedUpValue.paymentMethodTypeId" operator="equals" value="CREDIT_CARD">
<find-by-primary-key entity-name="CreditCard" map-name="lookupPKMap" value-name="mainValue"/>
<clone-value value-name="mainValue" new-value-name="savedValue"/>
<set-nonpk-fields map-name="parameters" value-name="mainValue"/>
<if-compare-field field-name="mainValue" operator="not-equals" to-field-name="savedValue" type="Object">
<if-compare-field field="mainValue" to-field="savedValue" operator="not-equals" type="Object">
<store-value value-name="mainValue"/>
</if-compare-field>
</if-compare>
<if-compare map-name="lookedUpValue" field-name="paymentMethodTypeId" operator="equals" value="EFT_ACCOUNT">
<if-compare field="lookedUpValue.paymentMethodTypeId" operator="equals" value="EFT_ACCOUNT">
<find-by-primary-key entity-name="CreditCard" map-name="lookupPKMap" value-name="mainValue"/>
<clone-value value-name="mainValue" new-value-name="savedValue"/>
<set-nonpk-fields map-name="parameters" value-name="mainValue"/>
<if-compare-field field-name="mainValue" operator="not-equals" to-field-name="savedValue" type="Object">
<if-compare-field field="mainValue" to-field="savedValue" operator="not-equals" type="Object">
<store-value value-name="mainValue"/>
</if-compare-field>
</if-compare>
@@ -83,7 +83,7 @@ under the License.
<call-class-method class-name="org.ofbiz.base.util.UtilValidate" method-name="isDateAfterToday" ret-field-name="isNotExpired">
<field field-name="creditCard.expireDate"/>
</call-class-method>
<if-compare field-name="isNotExpired" operator="equals" type="Boolean" value="true">
<if-compare field="isNotExpired" operator="equals" type="Boolean" value="true">
<set-service-fields service-name="updateCreditCard" map-name="creditCard" to-map-name="uccMap"/>
<set field="uccMap.contactMechId" from-field="parameters.contactMechId"/>
<set field="uccMap.partyId" from-field="parameters.partyId"/>
@@ -25,8 +25,8 @@ under the License.
<condition>
<and>
<not><if-has-permission permission="PAY_INFO" action="_CREATE"/></not>
<not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-field-name="partyIdFrom" to-map-name="parameters"/></not>
<not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-field-name="partyIdTo" to-map-name="parameters"/></not>
<not><if-compare-field field="userLogin.partyId" to-field="parameters.partyIdFrom" operator="equals"/></not>
<not><if-compare-field field="userLogin.partyId" to-field="parameters.partyIdTo" operator="equals"/></not>
</and>
</condition>
<then>
@@ -36,7 +36,7 @@ under the License.
<check-errors/>
<make-value entity-name="Payment" value-name="payment"/>
<if-empty field-name="parameters.paymentId">
<if-empty field="parameters.paymentId">
<sequenced-id-to-env sequence-name="Payment" env-name="payment.paymentId"/>
<else>
<set field="payment.paymentId" from-field="parameters.paymentId"/>
@@ -44,21 +44,21 @@ under the License.
</if-empty>
<field-to-result field-name="payment.paymentId" result-name="paymentId"/>
<if-not-empty field-name="parameters.paymentMethodId">
<if-not-empty field="parameters.paymentMethodId">
<entity-one entity-name="PaymentMethod" value-name="paymentMethod">
<field-map field-name="paymentMethodId" env-name="parameters.paymentMethodId"/>
</entity-one>
<log level="info" message="Replacing passed payment method type [${parameters.paymentMethodTypeId}] with payment method type [${paymentMethod.paymentMethodTypeId}] for payment method [${parameters.paymentMethodId}]"/>
<set field="parameters.paymentMethodTypeId" from-field="paymentMethod.paymentMethodTypeId"/>
</if-not-empty>
<if-empty field-name="parameters.paymentMethodTypeId">
<if-empty field="parameters.paymentMethodTypeId">
<add-error>
<fail-property resource="AccountingUiLabels" property="AccountingPaymentMethodIdPaymentMethodTypeIdNullError"/>
</add-error>
</if-empty>
<set-nonpk-fields map-name="parameters" value-name="payment"/>
<if-empty field-name="payment.effectiveDate">
<if-empty field="payment.effectiveDate">
<now-timestamp-to-env env-name="payment.effectiveDate"/>
</if-empty>
<create-value value-name="payment"/>
@@ -72,8 +72,8 @@ under the License.
<condition>
<and>
<not><if-has-permission permission="PAY_INFO" action="_UPDATE"/></not>
<not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-field-name="partyIdFrom" to-map-name="payment"/></not>
<not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-field-name="partyIdTo" to-map-name="payment"/></not>
<not><if-compare-field field="userLogin.partyId" to-field="payment.partyIdFrom" operator="equals"/></not>
<not><if-compare-field field="userLogin.partyId" to-field="payment.partyIdTo" operator="equals"/></not>
</and>
</condition>
<then>
@@ -82,7 +82,7 @@ under the License.
</if>
<check-errors/>
<if-compare field-name="payment.statusId" value="PMNT_NOT_PAID" operator="not-equals">
<if-compare field="payment.statusId" value="PMNT_NOT_PAID" operator="not-equals">
<!-- check if only status change -->
<make-value value-name="newPayment" entity-name="Payment"/>
<make-value value-name="oldPayment" entity-name="Payment"/>
@@ -90,7 +90,7 @@ under the License.
<set-nonpk-fields value-name="oldPayment" map-name="payment"/>
<set-nonpk-fields value-name="newPayment" map-name="parameters"/>
<set field="newPayment.statusId" from-field="oldPayment.statusId"/>
<if-compare-field field-name="oldPayment" to-field-name="newPayment" operator="not-equals">
<if-compare-field field="oldPayment" to-field="newPayment" operator="not-equals">
<log level="always" message="=========Old: ${oldPayment} ============New: ${newPayment}"></log>
<add-error>
<fail-property resource="AccountingUiLabels" property="AccountingPSUpdateNotAllowedBecauseOfStatus"/>
@@ -103,22 +103,22 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="payment"/>
<set field="payment.statusId" from-field="statusIdSave"/> <!-- do not allow status change here -->
<if-empty field-name="payment.effectiveDate">
<if-empty field="payment.effectiveDate">
<now-timestamp-to-env env-name="payment.effectiveDate"/>
</if-empty>
<if-not-empty field-name="payment.paymentMethodId">
<if-not-empty field="payment.paymentMethodId">
<entity-one entity-name="PaymentMethod" value-name="paymentMethod">
<field-map field-name="paymentMethodId" env-name="payment.paymentMethodId"/>
</entity-one>
<if-compare-field field-name="payment.paymentMethodTypeId" operator="not-equals" to-field-name="paymentMethod.paymentMethodTypeId">
<if-compare-field field="payment.paymentMethodTypeId" to-field="paymentMethod.paymentMethodTypeId" operator="not-equals">
<log level="info" message="Replacing passed payment method type [${payment.paymentMethodTypeId}] with payment method type [${paymentMethod.paymentMethodTypeId}] for payment method [${payment.paymentMethodId}]"/>
</if-compare-field>
<set field="payment.paymentMethodTypeId" from-field="paymentMethod.paymentMethodTypeId"/>
</if-not-empty>
<store-value value-name="payment"/>
<if-not-empty field-name="parameters.statusId">
<if-compare-field field-name="parameters.statusId" operator="not-equals" to-field-name="statusIdSave">
<if-not-empty field="parameters.statusId">
<if-compare-field field="parameters.statusId" to-field="statusIdSave" operator="not-equals">
<set-service-fields service-name="setPaymentStatus" map-name="parameters" to-map-name="param"/>
<call-service service-name="setPaymentStatus" in-map-name="param"/>
<check-errors/>
@@ -126,10 +126,10 @@ under the License.
</if-not-empty>
</simple-method>
<simple-method method-name="createPaymentApplication" short-description="Create a Payment Application">
<if-empty field-name="invoiceId" map-name="parameters">
<if-empty field-name="billingAccountId" map-name="parameters">
<if-empty field-name="taxAuthGeoId" map-name="parameters">
<if-empty field-name="overrideGlAccountId" map-name="parameters">
<if-empty field="parameters.invoiceId">
<if-empty field="parameters.billingAccountId">
<if-empty field="parameters.taxAuthGeoId">
<if-empty field="parameters.overrideGlAccountId">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingPaymentApplicationParameterMissing"/></add-error>
<check-errors/>
</if-empty>
@@ -141,19 +141,19 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="paymentAppl"/>
<!-- get the invoice and do some further validation against it -->
<if-not-empty field-name="parameters.invoiceId">
<if-not-empty field="parameters.invoiceId">
<entity-one entity-name="Invoice" value-name="invoice"/>
<!-- get the amount that has not been applied yet for the invoice (outstanding amount) -->
<set field="notApplied" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice).doubleValue()}" type="Double"/>
<!-- if the amount to apply goes over the outstanding amount, then use the notApplied amount and log a warning -->
<if-compare-field field-name="paymentAppl.amountApplied" operator="greater" to-field-name="notApplied" type="Double">
<if-compare-field field="paymentAppl.amountApplied" to-field="notApplied" operator="greater" type="Double">
<log level="warning" message="Create Payment Application: Amount to apply [${paymentAppl.amountApplied}] is greater than the outstanding amount [${notApplied}] of the invoice [${invoice.invoiceId}]. Creating Payment Application for outstanding amount [${notApplied}] instead."/>
<set field="paymentAppl.amountApplied" from-field="notApplied"/>
</if-compare-field>
<if-not-empty field-name="invoice.billingAccountId">
<if-not-empty field="invoice.billingAccountId">
<set field="paymentAppl.billingAccountId" from-field="invoice.billingAccountId"/>
</if-not-empty>
</if-not-empty>
@@ -173,28 +173,28 @@ under the License.
<entity-one entity-name="Payment" value-name="payment"/>
<field-to-result field-name="payment.paymentId" result-name="oldStatusId"/>
<if-compare-field field-name="payment.statusId" operator="not-equals" to-field-name="parameters.statusId">
<if-compare-field field="payment.statusId" to-field="parameters.statusId" operator="not-equals">
<entity-one entity-name="StatusValidChange" value-name="statusChange" auto-field-map="false">
<field-map field-name="statusId" env-name="payment.statusId"/>
<field-map field-name="statusIdTo" env-name="parameters.statusId"/>
</entity-one>
<if-empty field-name="statusChange">
<if-empty field="statusChange">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingPSInvalidStatusChange"/></add-error>
<log level="error" message="Cannot change from ${payment.statusId} to ${parameters.statusId}"/>
<check-errors/>
<else>
<!-- check if the payment fully applied when set to confirmed-->
<if-compare field-name="parameters.statusId" operator="equals" value="PMNT_CONFIRMED">
<if-compare field="parameters.statusId" operator="equals" value="PMNT_CONFIRMED">
<set field="notYetApplied" value="${bsh:org.ofbiz.accounting.payment.PaymentWorker.getPaymentNotAppliedBd(payment)}"/>
<if-compare field-name="notYetApplied" operator="greater" value="0.00">
<if-compare field="notYetApplied" operator="greater" value="0.00">
<add-error><fail-property resource="AccountingUiLabels" property="AccountingPSNotConfirmedNotFullyApplied"/></add-error>
<log level="error" message="Cannot change from ${payment.statusId} to ${parameters.statusId}, payment not fully applied: ${notYetapplied}"/>
<check-errors/>
</if-compare>
</if-compare>
<if-compare field-name="parameters.statusId" operator="equals" value="PMNT_CANCELLED">
<if-compare field="parameters.statusId" operator="equals" value="PMNT_CANCELLED">
<!-- if new status is cancelled delete existing payment applications. -->
<get-related value-name="payment" relation-name="PaymentApplication" list-name="paymentApplications"/>
<iterate list-name="paymentApplications" entry-name="paymentApplication">
@@ -203,7 +203,7 @@ under the License.
</iterate>
<!-- if new status is cancelled and the payment is associated to an OrderPaymentPreference, update the status of that record too. -->
<get-related-one value-name="payment" relation-name="OrderPaymentPreference" to-value-name="orderPaymentPreference"/>
<if-not-empty field-name="orderPaymentPreference">
<if-not-empty field="orderPaymentPreference">
<set field="updateOrderPaymentPreferenceMap.orderPaymentPreferenceId" from-field="orderPaymentPreference.orderPaymentPreferenceId"/>
<set field="updateOrderPaymentPreferenceMap.cancelThis" value="true"/>
<call-service service-name="updateOrderPaymentPreference" in-map-name="updateOrderPaymentPreferenceMap"/>
@@ -244,7 +244,7 @@ under the License.
</simple-method>
<simple-method method-name="getInvoicePaymentInfoList" short-description="Create a list with information on payment due dates and amounts for the invoice">
<if-empty field-name="parameters.invoice">
<if-empty field="parameters.invoice">
<entity-one entity-name="Invoice" value-name="invoice"/>
<else>
<set field="invoice" from-field="parameters.invoice"/>
@@ -261,7 +261,7 @@ under the License.
<set field="computedTotalAmount" value="0.0" type="BigDecimal"/>
<iterate list-name="invoiceTerms" entry-name="invoiceTerm">
<get-related-one relation-name="TermType" value-name="invoiceTerm" to-value-name="termType" use-cache="true"/>
<if-compare field-name="termType.parentTypeId" operator="equals" value="FIN_PAYMENT_TERM">
<if-compare field="termType.parentTypeId" operator="equals" value="FIN_PAYMENT_TERM">
<clear-field field-name="invoicePaymentInfo"/>
<set field="invoicePaymentInfo.invoiceId" from-field="invoice.invoiceId"/>
<set field="invoicePaymentInfo.invoiceTermId" from-field="invoiceTerm.invoiceTermId"/>
@@ -286,7 +286,7 @@ under the License.
<calcop field-name="invoicePaymentInfo.amount" operator="get"/>
</calcop>
</calculate>
<if-compare-field field-name="remainingAppliedAmount" operator="greater-equals" to-field-name="invoiceTermAmount" type="BigDecimal">
<if-compare-field field="remainingAppliedAmount" to-field="invoiceTermAmount" operator="greater-equals" type="BigDecimal">
<set field="invoicePaymentInfo.paidAmount" from-field="invoiceTermAmount" type="BigDecimal"/>
<calculate field-name="remainingAppliedAmount" type="BigDecimal">
<calcop field-name="remainingAppliedAmount" operator="subtract">
@@ -309,9 +309,9 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="remainingAppliedAmount" operator="greater" value="0.0" type="BigDecimal"/>
<if-compare field-name="invoiceTotalAmount" operator="equals" value="0.0" type="BigDecimal"/>
<if-compare-field field-name="computedTotalAmount" operator="less" to-field-name="invoiceTotalAmount" type="BigDecimal"/>
<if-compare field="remainingAppliedAmount" operator="greater" value="0.0" type="BigDecimal"/>
<if-compare field="invoiceTotalAmount" operator="equals" value="0.0" type="BigDecimal"/>
<if-compare-field field="computedTotalAmount" to-field="invoiceTotalAmount" operator="less" type="BigDecimal"/>
</or>
</condition>
<then>
@@ -319,7 +319,7 @@ under the License.
<set field="andMap.termTypeId" value="FIN_PAYMENT_TERM"/>
<filter-list-by-and list-name="invoiceTerms" map-name="andMap"/>
<first-from-list list-name="invoiceTerms" entry-name="invoiceTerm"/>
<if-not-empty field-name="invoiceTerm">
<if-not-empty field="invoiceTerm">
<set field="invoicePaymentInfo.termTypeId" from-field="invoiceTerm.termTypeId"/>
<call-class-method class-name="org.ofbiz.base.util.UtilDateTime" method-name="getDayEnd" ret-field-name="invoicePaymentInfo.dueDate">
<field field-name="invoice.invoiceDate" type="Timestamp"/>
@@ -375,8 +375,8 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="invoicePaymentInfo.outstandingAmount" operator="greater" value="0.0" type="BigDecimal"/>
<if-compare-field field-name="invoicePaymentInfo.dueDate" operator="less" to-field-name="asOfDate" type="Timestamp"/>
<if-compare field="invoicePaymentInfo.outstandingAmount" operator="greater" value="0.0" type="BigDecimal"/>
<if-compare-field field="invoicePaymentInfo.dueDate" to-field="asOfDate" operator="less" type="Timestamp"/>
</and>
</condition>
<then>
@@ -49,7 +49,7 @@ under the License.
<simple-method method-name="acctgFxPermissionCheck" short-description="Foreign exchange permission logic">
<set field="primaryPermission" value="ACCTG_FX"/>
<call-simple-method method-name="genericBasePermissionCheck" xml-resource="component://common/script/org/ofbiz/common/permission/CommonPermissionServices.xml"/>
<if-compare field-name="hasPermission" operator="not-equals" value="true">
<if-compare field="hasPermission" operator="not-equals" value="true">
<!-- Check for deprecated permission -->
<if-has-permission permission="ACCTG_FX_ENTRY">
<set field="hasPermission" type="Boolean" value="true"/>
@@ -58,7 +58,7 @@ under the License.
<make-value entity-name="TaxAuthorityAssoc" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<create-value value-name="newEntity"/>
</simple-method>
@@ -182,7 +182,7 @@ under the License.
<make-value entity-name="PartyTaxAuthInfo" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<create-value value-name="newEntity"/>
@@ -206,8 +206,8 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="taxAuthority.taxIdFormatPattern"/></not>
<not><if-empty field-name="parameters.partyTaxId"/></not>
<not><if-empty field="taxAuthority.taxIdFormatPattern"/></not>
<not><if-empty field="parameters.partyTaxId"/></not>
<not><if-regexp field-name="parameters.partyTaxId" expr="${taxAuthority.taxIdFormatPattern}"/></not>
</and>
</condition>
@@ -27,11 +27,11 @@ under the License.
<make-value value-name="newEntity" entity-name="SimpleSalesTaxLookup"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="fromDate"/>
<set from-field="fromDate" field="newEntity.fromDate"/>
</if-empty>
<if-empty field-name="taxCategory" map-name="newEntity">
<if-empty field="newEntity.taxCategory">
<set value="_NA_" field="newEntity.taxCategory"/>
</if-empty>
@@ -49,4 +49,4 @@ under the License.
<remove-value value-name="lookedUpValue"/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -55,18 +55,18 @@ under the License.
<entity-condition entity-name="AcctgTransEntry" list-name="acctgTransEntries">
<condition-expr field-name="productId" env-name="productId"/>
</entity-condition>
<assert><not><if-empty field-name="acctgTransEntries"/></not></assert>
<assert><not><if-empty field="acctgTransEntries"/></not></assert>
<iterate list-name="acctgTransEntries" entry-name="acctgTransEntry">
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="UNINVOICED_SHIP_RCPT"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="214000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="UNINVOICED_SHIP_RCPT"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="214000"/>
</assert>
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="INVENTORY_ACCOUNT"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="140000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="INVENTORY_ACCOUNT"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="140000"/>
</assert>
</if-compare>
</else>
@@ -107,18 +107,18 @@ under the License.
<set field="debitTotal" type="Double" value="0.0"/>
<set field="creditTotal" type="Double" value="0.0"/>
<assert><not><if-empty field-name="acctgTransEntries"/></not></assert>
<assert><not><if-empty field="acctgTransEntries"/></not></assert>
<iterate list-name="acctgTransEntries" entry-name="acctgTransEntry">
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_PAYABLE"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="210000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_PAYABLE"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="210000"/>
</assert>
<calculate field-name="creditTotal">
<calcop operator="add" field-name="acctgTransEntry.origAmount"/>
</calculate>
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<calculate field-name="debitTotal">
<calcop operator="add" field-name="acctgTransEntry.origAmount"/>
</calculate>
@@ -127,7 +127,7 @@ under the License.
</if-compare>
</iterate>
<assert>
<if-compare field-name="debitTotal" operator="equals" value="creditTotal"/>
<if-compare field="debitTotal" operator="equals" value="creditTotal"/>
</assert>
<check-errors/>
</simple-method>
@@ -161,19 +161,19 @@ under the License.
<set field="debitTotal" type="Double" value="0.0"/>
<set field="creditTotal" type="Double" value="0.0"/>
<assert><not><if-empty field-name="acctgTransEntries"/></not></assert>
<assert><not><if-empty field="acctgTransEntries"/></not></assert>
<iterate list-name="acctgTransEntries" entry-name="acctgTransEntry">
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<!--<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="GENERAL_CHECKING_ACCOUNT"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="111100"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="GENERAL_CHECKING_ACCOUNT"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="111100"/>
</assert>-->
<set field="creditTotal" from-field="acctgTransEntry.origAmount"/>
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_PAYABLE"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="210000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_PAYABLE"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="210000"/>
</assert>
<set field="debitTotal" from-field="acctgTransEntry.origAmount"/>
</if-compare>
@@ -181,7 +181,7 @@ under the License.
</if-compare>
</iterate>
<assert>
<if-compare field-name="debitTotal" operator="equals" value="creditTotal"/>
<if-compare field="debitTotal" operator="equals" value="creditTotal"/>
</assert>
<check-errors/>
</simple-method>
@@ -225,18 +225,18 @@ under the License.
<condition-expr field-name="productId" operator="equals" env-name="productId"/>
</entity-condition>
<assert><not><if-empty field-name="acctgTransEntries"/></not></assert>
<assert><not><if-empty field="acctgTransEntries"/></not></assert>
<iterate list-name="acctgTransEntryList" entry-name="acctgTransEntry">
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="INVENTORY_ACCOUNT"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="140000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="INVENTORY_ACCOUNT"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="140000"/>
</assert>
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="COGS_ACCOUNT"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="500000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="COGS_ACCOUNT"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="500000"/>
</assert>
</if-compare>
</else>
@@ -278,18 +278,18 @@ under the License.
<first-from-list list-name="acctgTransList" entry-name="acctgTrans"/>
<get-related value-name="acctgTrans" relation-name="AcctgTransEntry" list-name="acctgTransEntries"/>
<assert><not><if-empty field-name="acctgTransEntries"/></not></assert>
<assert><not><if-empty field="acctgTransEntries"/></not></assert>
<iterate entry-name="acctgTransEntry" list-name="acctgTransEntries">
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<!--<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="SALES_ACCOUNT"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="400000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="SALES_ACCOUNT"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="400000"/>
</assert>-->
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_RECEIVABLE"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="120000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_RECEIVABLE"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="120000"/>
</assert>
</if-compare>
</else>
@@ -329,21 +329,21 @@ under the License.
<set field="debitTotal" type="Double" value="0.0"/>
<set field="creditTotal" type="Double" value="0.0"/>
<assert><not><if-empty field-name="acctgTransEntries"/></not></assert>
<assert><not><if-empty field="acctgTransEntries"/></not></assert>
<iterate entry-name="acctgTransEntry" list-name="acctgTransEntries">
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<!--<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_RECEIVABLE"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="120000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_RECEIVABLE"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="120000"/>
</assert>-->
<calculate field-name="creditTotal">
<calcop operator="add" field-name="acctgTransEntry.origAmount"/>
</calculate>
</if-compare>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<!--<assert>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="UNDEPOSITED_RECEIPTS"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="112000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="UNDEPOSITED_RECEIPTS"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="112000"/>
</assert>-->
<calculate field-name="debitTotal">
<calcop operator="add" field-name="acctgTransEntry.origAmount"/>
@@ -351,7 +351,7 @@ under the License.
</if-compare>
</iterate>
<assert>
<if-compare field-name="debitTotal" operator="equals" value="creditTotal"/>
<if-compare field="debitTotal" operator="equals" value="creditTotal"/>
</assert>
<check-errors/>
</simple-method>
@@ -387,12 +387,12 @@ under the License.
</condition-list>
</condition-list>
</entity-condition>
<assert><not><if-empty field-name="workEffortAndInventoryAssigns"/></not></assert>
<assert><not><if-empty field="workEffortAndInventoryAssigns"/></not></assert>
<set field="totalIssuedQty_MAT_A_COST" value="0.0" type="Double"/>
<set field="totalIssuedQty_MAT_B_COST" value="0.0" type="Double"/>
<iterate list-name="workEffortAndInventoryAssigns" entry-name="workEffortAndInventoryAssign">
<if-compare field-name="workEffortAndInventoryAssign.productId" operator="equals" value="MAT_A_COST">
<if-compare field="workEffortAndInventoryAssign.productId" operator="equals" value="MAT_A_COST">
<calculate field-name="totalIssuedQty_MAT_A_COST">
<calcop operator="add">
<calcop operator="get" field-name="workEffortAndInventoryAssign.quantity"/>
@@ -400,7 +400,7 @@ under the License.
</calcop>
</calculate>
<else>
<if-compare field-name="workEffortAndInventoryAssign.productId" operator="equals" value="MAT_B_COST">
<if-compare field="workEffortAndInventoryAssign.productId" operator="equals" value="MAT_B_COST">
<calculate field-name="totalIssuedQty_MAT_B_COST">
<calcop operator="add">
<calcop operator="get" field-name="workEffortAndInventoryAssign.quantity" />
@@ -412,33 +412,33 @@ under the License.
</if-compare>
</iterate>
<assert>
<if-compare field-name="totalIssuedQty_MAT_A_COST" operator="equals" value="4.0" type="Double"/>
<if-compare field-name="totalIssuedQty_MAT_B_COST" operator="equals" value="6.0" type="Double"/>
<if-compare field="totalIssuedQty_MAT_A_COST" operator="equals" value="4.0" type="Double"/>
<if-compare field="totalIssuedQty_MAT_B_COST" operator="equals" value="6.0" type="Double"/>
</assert>
<entity-and entity-name="AcctgTrans" list-name="acctgTransList">
<field-map field-name="acctgTransTypeId" value="INVENTORY"/>
</entity-and>
<assert><not><if-empty field-name="acctgTransList"/></not></assert>
<assert><not><if-empty field="acctgTransList"/></not></assert>
<iterate list-name="acctgTransList" entry-name="acctgTrans">
<get-related list-name="acctgTransEntryList" relation-name="AcctgTransEntry" value-name="acctgTrans"/>
<assert><not><if-empty field-name="acctgTransEntryList"/></not></assert>
<assert><not><if-empty field="acctgTransEntryList"/></not></assert>
<iterate list-name="acctgTransEntryList" entry-name="acctgTransEntry">
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<assert>
<or>
<if-compare field-name="acctgTransEntry.productId" operator="equals" value="MAT_A_COST"/>
<if-compare field-name="acctgTransEntry.productId" operator="equals" value="MAT_B_COST"/>
<if-compare field="acctgTransEntry.productId" operator="equals" value="MAT_A_COST"/>
<if-compare field="acctgTransEntry.productId" operator="equals" value="MAT_B_COST"/>
</or>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="RAWMAT_INVENTORY"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="141000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="RAWMAT_INVENTORY"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="141000"/>
</assert>
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<assert>
<if-compare field-name="acctgTransEntry.productId" operator="equals" value="PROD_COST"/>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="WIP_INVENTORY"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="142000"/>
<if-compare field="acctgTransEntry.productId" operator="equals" value="PROD_COST"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="WIP_INVENTORY"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="142000"/>
</assert>
</if-compare>
</else>
@@ -471,22 +471,22 @@ under the License.
<field-map field-name="workEffortId" env-name="workEffortId"/>
</entity-one>
<get-related value-name="workEffort" relation-name="AcctgTrans" list-name="acctgTransList"/>
<assert><not><if-empty field-name="acctgTransList"></if-empty></not></assert>
<assert><not><if-empty field="acctgTransList"></if-empty></not></assert>
<iterate list-name="acctgTransList" entry-name="acctgTrans">
<get-related value-name="acctgTrans" relation-name="AcctgTransEntry" list-name="acctgTransEntryList"/>
<iterate list-name="acctgTransEntryList" entry-name="acctgTransEntry">
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<assert>
<if-compare field-name="acctgTransEntry.productId" operator="equals" value="PROD_COST"/>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="OPERATING_EXPENSE"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="600000"/>
<if-compare field="acctgTransEntry.productId" operator="equals" value="PROD_COST"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="OPERATING_EXPENSE"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="600000"/>
</assert>
<else>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<assert>
<if-compare field-name="acctgTransEntry.productId" operator="equals" value="PROD_COST"/>
<if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="WIP_INVENTORY"/>
<if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="142000"/>
<if-compare field="acctgTransEntry.productId" operator="equals" value="PROD_COST"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="WIP_INVENTORY"/>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="142000"/>
</assert>
</if-compare>
</else>
@@ -523,8 +523,8 @@ under the License.
</entity-and>
<first-from-list list-name="acctgTransEntryList" entry-name="acctgTransEntry"/>
<assert>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C"/>
<if-compare field-name="acctgTransEntry.origAmount" operator="equals" value="328" type="Double"/>
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C"/>
<if-compare field="acctgTransEntry.origAmount" operator="equals" value="328" type="Double"/>
</assert>
<!-- For debit entry -->
@@ -536,9 +536,9 @@ under the License.
</entity-and>
<first-from-list list-name="acctgTransEntryList" entry-name="acctgTransEntry"/>
<assert>
<if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D"/>
<if-compare field-name="acctgTransEntry.origAmount" operator="equals" value="328" type="Double"/>
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D"/>
<if-compare field="acctgTransEntry.origAmount" operator="equals" value="328" type="Double"/>
</assert>
<check-errors/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -29,10 +29,10 @@
<condition>
<and>
<not>
<if-empty field-name="parameters.uploadedFile"/>
<if-empty field="parameters.uploadedFile"/>
</not>
<not>
<if-empty field-name="parameters.textData"/>
<if-empty field="parameters.textData"/>
</not>
</and>
</condition>
@@ -63,7 +63,7 @@
<if>
<condition>
<not>
<if-empty field-name="parameters.uploadedFile"/>
<if-empty field="parameters.uploadedFile"/>
</not>
</condition>
<then>
@@ -87,7 +87,7 @@
<result-to-field result-name="contentId" field-name="imageContentId"/>
</call-service>
<if-empty field-name="contentId">
<if-empty field="contentId">
<set field="contentIdFrom" from-field="imageContentId"/>
<set field="contentId" from-field="imageContentId"/>
<set field="contentAssocTypeId" value="SUB_CONTENT"/>
@@ -98,7 +98,7 @@
<if>
<condition>
<not>
<if-empty field-name="parameters.textData"/>
<if-empty field="parameters.textData"/>
</not>
</condition>
<then>
@@ -121,7 +121,7 @@
<result-to-field result-name="contentId" field-name="textContentId"/>
</call-service>
<if-empty field-name="contentId">
<if-empty field="contentId">
<set field="contentIdFrom" from-field="textContentId"/>
<set field="contentId" from-field="textContentId"/>
<set field="contentAssocTypeId" value="SUB_CONTENT"/>
@@ -134,10 +134,10 @@
<condition>
<and>
<not>
<if-empty field-name="contentId"/>
<if-empty field="contentId"/>
</not>
<not>
<if-empty field-name="parameters.summaryData"/>
<if-empty field="parameters.summaryData"/>
</not>
</and>
</condition>
@@ -189,7 +189,7 @@
<result-to-field result-name="permissionStatus" field-name="permissionStatus"/>
</call-service>
<log level="info" message="permissionStatus: ${permissionStatus}"/>
<if-compare operator="equals" field-name="permissionStatus" value="granted">
<if-compare operator="equals" field="permissionStatus" value="granted">
<set field="blogList[]" from-field="view"/>
</if-compare>
</iterate>
@@ -28,14 +28,14 @@ under the License.
<log message="genCompDocInstance> rootTemplateContent: ${rootTemplateContent}" level="info"/>
<!-- if not passed in, get latest template contentRevisionSeqId from db -->
<if-empty field-name="parameters.contentRevisionSeqId">
<if-empty field="parameters.contentRevisionSeqId">
<entity-condition entity-name="ContentRevision" list-name="contentRevisionList">
<condition-list>
<condition-expr field-name="contentId" operator="equals" env-name="parameters.instanceOfContentId"/>
</condition-list>
<order-by field-name="-contentRevisionSeqId"/>
</entity-condition>
<if-not-empty field-name="contentRevisionList">
<if-not-empty field="contentRevisionList">
<set from-field="contentRevisionList[0].contentRevisionSeqId" field="contentRevisionSeqId"/>
<else>
<set value="" field="contentRevisionSeqId"/>
@@ -48,7 +48,7 @@ under the License.
<log message="genCompDocInstance> contentRevisionSeqId: ${contentRevisionSeqId}" level="info"/>
<make-value entity-name="Content" value-name="rootInstanceContent"/>
<if-empty field-name="parameters.rootInstanceContentId">
<if-empty field="parameters.rootInstanceContentId">
<sequenced-id-to-env sequence-name="Content" env-name="rootInstanceContent.contentId"/>
<log level="info" message="genCompDocInstance 2> rootInstanceContent: ${rootInstanceContent}"/>
<else>
@@ -56,7 +56,7 @@ under the License.
<entity-one entity-name="Content" value-name="existingContent">
<field-map field-name="contentId" env-name="parameters.rootInstanceContentId"/>
</entity-one>
<if-not-empty field-name="existingContent">
<if-not-empty field="existingContent">
<add-error>
<fail-message message="Instance compdoc Content for ${parameters.rootInstanceContentId} already exists"/>
</add-error>
@@ -144,13 +144,13 @@ under the License.
<simple-method method-name="persistCompDoc" short-description="Create CompDoc">
<!-- create the compdoc Content entity -->
<set-service-fields service-name="persistContentAndAssoc" map-name="parameters" to-map-name="persistMap"/>
<if-not-empty field-name="parameters.mimeTypeId">
<if-not-empty field="parameters.mimeTypeId">
<if>
<condition>
<or>
<if-compare field-name="parameters.mimeTypeId" operator="equals" value="application/msword"/>
<if-compare field-name="parameters.mimeTypeId" operator="equals" value="application/pdf"/>
<if-compare field-name="parameters.mimeTypeId" operator="equals" value="application/octet-stream"/>
<if-compare field="parameters.mimeTypeId" operator="equals" value="application/msword"/>
<if-compare field="parameters.mimeTypeId" operator="equals" value="application/pdf"/>
<if-compare field="parameters.mimeTypeId" operator="equals" value="application/octet-stream"/>
</or>
</condition>
<then>
@@ -159,10 +159,10 @@ under the License.
<else-if>
<condition>
<or>
<if-compare field-name="parameters.mimeTypeId" operator="equals" value="image/jpeg"/>
<if-compare field-name="parameters.mimeTypeId" operator="equals" value="image/gif"/>
<if-compare field-name="parameters.mimeTypeId" operator="equals" value="image/tiff"/>
<if-compare field-name="parameters.mimeTypeId" operator="equals" value="image/png"/>
<if-compare field="parameters.mimeTypeId" operator="equals" value="image/jpeg"/>
<if-compare field="parameters.mimeTypeId" operator="equals" value="image/gif"/>
<if-compare field="parameters.mimeTypeId" operator="equals" value="image/tiff"/>
<if-compare field="parameters.mimeTypeId" operator="equals" value="image/png"/>
</or>
</condition>
<then>
@@ -171,7 +171,7 @@ under the License.
</else-if>
<else-if>
<condition>
<if-compare field-name="parameters.mimeTypeId" operator="equals" value="application/vnd.ofbiz.survey"/>
<if-compare field="parameters.mimeTypeId" operator="equals" value="application/vnd.ofbiz.survey"/>
</condition>
<then>
<set value="SURVEY" field="persistMap.dataResourceTypeId"/>
@@ -179,7 +179,7 @@ under the License.
</else-if>
<else-if>
<condition>
<if-compare field-name="parameters.mimeTypeId" operator="equals" value="application/vnd.ofbiz.survey.response"/>
<if-compare field="parameters.mimeTypeId" operator="equals" value="application/vnd.ofbiz.survey.response"/>
</condition>
<then>
<set value="SURVEY_RESPONSE" field="persistMap.dataResourceTypeId"/>
@@ -202,7 +202,7 @@ under the License.
</iterate-map>
<log level="info" message="pResults : ${pResults}"/>
<if-not-empty field-name="pResults.contentIdTo">
<if-not-empty field="pResults.contentIdTo">
<set from-field="pResults.contentIdTo" field="resequenceMap.contentIdTo"/>
<set value="COMPDOC_PART" field="resequenceMap.typeList[]"/>
<set value="10" field="resequenceMap.seqInc" type="Integer"/>
@@ -212,8 +212,8 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="persistMap.contentTypeId" operator="equals" value="COMPDOC_TEMPLATE"/>
<if-compare field-name="persistMap.contentTypeId" operator="equals" value="TEMPLATE"/>
<if-compare field="persistMap.contentTypeId" operator="equals" value="COMPDOC_TEMPLATE"/>
<if-compare field="persistMap.contentTypeId" operator="equals" value="TEMPLATE"/>
</or>
</condition>
<then>
@@ -224,8 +224,8 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="persistMap.contentTypeId" operator="equals" value="COMPDOC_INSTANCE"/>
<if-compare field-name="persistMap.contentTypeId" operator="equals" value="DOCUMENT"/>
<if-compare field="persistMap.contentTypeId" operator="equals" value="COMPDOC_INSTANCE"/>
<if-compare field="persistMap.contentTypeId" operator="equals" value="DOCUMENT"/>
</or>
</condition>
<then>
@@ -247,8 +247,8 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="persistMap.contentTypeId" operator="equals" value="COMPDOC_TEMPLATE"/>
<if-compare field-name="persistMap.contentTypeId" operator="equals" value="TEMPLATE"/>
<if-compare field="persistMap.contentTypeId" operator="equals" value="COMPDOC_TEMPLATE"/>
<if-compare field="persistMap.contentTypeId" operator="equals" value="TEMPLATE"/>
</or>
</condition>
<then>
@@ -397,7 +397,7 @@ under the License.
<order-by field-name="contentRevisionSeqId DESC"/>
</entity-condition>
<log level="info" message="contentRevisionList: ${contentRevisionList}"/>
<if-not-empty field-name="contentRevisionList">
<if-not-empty field="contentRevisionList">
<set field="newEntity" from-field="contentRevisionList[0]"/>
<set field="incrementedSeq" from-field="newEntity.contentRevisionSeqId"/>
<else>
@@ -406,7 +406,7 @@ under the License.
</if-not-empty>
<log level="info" message="incrementedSeq(0): ${incrementedSeq}"/>
<log level="info" message="ContentRevision(0): ${newEntity}"/>
<if-not-empty field-name="incrementedSeq">
<if-not-empty field="incrementedSeq">
<calculate field-name="incrementedSeq" type="Long">
<calcop operator="add">
<calcop operator="get" field-name="incrementedSeq"/>
@@ -431,7 +431,7 @@ under the License.
<set field="newEntity.contentRevisionSeqId" from-field="paddedSeqId"/>
<log level="info" message="ContentRevision(1): ${newEntity}"/>
<create-value value-name="newEntity"/>
<if-not-empty field-name="parameters.itemContentId">
<if-not-empty field="parameters.itemContentId">
<make-value entity-name="ContentRevisionItem" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set field="newEntity.contentRevisionSeqId" from-field="paddedSeqId"/>
@@ -451,12 +451,12 @@ under the License.
</condition-list>
<order-by field-name="-contentRevisionSeqId"/>
</entity-condition>
<if-not-empty field-name="contentRevisionItems">
<if-not-empty field="contentRevisionItems">
<set field="contentRevisionItem" from-field="contentRevisionItems[0]"/>
<entity-one entity-name="Content" value-name="content" use-cache="true">
<field-map field-name="contentId" env-name="contentRevisionItem.itemContentId"/>
</entity-one>
<if-not-empty field-name="content">
<if-not-empty field="content">
<entity-one entity-name="DataResource" value-name="dataResource" use-cache="true">
<field-map field-name="dataResourceId" env-name="content.dataResourceId"/>
</entity-one>
@@ -473,7 +473,7 @@ under the License.
<entity-one entity-name="Content" value-name="content" use-cache="true">
<field-map field-name="contentId" env-name="contentRevisionItem.itemContentId"/>
</entity-one>
<if-not-empty field-name="content">
<if-not-empty field="content">
<entity-one entity-name="DataResource" value-name="dataResource" use-cache="true">
<field-map field-name="dataResourceId" env-name="content.dataResourceId"/>
</entity-one>
@@ -493,7 +493,7 @@ under the License.
<make-value entity-name="ContentApproval" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.contentApprovalId">
<if-empty field="newEntity.contentApprovalId">
<sequenced-id-to-env sequence-name="ContentApproval" env-name="newEntity.contentApprovalId"/>
</if-empty>
<create-value value-name="newEntity"/>
@@ -555,7 +555,7 @@ under the License.
<order-by field-name="-sequenceNum"/>
</entity-condition>
<log level="info" message="contentApprovalList2: ${contentApprovalList2}"/>
<if-not-empty field-name="contentApprovalList2">
<if-not-empty field="contentApprovalList2">
<set from-field="contentApprovalList2[0].contentApprovalId" field="contentApprovalId"/>
<set from-field="contentApprovalList2[0]" field="contentApproval"/>
<log level="info" message="contentApproval: ${contentApproval}"/>
@@ -627,7 +627,7 @@ under the License.
<set from-field="maxContentApprovalList[0].maxContentRevisionSeqId" field="maxContentRevisionSeqId"/>
<if>
<condition>
<if-empty field-name="maxContentRevisionSeqId"/>
<if-empty field="maxContentRevisionSeqId"/>
</condition>
<then>
<!-- if an instance track, check to see if there any new or deleted records on the template -->
@@ -675,13 +675,13 @@ under the License.
<sequenced-id-to-env sequence-name="ContentApproval" env-name="contentApproval.contentApprovalId"/>
<set from-field="nowTimestamp" field="contentApproval.approvalDate"/>
<if-compare field-name="content.contentTypeId" operator="equals" value="COMPDOC_INSTANCE">
<if-compare field="content.contentTypeId" operator="equals" value="COMPDOC_INSTANCE">
<if>
<!-- not rejected, soft rejected or approved, reset to ready -->
<condition>
<or>
<if-compare field-name="finalApprovalStatusId" operator="equals" value="CNTAP_REJECTED"/>
<if-compare field-name="finalApprovalStatusId" operator="equals" value="CNTAP_APPROVED"/>
<if-compare field="finalApprovalStatusId" operator="equals" value="CNTAP_REJECTED"/>
<if-compare field="finalApprovalStatusId" operator="equals" value="CNTAP_APPROVED"/>
</or>
</condition>
<then>
@@ -691,10 +691,10 @@ under the License.
<!-- soft rejected, reset rejected (shouldn't be any) and soft rejected entities to ready -->
<condition>
<and>
<if-compare field-name="finalApprovalStatusId" operator="equals" value="CNTAP_SOFT_REJ"/>
<if-compare field="finalApprovalStatusId" operator="equals" value="CNTAP_SOFT_REJ"/>
<or>
<if-compare field-name="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_SOFT_REJ"/>
<if-compare field-name="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_REJECTED"/>
<if-compare field="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_SOFT_REJ"/>
<if-compare field="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_REJECTED"/>
</or>
</and>
</condition>
@@ -706,8 +706,8 @@ under the License.
<condition>
<and>
<!-- soft rejected and current record is not soft/rejected, keep currentstatus -->
<if-compare field-name="finalApprovalStatusId" operator="equals" value="CNTAP_SOFT_REJ"/>
<if-compare field-name="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_APPROVED"/>
<if-compare field="finalApprovalStatusId" operator="equals" value="CNTAP_SOFT_REJ"/>
<if-compare field="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_APPROVED"/>
</and>
</condition>
<then>
@@ -748,7 +748,7 @@ under the License.
<condition-expr field-name="roleTypeId" operator="equals" env-name="templateContentApproval.roleTypeId" ignore-if-empty="true"/>
</condition-list>
</entity-condition>
<if-empty field-name="newContentApprovalList">
<if-empty field="newContentApprovalList">
<clone-value value-name="templateContentApproval" new-value-name="contentApproval"/>
<set from-field="thisContentRevisionSeqId" field="contentApproval.contentRevisionSeqId"/>
<set field="contentApproval.contentId" from-field="thisContentId"/>
@@ -769,13 +769,13 @@ under the License.
<find-by-primary-key entity-name="ContentApproval" value-name="contentApproval" map-name="contentApprovalPK" use-cache="true"/>
<set field="partyId" from-field="parameters.userLogin.partyId"/>
<log level="info" message="contentApproval: ${contentApproval}"/>
<if-compare field-name="contentApproval.partyId" value="${partyId}" operator="equals">
<if-compare field="contentApproval.partyId" value="${partyId}" operator="equals">
<set field="approvalPermExists" value="true"/>
<log level="info" message="approvalPermExists: ${approvalPermExists}"/>
<field-to-result result-name="approvalPermExists" field-name="approvalPermExists"/>
<return/>
</if-compare>
<if-not-empty field-name="contentApproval.roleTypeId">
<if-not-empty field="contentApproval.roleTypeId">
<now-timestamp-to-env env-name="nowTimestamp"/>
<entity-condition entity-name="ContentRole" list-name="contentRoleList">
<condition-list combine="and">
@@ -788,7 +788,7 @@ under the License.
</condition-list>
</condition-list>
</entity-condition>
<if-not-empty field-name="contentRoleList">
<if-not-empty field="contentRoleList">
<set field="approvalPermExists" value="true"/>
<field-to-result field-name="approvalPermExists" result-name="approvalPermExists"/>
<return/>
@@ -828,7 +828,7 @@ under the License.
<if>
<condition>
<not>
<if-empty field-name="contentApprovalList"/>
<if-empty field="contentApprovalList"/>
</not>
</condition>
<then>
@@ -837,8 +837,8 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_SOFT_REJ"/>
<if-compare field-name="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_REJECTED"/>
<if-compare field="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_SOFT_REJ"/>
<if-compare field="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_REJECTED"/>
</or>
</condition>
<then>
@@ -846,7 +846,7 @@ under the License.
</then>
<else-if>
<condition>
<if-compare field-name="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_APPROVED"/>
<if-compare field="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_APPROVED"/>
</condition>
<then>
<set value="CNTAP_APPROVED" field="finalApprovalStatusId"/>
@@ -855,8 +855,8 @@ under the License.
<else-if>
<condition>
<and>
<if-compare field-name="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_READY"/>
<if-compare field-name="finalApprovalStatusId" operator="equals" value="CNTAP_APPROVED"/>
<if-compare field="existingContentApproval.approvalStatusId" operator="equals" value="CNTAP_READY"/>
<if-compare field="finalApprovalStatusId" operator="equals" value="CNTAP_APPROVED"/>
</and>
</condition>
<then>
@@ -914,7 +914,7 @@ under the License.
<order-by field-name="-sequenceNum"/>
</entity-condition>
<log level="info" message="contentApprovalList2: ${contentApprovalList2}"/>
<if-not-empty field-name="contentApprovalList2">
<if-not-empty field="contentApprovalList2">
<set from-field="contentApprovalList2[0].contentApprovalId" field="contentApprovalId"/>
<log level="info" message="contentApproval: ${contentApproval}"/>
<set field="contentApprovalIdList[]" from-field="contentApprovalId"/>
@@ -939,7 +939,7 @@ under the License.
<order-by field-name="-contentRevisionSeqId"/>
</entity-condition>
<log level="info" message="contentRevisions: ${contentRevisions}"/>
<if-not-empty field-name="contentRevisions">
<if-not-empty field="contentRevisions">
<set from-field="contentRevisions[0].contentRevisionSeqId" field="mostRecentRevisionSeqId"/>
</if-not-empty>
<field-to-result field-name="mostRecentRevisionSeqId" result-name="mostRecentRevisionSeqId"/>
@@ -55,7 +55,7 @@ under the License.
<result-to-field field-name="contentId" result-name="contentId"/>
<result-to-request request-name="contentId" result-name="contentId"/>
</call-service>
<if-empty field-name="contentId">
<if-empty field="contentId">
<add-error>
<fail-message message="Permission not granted."/>
</add-error>
@@ -63,7 +63,7 @@ under the License.
<check-errors/>
<session-to-field session-name="currentEntityMap" field-name="entityMap"/>
<if-not-empty field-name="entityMap">
<if-not-empty field="entityMap">
<set field="currentEntityMap" from-field="entityMap"/>
</if-not-empty>
<make-value entity-name="Content" value-name="contentPK"/>
@@ -73,7 +73,7 @@ under the License.
<log level="always" message="currentEntityMap: ${currentEntityMap}"/>
<field-to-session session-name="currentEntityMap" field-name="currentEntityMap"/>
<if-not-empty field-name="contentPurposeTypeId" map-name="parameters">
<if-not-empty field="parameters.contentPurposeTypeId">
<log level="always" message="contentPurposeTypeId: ${parameters.contentPurposeTypeId}"/>
<make-value entity-name="ContentPurpose" value-name="newContentPurpose"/>
<set field="newContentPurpose.contentPurposeTypeId" from-field="parameters.contentPurposeTypeId"/>
@@ -23,7 +23,7 @@ under the License.
<make-value entity-name="Content" value-name="currentContent"/>
<set-pk-fields map-name="parameters" value-name="currentContent"/>
<set-nonpk-fields map-name="parameters" value-name="currentContent"/>
<if-empty field-name="contentId" map-name="currentContent">
<if-empty field="currentContent.contentId">
<make-next-seq-id seq-field-name="contentId" value-name="currentContent"/>
<sequenced-id-to-env env-name="id" sequence-name="Content"/>
<set field="currentContent.contentId" from-field="id"/>
@@ -45,16 +45,16 @@ under the License.
<log level="always" message="permissionStatus:${permissionStatus}"/>
<if-compare field-name="permissionStatus" operator="not-equals" type="String" value="granted">
<if-compare field="permissionStatus" operator="not-equals" type="String" value="granted">
<add-error>
<fail-message message="Permission not granted."/>
</add-error>
</if-compare>
<check-errors/>
<if-compare field-name="permissionStatus" operator="equals" type="String" value="granted">
<if-compare field="permissionStatus" operator="equals" type="String" value="granted">
<create-value value-name="currentContent"/>
<if-not-empty field-name="contentPurposeTypeId" map-name="parameters">
<if-not-empty field="parameters.contentPurposeTypeId">
<make-value entity-name="ContentPurpose" value-name="newContentPurpose"/>
<set field="newContentPurpose.contentPurposeTypeId" from-field="parameters.contentPurposeTypeId"/>
<set field="newContentPurpose.contentId" from-field="currentContent.contentId"/>
@@ -27,12 +27,12 @@
<set-nonpk-fields value-name="content" map-name="parameters"/>
<set-pk-fields value-name="content" map-name="parameters"/>
<if-empty field-name="content.contentId">
<if-empty field="content.contentId">
<sequenced-id-to-env sequence-name="Content" env-name="contentId"/>
<set field="content.contentId" from-field="contentId"/>
</if-empty>
<if-empty field-name="content.statusId">
<if-empty field="content.statusId">
<!-- get the first status item -->
<entity-and entity-name="StatusItem" list-name="contentStatus">
<field-map field-name="statusTypeId" value="CONTENT_STATUS"/>
@@ -79,7 +79,7 @@
<set field="assoc.contentId" from-field="parameters.contentIdFrom" default-value="${parameters.contentId}" />
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="assoc.fromDate">
<if-empty field="assoc.fromDate">
<set field="assoc.fromDate" from-field="nowTimestamp"/>
</if-empty>
@@ -117,13 +117,13 @@
<entity-one entity-name="Content" value-name="content"/>
<field-to-result field-name="content.statusId" result-name="oldStatusId"/>
<if-compare-field field-name="content.statusId" operator="not-equals" to-field-name="parameters.statusId">
<if-compare-field field="content.statusId" to-field="parameters.statusId" operator="not-equals">
<entity-one entity-name="StatusValidChange" value-name="statusChange" auto-field-map="false">
<field-map field-name="statusId" env-name="content.statusId"/>
<field-map field-name="statusIdTo" env-name="parameters.statusId"/>
</entity-one>
<if-empty field-name="statusChange">
<if-empty field="statusChange">
<add-error><fail-message message="Cannot change from ${content.statusId} to ${parameters.statusId}"/></add-error>
<log level="error" message="Cannot change from ${content.statusId} to ${parameters.statusId}"/>
<check-errors/>
@@ -140,7 +140,7 @@
<call-service service-name="getContent" in-map-name="getC">
<result-to-field result-name="view" field-name="content"/>
</call-service>
<if-not-empty field-name="content.dataResourceId">
<if-not-empty field="content.dataResourceId">
<set-service-fields service-name="getElectronicText" map-name="content" to-map-name="getEt"/>
<call-service service-name="getElectronicText" in-map-name="getEt">
<result-to-field result-name="textData" field-name="et.textData"/>
@@ -202,7 +202,7 @@
<find-by-primary-key value-name="currentContent" entity-name="Content" map-name="pk" />
<find-by-primary-key value-name="fromContent" entity-name="Content" map-name="pk" />
<if-compare field-name="permissionStatus" operator="equals" type="String" value="granted">
<if-compare field="permissionStatus" operator="equals" type="String" value="granted">
<make-value entity-name="ContentAssoc" value-name="newContentAssoc"/>
<set from-field="parameters.contentIdTo" field="newContentAssoc.contentIdTo"/>
<set from-field="parameters.contentIdFrom" field="newContentAssoc.contentId"/>
@@ -212,12 +212,12 @@
<now-timestamp-to-env env-name="newContentAssoc.createdDate"/>
<now-timestamp-to-env env-name="newContentAssoc.lastModifiedDate"/>
<if-empty map-name="parameters" field-name="fromDate" >
<if-empty field="parameters.fromDate">
<now-timestamp-to-env env-name="parameters.fromDate"/>
<to-string map-name="parameters" field-name="fromDate" />
</if-empty>
<set from-field="parameters.fromDate" field="newContentAssoc.fromDate"/>
<if-not-empty map-name="parameters" field-name="thruDate" >
<if-not-empty field="parameters.thruDate">
<set from-field="parameters.thruDate" field="newContentAssoc.thruDate"/>
</if-not-empty>
<create-value value-name="newContentAssoc" />
@@ -248,13 +248,13 @@
<!-- Methods for ContentRole -->
<simple-method method-name="createContentRole" short-description="Create Content Role">
<if-empty field-name="parameters.fromDate">
<if-empty field="parameters.fromDate">
<now-timestamp-to-env env-name="parameters.fromDate"/>
</if-empty>
<make-value value-name="partyRolePK" entity-name="PartyRole"/>
<set-pk-fields value-name="partyRolePK" map-name="parameters"/>
<find-by-primary-key entity-name="PartyRole" map-name="partyRolePK" value-name="partyRole"/>
<if-empty field-name="partyRole">
<if-empty field="partyRole">
<make-value entity-name="PartyRole" map-name="partyRolePK" value-name="partyRole"/>
<create-value value-name="partyRole"/>
</if-empty>
@@ -263,7 +263,7 @@
<make-value entity-name="ContentRole" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<find-by-primary-key entity-name="ContentRole" map-name="newEntity" value-name="contentRole"/>
<if-empty field-name="contentRole">
<if-empty field="contentRole">
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<create-value value-name="newEntity"/>
</if-empty>
@@ -359,7 +359,7 @@
<make-value entity-name="ContentPurposeType" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="contentPurposeTypeId" map-name="newEntity">
<if-empty field="newEntity.contentPurposeTypeId">
<make-next-seq-id seq-field-name="contentPurposeTypeId" value-name="newEntity"/>
</if-empty>
<create-value value-name="newEntity"/>
@@ -542,7 +542,7 @@
<log level="always" message="${parameters}"/>
<if-not-empty field-name="uploadedFile" map-name="parameters">
<if-not-empty field="parameters.uploadedFile">
<log level="always" message="Uploaded file found; processing sub-content"/>
<set-service-fields service-name="createContentFromUploadedFile" map-name="parameters" to-map-name="uploadContext"/>
<set field="uploadContext.ownerContentId" from-field="parameters.parentContentId"/>
@@ -570,7 +570,7 @@
</iterate>
<if>
<condition>
<if-empty field-name="mapKey" map-name="parameters"/>
<if-empty field="parameters.mapKey"/>
</condition>
<then>
<field-to-result field-name="result" result-name="contentAssocs"/>
@@ -631,17 +631,17 @@
</check-permission>
<check-errors/>
<if-not-empty field-name="subjectDataResourceId" map-name="parameters">
<if-not-empty field="parameters.subjectDataResourceId">
<set from-field="parameters.subjectDataResourceId" field="updateSubjectEt.dataResourceId"/>
<set from-field="parameters.subject" field="updateSubjectEt.textData"/>
<call-service service-name="updateElectronicText" in-map-name="updateSubjectEt"/>
</if-not-empty>
<if-not-empty field-name="plainBodyDataResourceId" map-name="parameters">
<if-not-empty field="parameters.plainBodyDataResourceId">
<set from-field="parameters.plainBodyDataResourceId" field="updatePlainBodyEt.dataResourceId"/>
<set from-field="parameters.plainBody" field="updatePlainBodyEt.textData"/>
<call-service service-name="updateElectronicText" in-map-name="updatePlainBodyEt"/>
</if-not-empty>
<if-not-empty field-name="htmlBodyDataResourceId" map-name="parameters">
<if-not-empty field="parameters.htmlBodyDataResourceId">
<set from-field="parameters.htmlBodyDataResourceId" field="updateHtmlBodyEt.dataResourceId"/>
<set from-field="parameters.htmlBody" field="updateHtmlBodyEt.textData"/>
<call-service service-name="updateElectronicText" in-map-name="updateHtmlBodyEt"/>
@@ -669,7 +669,7 @@
</check-permission>
<check-errors/>
<if-not-empty field-name="fileDataResourceId" map-name="parameters">
<if-not-empty field="parameters.fileDataResourceId">
<set from-field="parameters.fileDataResourceId" field="updateFile.dataResourceId"/>
<set from-field="parameters.file" field="updateFile.dataResourceContent"/>
<call-service service-name="updateOtherDataResource" in-map-name="updateFile"/>
@@ -708,7 +708,7 @@
</check-permission>
<check-errors/>
<if-not-empty field-name="textDataResourceId" map-name="parameters">
<if-not-empty field="parameters.textDataResourceId">
<set from-field="parameters.textDataResourceId" field="updateSimpleText.dataResourceId"/>
<set from-field="parameters.text" field="updateSimpleText.textData"/>
<call-service service-name="updateElectronicText" in-map-name="updateSimpleText"/>
@@ -734,26 +734,26 @@
<entity-one entity-name="DataResource" value-name="dataResource">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-empty field-name="dataResource">
<if-empty field="dataResource">
<add-error><fail-message message="No data resource found for ID: [$parameters.dataResourceId}]"/></add-error>
</if-empty>
<check-errors/>
<set-service-fields service-name="createContent" map-name="parameters" to-map-name="createContentMap"/>
<if-empty field-name="createContentMap.contentName">
<if-empty field="createContentMap.contentName">
<set field="createContentMap.contentName" from-field="dataResource.dataResourceName"/>
</if-empty>
<if-empty field-name="createContentMap.contentTypeId">
<if-empty field="createContentMap.contentTypeId">
<set field="createContentMap.contentTypeId" value="DOCUMENT"/>
</if-empty>
<if-empty field-name="createContentMap.statusId">
<if-empty field="createContentMap.statusId">
<set field="createContentMap.statusId" value="CTNT_INITIAL_DRAFT"/>
</if-empty>
<if-empty field-name="createContentMap.mimeTypeId">
<if-empty field="createContentMap.mimeTypeId">
<set from-field="dataResource.mimeTypeId" field="createContentMap.mimeTypeId"/>
</if-empty>
@@ -780,7 +780,7 @@
<now-timestamp-to-env env-name="nowTimestamp"/>
<set-service-fields to-map-name="persistIn" service-name="persistContentAndAssoc" map-name="parameters"/>
<!-- let's take a guess at what the dataResourceTypeId should be if it is empty -->
<if-empty field-name="persistIn.dataResourceTypeId">
<if-empty field="persistIn.dataResourceTypeId">
<log level="info" message="persistIn.drMimeTypeId: ${persistIn.drMimeTypeId}" />
<if-regexp expr="text.*" field-name="persistIn.drMimeTypeId">
<set field="persistIn.dataResourceTypeId" value="ELECTRONIC_TEXT"/>
@@ -843,7 +843,7 @@
<make-value entity-name="CommEventContentAssoc" value-name="commEventContentAssoc" />
<set-pk-fields value-name="commEventContentAssoc" map-name="parameters"/>
<set-nonpk-fields value-name="commEventContentAssoc" map-name="parameters"/>
<if-empty field-name="commEventContentAssoc.fromDate">
<if-empty field="commEventContentAssoc.fromDate">
<now-timestamp-to-env env-name="commEventContentAssoc.fromDate"/>
</if-empty>
<create-value value-name="commEventContentAssoc" />
@@ -856,7 +856,7 @@
<make-value entity-name="CommEventContentAssoc" value-name="pkCommEventContentAssoc" />
<set-pk-fields value-name="pkCommEventContentAssoc" map-name="parameters"/>
<find-by-primary-key value-name="commEventContentAssoc" map-name="pkCommEventContentAssoc" entity-name="CommEventContentAssoc"/>
<if-empty field-name="commEventContentAssoc">
<if-empty field="commEventContentAssoc">
<add-error>
<fail-message message="CommEventContentAssoc entity not found for update, communicationEventId: ${parameters.communicationEventId} and contentId: ${parameters.contentId}"/>
</add-error>
@@ -869,7 +869,7 @@
<make-value entity-name="CommEventContentAssoc" value-name="pkCommEventContentAssoc" />
<set-pk-fields value-name="pkCommEventContentAssoc" map-name="parameters"/>
<find-by-primary-key value-name="commEventContentAssoc" map-name="pkCommEventContentAssoc" entity-name="CommEventContentAssoc"/>
<if-empty field-name="commEventContentAssoc">
<if-empty field="commEventContentAssoc">
<add-error>
<fail-message message="CommEventContentAssoc entity not found for removal, communicationEventId: ${parameters.communicationEventId} and contentId: ${parameters.contentId}"/>
</add-error>
@@ -882,7 +882,7 @@
<call-service service-name="createContent" in-map-name="contentData">
<result-to-field result-name="contentId" field-name="newContentId"/>
</call-service>
<if-not-empty field-name="newContentId">
<if-not-empty field="newContentId">
<set-service-fields service-name="createContentAssoc" map-name="parameters" to-map-name="assocData"/>
<set field="assocData.contentId" from-field="newContentId"/>
<call-service service-name="createContentAssoc" in-map-name="assocData">
@@ -898,12 +898,12 @@
<entity-one entity-name="DataResource" value-name="resultData.dataResource">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-not-empty field-name="resultData.dataResource">
<if-compare field-name="resultData.dataResource.dataResourceTypeId" value="ELECTRONIC_TEXT" operator="equals">
<if-not-empty field="resultData.dataResource">
<if-compare field="resultData.dataResource.dataResourceTypeId" value="ELECTRONIC_TEXT" operator="equals">
<get-related-one value-name="resultData.dataResource" relation-name="ElectronicText"
to-value-name="resultData.electronicText"/>
</if-compare>
<if-compare field-name="resultData.dataResource.dataResourceTypeId" value="IMAGE_OBJECT" operator="equals">
<if-compare field="resultData.dataResource.dataResourceTypeId" value="IMAGE_OBJECT" operator="equals">
<get-related-one value-name="resultData.dataResource" relation-name="ImageDataResource"
to-value-name="resultData.imageDataResource"/>
</if-compare>
@@ -915,8 +915,8 @@
<entity-one entity-name="Content" value-name="resultDataContent.content">
<field-map field-name="contentId" env-name="parameters.contentId"/>
</entity-one>
<if-not-empty field-name="resultDataContent.content">
<if-not-empty field-name="resultDataContent.content.dataResourceId">
<if-not-empty field="resultDataContent.content">
<if-not-empty field="resultDataContent.content.dataResourceId">
<set field="parameters.dataResourceId" from-field="resultDataContent.content.dataResourceId"/>
<call-simple-method method-name="getDataResource"/>
<set field="resultDataContent.dataResource" from-field="resultData.dataResource"/>
@@ -938,12 +938,12 @@
<condition>
<and>
<not>
<if-empty field-name="parameters.contentIdFrom"/>
<if-empty field="parameters.contentIdFrom"/>
</not>
<not>
<if-empty field-name="parameters.contentId"/>
<if-empty field="parameters.contentId"/>
</not>
<if-empty field-name="parameters.contentIdTo"/>
<if-empty field="parameters.contentIdTo"/>
</and>
</condition>
<then>
@@ -954,7 +954,7 @@
<else-if>
<condition>
<not>
<if-empty field-name="parameters.contentIdTo"/>
<if-empty field="parameters.contentIdTo"/>
</not>
</condition>
<then>
@@ -973,7 +973,7 @@
<set field="contentAssocTypeId" from-field="parameters.contentAssocTypeId"/>
<set field="origContentAssocTypeId" from-field="parameters.contentAssocTypeId"/>
<set field="ownerContentId" from-field="parameters.threadContentId"/>
<if-compare operator="equals" field-name="origContentAssocTypeId" value="PUBLISH_LINK">
<if-compare operator="equals" field="origContentAssocTypeId" value="PUBLISH_LINK">
<set field="ownerContentId" from-field="parameters.pubPtContentId"/>
</if-compare>
<set field="contentIdFrom" from-field="parameters.contentIdFrom"/>
@@ -996,7 +996,7 @@
<field field-name="intSubStringLen" type="int"/>
</call-object-method>
<log level="info" message="subDescript:${subDescript}"/>
<if-compare operator="equals" field-name="contentAssocTypeId" value="PUBLISH_LINK">
<if-compare operator="equals" field="contentAssocTypeId" value="PUBLISH_LINK">
<set field="ownerContentId" from-field="pubPtContentId"/>
</if-compare>
@@ -1005,10 +1005,10 @@
<condition>
<and>
<not>
<if-empty field-name="parameters.uploadedFile"/>
<if-empty field="parameters.uploadedFile"/>
</not>
<not>
<if-empty field-name="parameters.textData"/>
<if-empty field="parameters.textData"/>
</not>
</and>
</condition>
@@ -1039,7 +1039,7 @@
<if>
<condition>
<not>
<if-empty field-name="parameters.uploadedFile"/>
<if-empty field="parameters.uploadedFile"/>
</not>
</condition>
<then>
@@ -1063,7 +1063,7 @@
<result-to-field result-name="contentId" field-name="imageContentId"/>
</call-service>
<if-empty field-name="contentId">
<if-empty field="contentId">
<set field="contentIdFrom" from-field="imageContentId"/>
<set field="contentId" from-field="imageContentId"/>
<set field="contentAssocTypeId" value="SUB_CONTENT"/>
@@ -1074,7 +1074,7 @@
<if>
<condition>
<not>
<if-empty field-name="parameters.textData"/>
<if-empty field="parameters.textData"/>
</not>
</condition>
<then>
@@ -1097,7 +1097,7 @@
<result-to-field result-name="contentId" field-name="textContentId"/>
</call-service>
<if-empty field-name="contentId">
<if-empty field="contentId">
<set field="contentIdFrom" from-field="textContentId"/>
<set field="contentId" from-field="textContentId"/>
<set field="contentAssocTypeId" value="SUB_CONTENT"/>
@@ -1110,10 +1110,10 @@
<condition>
<and>
<not>
<if-empty field-name="contentId"/>
<if-empty field="contentId"/>
</not>
<not>
<if-empty field-name="parameters.summaryData"/>
<if-empty field="parameters.summaryData"/>
</not>
</and>
</condition>
@@ -1137,7 +1137,7 @@
</if>
<!-- If a response, still link it to the publish point -->
<if-compare operator="equals" field-name="origContentAssocTypeId" value="RESPONSE">
<if-compare operator="equals" field="origContentAssocTypeId" value="RESPONSE">
<set field="contentAssocMap.contentId" from-field="pubPtContentId"/>
<set field="contentAssocMap.contentIdTo" from-field="contentId"/>
<set field="contentAssocMap.contentAssocTypeId" value="RESPONSE"/>
@@ -1167,10 +1167,10 @@
<condition>
<and>
<not>
<if-empty field-name="parameters.mainAction"/>
<if-empty field="parameters.mainAction"/>
</not>
<not>
<if-empty field-name="parameters.userLogin"/>
<if-empty field="parameters.userLogin"/>
</not>
</and>
</condition>
@@ -1184,7 +1184,7 @@
</call-service>
</then>
</if>
<if-compare operator="equals" field-name="hasPermission" value="true" type="Boolean">
<if-compare operator="equals" field="hasPermission" value="true" type="Boolean">
<set field="contentViewList[]" from-field="view"/>
</if-compare>
</iterate>
@@ -26,7 +26,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.dataResourceId">
<if-empty field="newEntity.dataResourceId">
<sequenced-id-to-env sequence-name="DataResource" env-name="dataResourceId"/>
<set field="newEntity.dataResourceId" from-field="dataResourceId"/>
</if-empty>
@@ -37,11 +37,11 @@ under the License.
<set field="newEntity.lastModifiedDate" from-field="nowTimestamp"/>
<set field="newEntity.createdDate" from-field="nowTimestamp"/>
<if-empty field-name="parameters.dataTemplateTypeId">
<if-empty field="parameters.dataTemplateTypeId">
<set field="newEntity.dataTemplateTypeId" value="NONE"/>
</if-empty>
<if-empty field-name="content.statusId">
<if-empty field="content.statusId">
<!-- get the first status item -->
<entity-and entity-name="StatusItem" list-name="contentStatus">
<field-map field-name="statusTypeId" value="CONTENT_STATUS"/>
@@ -167,7 +167,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp"/>
</if-empty>
@@ -508,20 +508,20 @@ under the License.
<set field="currentContent" from-field="parameters.content" />
<log level="always" message="GETELECTRONICTEXT, currentContent:${currentContent}"/>
<if-empty field-name="currentContent">
<if-not-empty field-name="contentId" map-name="parameters">
<if-empty field="currentContent">
<if-not-empty field="parameters.contentId">
<set field="contextA.contentId" from-field="parameters.contentId" />
<find-by-primary-key value-name="currentContent" entity-name="Content"
map-name="contextA" use-cache="true" />
</if-not-empty>
<if-empty field-name="currentContent" >
<if-empty field="currentContent">
<add-error>
<fail-message message="Neither content nor contentId supplied." />
</add-error>
</if-empty>
</if-empty>
<check-errors/>
<if-empty field-name="dataResourceId" map-name="currentContent">
<if-empty field="currentContent.dataResourceId">
<add-error>
<fail-message message="No dataResourceId found" />
</add-error>
@@ -531,7 +531,7 @@ under the License.
<set field="contextB.dataResourceId" from-field="currentContent.dataResourceId" />
<find-by-primary-key value-name="eText" entity-name="ElectronicText"
map-name="contextB" use-cache="true" />
<if-empty field-name="eText" >
<if-empty field="eText">
<add-error>
<fail-message message="Electronic Text not found." />
</add-error>
@@ -547,16 +547,16 @@ under the License.
<simple-method method-name="attachUploadToDataResource" short-description="Attach an uploaded file to a data resource">
<set field="isUpdate" value="false"/>
<property-to-field resource="content.properties" property="content.upload.always.local.file" field-name="forceLocal"/>
<if-compare field-name="forceLocal" value="true" operator="equals">
<if-compare field="forceLocal" value="true" operator="equals">
<set field="parameters.dataResourceTypeId" value="LOCAL_FILE"/>
</if-compare>
<if-empty field-name="parameters.dataResourceTypeId">
<if-empty field="parameters.dataResourceTypeId">
<!-- create default behavior -->
<if>
<condition>
<not>
<if-empty field-name="parameters._uploadedFile_contentType"/>
<if-empty field="parameters._uploadedFile_contentType"/>
</not>
</condition>
<then>
@@ -594,49 +594,49 @@ under the License.
</if>
</if-empty>
<if-compare field-name="parameters.dataResourceTypeId" value="LOCAL_FILE" operator="equals">
<if-compare field="parameters.dataResourceTypeId" value="LOCAL_FILE" operator="equals">
<call-simple-method method-name="saveLocalFileDateResource"/>
<return/>
</if-compare>
<if-compare field-name="parameters.dataResourceTypeId" value="IMAGE_OBJECT" operator="equals">
<if-compare field="parameters.dataResourceTypeId" value="IMAGE_OBJECT" operator="equals">
<entity-one entity-name="ImageDataResource" value-name="dataResObj">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-not-empty field-name="dataResObj">
<if-not-empty field="dataResObj">
<set field="isUpdate" value="true"/>
</if-not-empty>
<call-simple-method method-name="saveImageObjectDateResource"/>
<return/>
</if-compare>
<if-compare field-name="parameters.dataResourceTypeId" value="VIDEO_OBJECT" operator="equals">
<if-compare field="parameters.dataResourceTypeId" value="VIDEO_OBJECT" operator="equals">
<entity-one entity-name="VideoDataResource" value-name="dataResObj">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-not-empty field-name="dataResObj">
<if-not-empty field="dataResObj">
<set field="isUpdate" value="true"/>
</if-not-empty>
<call-simple-method method-name="saveVideoObjectDateResource"/>
<return/>
</if-compare>
<if-compare field-name="parameters.dataResourceTypeId" value="AUDIO_OBJECT" operator="equals">
<if-compare field="parameters.dataResourceTypeId" value="AUDIO_OBJECT" operator="equals">
<entity-one entity-name="AudioDataResource" value-name="dataResObj">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-not-empty field-name="dataResObj">
<if-not-empty field="dataResObj">
<set field="isUpdate" value="true"/>
</if-not-empty>
<call-simple-method method-name="saveAudioObjectDateResource"/>
<return/>
</if-compare>
<if-compare field-name="parameters.dataResourceTypeId" value="OTHER_OBJECT" operator="equals">
<if-compare field="parameters.dataResourceTypeId" value="OTHER_OBJECT" operator="equals">
<entity-one entity-name="OtherDataResource" value-name="dataResObj">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-not-empty field-name="dataResObj">
<if-not-empty field="dataResObj">
<set field="isUpdate" value="true"/>
</if-not-empty>
<call-simple-method method-name="saveOtherObjectDateResource"/>
@@ -652,19 +652,19 @@ under the License.
<entity-one entity-name="DataResource" value-name="dataResource">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-empty field-name="dataResource">
<if-empty field="dataResource">
<add-error><fail-message message="No data resource found for ID: [$parameters.dataResourceId}]"/></add-error>
</if-empty>
<if>
<condition>
<if-empty field-name="_uploadedFile_fileName" map-name="parameters"/>
<if-empty field="parameters._uploadedFile_fileName"/>
</condition>
<then>
<if>
<condition>
<or>
<if-empty field-name="isUpdate"/>
<if-compare field-name="isUpdate" value="Y" operator="not-equals"/>
<if-empty field="isUpdate"/>
<if-compare field="isUpdate" value="Y" operator="not-equals"/>
</or>
</condition>
<then>
@@ -692,7 +692,7 @@ under the License.
<set from-field="parameters._uploadedFile_fileName" field="dataResource.dataResourceName"/>
<set from-field="parameters._uploadedFile_contentType" field="dataResource.mimeTypeId"/>
<set value="${uploadPath}/${dataResource.dataResourceId}" field="dataResource.objectInfo"/>
<if-not-empty field-name="extension">
<if-not-empty field="extension">
<set value="${uploadPath}/${dataResource.dataResourceId}.${extension.fileExtensionId}" field="dataResource.objectInfo"/>
</if-not-empty>
<set value="LOCAL_FILE" field="dataResource.dataResourceTypeId"/>
@@ -712,19 +712,19 @@ under the License.
<entity-one entity-name="DataResource" value-name="dataResource">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-empty field-name="dataResource">
<if-empty field="dataResource">
<add-error><fail-message message="No data resource found for ID: [$parameters.dataResourceId}]"/></add-error>
</if-empty>
<if>
<condition>
<if-empty field-name="_uploadedFile_fileName" map-name="parameters"/>
<if-empty field="parameters._uploadedFile_fileName"/>
</condition>
<then>
<if>
<condition>
<or>
<if-empty field-name="isUpdate"/>
<if-compare field-name="isUpdate" value="Y" operator="not-equals"/>
<if-empty field="isUpdate"/>
<if-compare field="isUpdate" value="Y" operator="not-equals"/>
</or>
</condition>
<then>
@@ -752,7 +752,7 @@ under the License.
<set-service-fields service-name="createOtherDataResource" map-name="dataResource" to-map-name="serviceContext"/>
<set from-field="parameters.uploadedFile" field="serviceContext.dataResourceContent"/>
<if-compare field-name="isUpdate" value="true" operator="equals">
<if-compare field="isUpdate" value="true" operator="equals">
<call-service service-name="updateOtherDataResource" in-map-name="serviceContext"/>
<else>
<call-service service-name="createOtherDataResource" in-map-name="serviceContext"/>
@@ -768,19 +768,19 @@ under the License.
<entity-one entity-name="DataResource" value-name="dataResource">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-empty field-name="dataResource">
<if-empty field="dataResource">
<add-error><fail-message message="No data resource found for ID: [$parameters.dataResourceId}]"/></add-error>
</if-empty>
<if>
<condition>
<if-empty field-name="_uploadedFile_fileName" map-name="parameters"/>
<if-empty field="parameters._uploadedFile_fileName"/>
</condition>
<then>
<if>
<condition>
<or>
<if-empty field-name="isUpdate"/>
<if-compare field-name="isUpdate" value="Y" operator="not-equals"/>
<if-empty field="isUpdate"/>
<if-compare field="isUpdate" value="Y" operator="not-equals"/>
</or>
</condition>
<then>
@@ -808,7 +808,7 @@ under the License.
<set-service-fields service-name="createImageDataResource" map-name="dataResource" to-map-name="serviceContext"/>
<set from-field="parameters.uploadedFile" field="serviceContext.imageData"/>
<if-compare field-name="isUpdate" value="true" operator="equals">
<if-compare field="isUpdate" value="true" operator="equals">
<call-service service-name="updateImageDataResource" in-map-name="serviceContext"/>
<else>
<call-service service-name="createImageDataResource" in-map-name="serviceContext"/>
@@ -824,19 +824,19 @@ under the License.
<entity-one entity-name="DataResource" value-name="dataResource">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-empty field-name="dataResource">
<if-empty field="dataResource">
<add-error><fail-message message="No data resource found for ID: [$parameters.dataResourceId}]"/></add-error>
</if-empty>
<if>
<condition>
<if-empty field-name="_uploadedFile_fileName" map-name="parameters"/>
<if-empty field="parameters._uploadedFile_fileName"/>
</condition>
<then>
<if>
<condition>
<or>
<if-empty field-name="isUpdate"/>
<if-compare field-name="isUpdate" value="Y" operator="not-equals"/>
<if-empty field="isUpdate"/>
<if-compare field="isUpdate" value="Y" operator="not-equals"/>
</or>
</condition>
<then>
@@ -864,7 +864,7 @@ under the License.
<set-service-fields service-name="createVideoDataResource" map-name="dataResource" to-map-name="serviceContext"/>
<set from-field="parameters.uploadedFile" field="serviceContext.videoData"/>
<if-compare field-name="isUpdate" value="true" operator="equals">
<if-compare field="isUpdate" value="true" operator="equals">
<call-service service-name="updateVideoDataResource" in-map-name="serviceContext"/>
<else>
<call-service service-name="createVideoDataResource" in-map-name="serviceContext"/>
@@ -880,19 +880,19 @@ under the License.
<entity-one entity-name="DataResource" value-name="dataResource">
<field-map field-name="dataResourceId" env-name="parameters.dataResourceId"/>
</entity-one>
<if-empty field-name="dataResource">
<if-empty field="dataResource">
<add-error><fail-message message="No data resource found for ID: [$parameters.dataResourceId}]"/></add-error>
</if-empty>
<if>
<condition>
<if-empty field-name="_uploadedFile_fileName" map-name="parameters"/>
<if-empty field="parameters._uploadedFile_fileName"/>
</condition>
<then>
<if>
<condition>
<or>
<if-empty field-name="isUpdate"/>
<if-compare field-name="isUpdate" value="Y" operator="not-equals"/>
<if-empty field="isUpdate"/>
<if-compare field="isUpdate" value="Y" operator="not-equals"/>
</or>
</condition>
<then>
@@ -920,7 +920,7 @@ under the License.
<set-service-fields service-name="createAudioDataResource" map-name="dataResource" to-map-name="serviceContext"/>
<set from-field="parameters.uploadedFile" field="serviceContext.audioData"/>
<if-compare field-name="isUpdate" value="true" operator="equals">
<if-compare field="isUpdate" value="true" operator="equals">
<call-service service-name="updateAudioDataResource" in-map-name="serviceContext"/>
<else>
<call-service service-name="createAudioDataResource" in-map-name="serviceContext"/>
@@ -40,7 +40,7 @@ under the License.
<result-to-field field-name="contentId" result-name="contentId"/>
<result-to-field field-name="dataResourceId" result-name="dataResourceId"/>
</call-service>
<if-empty field-name="contentId">
<if-empty field="contentId">
<add-error>
<fail-message message="Permission not granted."/>
</add-error>
@@ -66,7 +66,7 @@ under the License.
<call-service in-map-name="context" service-name="checkContentPermission">
<result-to-field field-name="permissionStatus" result-name="permissionStatus"/>
</call-service>
<if-compare field-name="permissionStatus" operator="not-equals" value="granted" type="String">
<if-compare field="permissionStatus" operator="not-equals" value="granted" type="String">
<add-error>
<fail-message message="Permission not granted."/>
</add-error>
@@ -127,7 +127,7 @@ under the License.
<set field="context2.contentIdTo" from-field="parameters.contentIdTo"/>
<set field="context2.mapKey" from-field="parameters.mapKey"/>
<if-not-empty map-name="context2" field-name="activeContentId">
<if-not-empty field="context2.activeContentId">
<call-service in-map-name="context2" service-name="deactivateAssocs">
<result-to-field field-name="deactivateList" result-name="deactivateList"/>
</call-service>
@@ -223,7 +223,7 @@ under the License.
<set field="context2.contentIdTo" from-field="formInput.contentIdTo"/>
<set field="context2.mapKey" from-field="formInput.mapKey"/>
<if-not-empty map-name="context2" field-name="activeContentId">
<if-not-empty field="context2.activeContentId">
<call-service in-map-name="context2" service-name="deactivateAssocs">
<result-to-field field-name="deactivateList" result-name="deactivateList"/>
</call-service>
@@ -281,7 +281,7 @@ under the License.
<set field="context2.contentIdTo" from-field="parameters.contentIdTo"/>
<set field="context2.mapKey" from-field="parameters.mapKey"/>
<if-not-empty map-name="context2" field-name="activeContentId">
<if-not-empty field="context2.activeContentId">
<call-service in-map-name="context2" service-name="deactivateAssocs">
<result-to-field field-name="deactivateList" result-name="deactivateList"/>
</call-service>
@@ -41,9 +41,9 @@
<if>
<condition>
<and>
<if-empty field-name="parameters.ownerContentId"/>
<if-empty field="parameters.ownerContentId"/>
<not>
<if-empty field-name="parameters.contentIdFrom"/>
<if-empty field="parameters.contentIdFrom"/>
</not>
</and>
</condition>
@@ -56,14 +56,14 @@
<if>
<condition>
<not>
<if-compare field-name="hasPermission" value="true" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="true" type="Boolean" operator="equals"/>
</not>
</condition>
<then>
<if>
<!-- view content -->
<condition>
<if-compare field-name="parameters.mainAction" value="VIEW" operator="equals"/>
<if-compare field="parameters.mainAction" value="VIEW" operator="equals"/>
</condition>
<then>
<call-simple-method method-name="viewContentPermission"/>
@@ -71,11 +71,11 @@
<else-if>
<!-- create content -->
<condition>
<if-compare field-name="parameters.mainAction" value="CREATE" operator="equals"/>
<if-compare field="parameters.mainAction" value="CREATE" operator="equals"/>
</condition>
<then>
<!-- setup default operation -->
<if-empty field-name="parameters.contentOperationId">
<if-empty field="parameters.contentOperationId">
<set field="contentOperationId" value="CONTENT_CREATE"/>
</if-empty>
<call-simple-method method-name="createContentPermission"/>
@@ -84,11 +84,11 @@
<else-if>
<!-- update content -->
<condition>
<if-compare field-name="parameters.mainAction" value="UPDATE" operator="equals"/>
<if-compare field="parameters.mainAction" value="UPDATE" operator="equals"/>
</condition>
<then>
<!-- setup default operation -->
<if-empty field-name="parameters.contentOperationId">
<if-empty field="parameters.contentOperationId">
<set field="contentOperationId" value="CONTENT_UPDATE"/>
</if-empty>
<call-simple-method method-name="updateContentPermission"/>
@@ -108,7 +108,7 @@
<simple-method method-name="viewContentPermission" short-description="Check user can view content">
<!-- if called directly check the main permission -->
<if-empty field-name="hasPermission">
<if-empty field="hasPermission">
<set field="primaryPermission" value="CONTENTMGR"/>
<set field="mainAction" value="VIEW"/>
<call-simple-method method-name="genericBasePermissionCheck"
@@ -123,19 +123,19 @@
<!-- must have the security permission to continue -->
<if>
<condition>
<if-compare field-name="hasPermission" value="true" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="true" type="Boolean" operator="equals"/>
</condition>
<then>
<!-- if no operation is passed; we use the CONTENT_VIEW operation -->
<if-empty field-name="parameters.contentOperationId">
<if-empty field="parameters.contentOperationId">
<set field="parameters.contentOperationId" value="CONTENT_VIEW"/>
</if-empty>
<!-- contentId is required for update checking -->
<if-empty field-name="contentId">
<if-empty field="contentId">
<set field="contentId" from-field="parameters.contentId"/>
</if-empty>
<if-empty field-name="contentId">
<if-empty field="contentId">
<add-error><fail-message message="Content Permission Service VIEW requires a contentId!"/></add-error>
</if-empty>
<check-errors/>
@@ -156,7 +156,7 @@
<simple-method method-name="createContentPermission" short-description="Check user can create new content">
<!-- if called directly check the main permission -->
<if-empty field-name="hasPermission">
<if-empty field="hasPermission">
<set field="primaryPermission" value="CONTENTMGR"/>
<set field="mainAction" value="CREATE"/>
<call-simple-method method-name="genericBasePermissionCheck"
@@ -164,17 +164,17 @@
</if-empty>
<!-- ownerContentId can be set from a calling method -->
<if-empty field-name="ownerContentId">
<if-empty field="ownerContentId">
<set field="ownerContentId" from-field="parameters.ownerContentId"/>
</if-empty>
<!-- operation ID can be set from the calling method -->
<if-empty field-name="contentOperationId">
<if-empty field="contentOperationId">
<set field="contentOperationId" from-field="parameters.contentOperationId"/>
</if-empty>
<!-- statusId can be set from the calling method -->
<if-empty field-name="statusId">
<if-empty field="statusId">
<set field="statusId" from-field="parameters.statusId"/>
</if-empty>
@@ -186,7 +186,7 @@
<!-- must have the security permission to continue -->
<if>
<condition>
<if-compare field-name="hasPermission" value="true" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="true" type="Boolean" operator="equals"/>
</condition>
<then>
<log level="verbose" message="Found necessary ROLE permission: ${primaryPermission}_${mainAction} :: ${contentOperationId}"/>
@@ -195,7 +195,7 @@
<if>
<condition>
<not>
<if-empty field-name="contentOperationId"/>
<if-empty field="contentOperationId"/>
</not>
</condition>
<then>
@@ -208,15 +208,15 @@
<if>
<condition>
<or>
<if-empty field-name="contentOperationId"/>
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals"/>
<if-empty field="contentOperationId"/>
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals"/>
</or>
</condition>
<then>
<if>
<condition>
<not>
<if-empty field-name="ownerContentId"/>
<if-empty field="ownerContentId"/>
</not>
</condition>
<then>
@@ -226,7 +226,7 @@
<call-simple-method method-name="checkOwnership"/>
<if>
<condition>
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals"/>
</condition>
<then>
<!-- no permission on this parent; check the parent's parent(s) -->
@@ -234,9 +234,9 @@
<condition>
<!-- iterate until either we have permission or there are no more parents -->
<and>
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals"/>
<not>
<if-empty field-name="checkId"/>
<if-empty field="checkId"/>
</not>
</and>
</condition>
@@ -247,7 +247,7 @@
<if>
<condition>
<not>
<if-empty field-name="currentContent.ownerContentId"/>
<if-empty field="currentContent.ownerContentId"/>
</not>
</condition>
<then>
@@ -278,7 +278,7 @@
<simple-method method-name="updateContentPermission" short-description="Check user can update existing content">
<!-- if called directly check the main permission -->
<if-empty field-name="hasPermission">
<if-empty field="hasPermission">
<set field="primaryPermission" value="CONTENTMGR"/>
<set field="mainAction" value="UPDATE"/>
<call-simple-method method-name="genericBasePermissionCheck"
@@ -286,21 +286,21 @@
</if-empty>
<!-- contentId is required for update checking -->
<if-empty field-name="contentId">
<if-empty field="contentId">
<set field="contentId" from-field="parameters.contentId"/>
</if-empty>
<if-empty field-name="contentId">
<if-empty field="contentId">
<add-error><fail-message message="Content Permission Service UPDATE requires a contentId!"/></add-error>
</if-empty>
<check-errors/>
<!-- ownerContentId can be set from a calling method -->
<if-empty field-name="ownerContentId">
<if-empty field="ownerContentId">
<set field="ownerContentId" from-field="parameters.ownerContentId"/>
</if-empty>
<!-- operation ID can be set from the calling method -->
<if-empty field-name="contentOperationId">
<if-empty field="contentOperationId">
<set field="contentOperationId" from-field="parameters.contentOperationId"/>
</if-empty>
@@ -312,7 +312,7 @@
<!-- must have permission to continue -->
<if>
<condition>
<if-compare field-name="hasPermission" value="true" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="true" type="Boolean" operator="equals"/>
</condition>
<then>
<log level="verbose" message="Found necessary ROLE permission: ${primaryPermission}_${mainAction}"/>
@@ -321,7 +321,7 @@
<entity-one entity-name="Content" value-name="thisContent">
<field-map field-name="contentId"/>
</entity-one>
<if-empty field-name="thisContent">
<if-empty field="thisContent">
<add-error><fail-message message="Content record not found for ID [${contentId}]"/></add-error>
<check-errors/>
</if-empty>
@@ -330,7 +330,7 @@
<if>
<condition>
<not>
<if-empty field-name="contentOperationId"/>
<if-empty field="contentOperationId"/>
</not>
</condition>
<then>
@@ -344,8 +344,8 @@
<if>
<condition>
<or>
<if-empty field-name="contentOperationId"/>
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals"/>
<if-empty field="contentOperationId"/>
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals"/>
</or>
</condition>
@@ -360,9 +360,9 @@
<condition>
<and>
<not>
<if-empty field-name="ownerContentId"/>
<if-empty field="ownerContentId"/>
</not>
<if-compare-field field-name="ownerContentId" operator="not-equals" to-field-name="ownerContentId" map-name="thisContent"/>
<if-compare-field field="thisContent.ownerContentId" to-field="ownerContentId" operator="not-equals"/>
</and>
</condition>
<then>
@@ -371,7 +371,7 @@
<call-simple-method method-name="checkOwnership"/>
<if>
<condition>
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals"/>
</condition>
<then>
<!-- no permission on this parent; check the parent's parent(s) -->
@@ -379,9 +379,9 @@
<condition>
<!-- iterate until either we have permission or there are no more parents -->
<and>
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals"/>
<not>
<if-empty field-name="checkId"/>
<if-empty field="checkId"/>
</not>
</and>
</condition>
@@ -392,7 +392,7 @@
<if>
<condition>
<not>
<if-empty field-name="currentContent.ownerContentId"/>
<if-empty field="currentContent.ownerContentId"/>
</not>
</condition>
<then>
@@ -423,14 +423,14 @@
<!-- resetting the permission flag -->
<set field="hasPermission" type="Boolean" value="false"/>
<if-empty field-name="contentOperationId">
<if-empty field="contentOperationId">
<add-error><fail-message message="Required field 'contentOperationId' is missing in simple method call [checkContentOperationSecurity]"/></add-error>
</if-empty>
<if-empty field-name="contentPurposeTypeId">
<if-empty field="contentPurposeTypeId">
<set field="contentPurposeTypeId" from-field="parameters.contentPurposeTypeId"/>
</if-empty>
<if-empty field-name="contentPurposeTypeId">
<if-empty field="contentPurposeTypeId">
<set field="contentPurposeTypeId" value="_NA_"/>
</if-empty>
@@ -444,9 +444,9 @@
<if>
<condition>
<and>
<if-compare value="CONTENT_CREATE" field-name="contentOperationId" operator="equals"/>
<if-compare value="CONTENT_CREATE" field="contentOperationId" operator="equals"/>
<not>
<if-empty field-name="contentPurposeTypeId"/>
<if-empty field="contentPurposeTypeId"/>
</not>
</and>
</condition>
@@ -476,7 +476,7 @@
</iterate>
<!-- check the _NA_ purpose but only if no other purposes were found -->
<if-empty field-name="contentPurposes">
<if-empty field="contentPurposes">
<entity-condition entity-name="ContentPurposeOperation" list-name="operations">
<condition-list combine="and">
<condition-expr field-name="contentPurposeTypeId" operator="equals" value="_NA_"/>
@@ -494,7 +494,7 @@
<if>
<condition>
<if-empty field-name="operations"/>
<if-empty field="operations"/>
</condition>
<!-- there are no ContentPurposeOperation entries for this operation/purpose; default is approve permission -->
<then>
@@ -508,14 +508,14 @@
<!-- check each operation security -->
<iterate entry-name="operation" list-name="operations">
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals">
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals">
<!-- reset the checkId if needed -->
<if>
<condition>
<and>
<if-empty field-name="checkId"/>
<if-empty field="checkId"/>
<not>
<if-empty field-name="toCheckContentId"/>
<if-empty field="toCheckContentId"/>
</not>
</and>
</condition>
@@ -530,12 +530,12 @@
<if>
<condition>
<or>
<if-compare field-name="operation.statusId" value="_NA_" operator="equals"/>
<if-compare field="operation.statusId" value="_NA_" operator="equals"/>
<and>
<not>
<if-empty field-name="statusId"/>
<if-empty field="statusId"/>
</not>
<if-compare-field field-name="operation.statusId" operator="equals" to-field-name="statusId"/>
<if-compare-field field="operation.statusId" to-field="statusId" operator="equals"/>
</and>
</or>
</condition>
@@ -544,16 +544,16 @@
<!-- first check passed; now we test for the role membership(s) -->
<iterate entry-name="thisPartyId" list-name="partyIdList">
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals">
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals">
<set field="checkRoleTypeId" from-field="operation.roleTypeId"/>
<set field="checkPartyId" from-field="thisPartyId"/>
<!-- reset the checkId if needed -->
<if>
<condition>
<and>
<if-empty field-name="checkId"/>
<if-empty field="checkId"/>
<not>
<if-empty field-name="toCheckContentId"/>
<if-empty field="toCheckContentId"/>
</not>
</and>
</condition>
@@ -567,9 +567,9 @@
<if>
<condition>
<and>
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals"/>
<not>
<if-empty field-name="checkId"/>
<if-empty field="checkId"/>
</not>
</and>
</condition>
@@ -579,9 +579,9 @@
<condition>
<!-- iterate until either we have permission or there are no more parents -->
<and>
<if-compare field-name="hasPermission" value="false" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="false" type="Boolean" operator="equals"/>
<not>
<if-empty field-name="checkId"/>
<if-empty field="checkId"/>
</not>
</and>
</condition>
@@ -592,7 +592,7 @@
<if>
<condition>
<not>
<if-empty field-name="currentContent.ownerContentId"/>
<if-empty field="currentContent.ownerContentId"/>
</not>
</condition>
<then>
@@ -624,10 +624,10 @@
<!-- resetting the permission flag -->
<set field="hasPermission" type="Boolean" value="false"/>
<if-empty field-name="checkId">
<if-empty field="checkId">
<add-error><fail-message message="Required field 'checkId' is missing in simple method call [checkOwnership]"/></add-error>
</if-empty>
<if-empty field-name="partyId">
<if-empty field="partyId">
<set field="partyId" from-field="userLogin.partyId"/>
</if-empty>
<check-errors/>
@@ -643,7 +643,7 @@
<if>
<condition>
<not>
<if-compare field-name="hasPermission" value="true" operator="equals"/>
<if-compare field="hasPermission" value="true" operator="equals"/>
</not>
</condition>
<then>
@@ -665,19 +665,19 @@
<log level="verbose" message="checkRoleSecurity: just reset hasPermission value to false!"/>
<!-- roleEntity is required to determine which content role table to look: ContentRole, DataResourceRole, etc -->
<if-empty field-name="roleEntity">
<if-empty field="roleEntity">
<add-error><fail-message message="Required field 'roleEntity' is missing in simple method call [checkRoleSecurity]"/></add-error>
</if-empty>
<!-- roleEntityField is required to determine the pk field to check; contentId, dataResourceId, etc -->
<if-empty field-name="roleEntityField">
<if-empty field="roleEntityField">
<add-error><fail-message message="Required field 'roleEntityField' is missing in simple method call [checkRoleSecurity]"/></add-error>
</if-empty>
<!-- setting the env field contentId is required for this simple method -->
<if-empty field-name="checkId">
<if-empty field="checkId">
<add-error><fail-message message="Required field 'checkId' is missing in simple method call [checkRoleSecurity]"/></add-error>
</if-empty>
<!-- the party ID to check is required for this check -->
<if-empty field-name="checkPartyId">
<if-empty field="checkPartyId">
<add-error><fail-message message="Required field 'checkPartyId' is missing in simple method call [checkRoleSecurity]"/></add-error>
</if-empty>
<check-errors/>
@@ -688,9 +688,9 @@
<condition>
<and>
<not>
<if-empty field-name="checkRoleTypeId"/>
<if-empty field="checkRoleTypeId"/>
</not>
<if-compare field-name="checkRoleTypeId" value="_NA_" operator="equals"/>
<if-compare field="checkRoleTypeId" value="_NA_" operator="equals"/>
</and>
</condition>
<then>
@@ -703,7 +703,7 @@
<if>
<condition>
<not>
<if-empty field-name="checkRoleTypeId"/>
<if-empty field="checkRoleTypeId"/>
</not>
</condition>
<then>
@@ -742,7 +742,7 @@
<if>
<condition>
<not>
<if-empty field-name="foundRoles"/>
<if-empty field="foundRoles"/>
</not>
</condition>
<then>
@@ -756,7 +756,7 @@
<!-- method to get the content purposes -->
<simple-method method-name="findAllContentPurposes" short-description="Find all content purposes for the specified content">
<if-empty field-name="checkId">
<if-empty field="checkId">
<add-error><fail-message message="Required field 'checkId' (contentId) is missing in simple method call [findAllContentPurposes]"/></add-error>
</if-empty>
<check-errors/>
@@ -778,7 +778,7 @@
<!-- method to get content associations -->
<simple-method method-name="findAllParentContent" short-description="Finds all associated parent content">
<if-empty field-name="contentId">
<if-empty field="contentId">
<add-error><fail-message message="Required field 'contentId' is missing in simple method call [findAllParentContent]"/></add-error>
</if-empty>
<check-errors/>
@@ -789,4 +789,4 @@
<filter-list-by-date list-name="assocs"/>
<field-to-result field-name="assocs" result-name="contentAssocList"/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -32,14 +32,14 @@
<if>
<condition>
<not>
<if-compare field-name="hasPermission" value="true" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="true" type="Boolean" operator="equals"/>
</not>
</condition>
<then>
<if>
<!-- view data resource -->
<condition>
<if-compare field-name="parameters.mainAction" value="VIEW" operator="equals"/>
<if-compare field="parameters.mainAction" value="VIEW" operator="equals"/>
</condition>
<then>
<call-simple-method method-name="viewDataResourcePermission"/>
@@ -47,7 +47,7 @@
<else-if>
<!-- create data resource -->
<condition>
<if-compare field-name="parameters.mainAction" value="CREATE" operator="equals"/>
<if-compare field="parameters.mainAction" value="CREATE" operator="equals"/>
</condition>
<then>
<call-simple-method method-name="createDataResourcePermission"/>
@@ -56,7 +56,7 @@
<else-if>
<!-- update data resource -->
<condition>
<if-compare field-name="parameters.mainAction" value="UPDATE" operator="equals"/>
<if-compare field="parameters.mainAction" value="UPDATE" operator="equals"/>
</condition>
<then>
<call-simple-method method-name="updateDataResourcePermission"/>
@@ -77,7 +77,7 @@
<!-- DataResource View Permission -->
<simple-method method-name="viewDataResourcePermission" short-description="Check user can view data resource">
<!-- if called directly check the main permission -->
<if-empty field-name="hasPermission">
<if-empty field="hasPermission">
<set field="primaryPermission" value="CONTENTMGR"/>
<set field="mainAction" value="VIEW"/>
<call-simple-method method-name="genericBasePermissionCheck"
@@ -93,7 +93,7 @@
<!-- DataResource Create Permission -->
<simple-method method-name="createDataResourcePermission" short-description="Check user can create new content">
<!-- if called directly check the main permission -->
<if-empty field-name="hasPermission">
<if-empty field="hasPermission">
<set field="primaryPermission" value="CONTENTMGR"/>
<set field="mainAction" value="CREATE"/>
<call-simple-method method-name="genericBasePermissionCheck"
@@ -111,7 +111,7 @@
<!-- DataResource Update Permission -->
<simple-method method-name="updateDataResourcePermission" short-description="Check user can update existing content">
<!-- if called directly check the main permission -->
<if-empty field-name="hasPermission">
<if-empty field="hasPermission">
<set field="primaryPermission" value="CONTENTMGR"/>
<set field="mainAction" value="UPDATE"/>
<call-simple-method method-name="genericBasePermissionCheck"
@@ -119,10 +119,10 @@
</if-empty>
<!-- dataResourceId is required for update checking -->
<if-empty field-name="dataResourceId">
<if-empty field="dataResourceId">
<set field="dataResourceId" from-field="parameters.dataResourceId"/>
</if-empty>
<if-empty field-name="dataResourceId">
<if-empty field="dataResourceId">
<add-error><fail-message message="DataResource Permission Service UPDATE requires a dataResourceId!"/></add-error>
</if-empty>
<check-errors/>
@@ -135,7 +135,7 @@
<!-- must have permission to continue -->
<if>
<condition>
<if-compare field-name="hasPermission" value="true" type="Boolean" operator="equals"/>
<if-compare field="hasPermission" value="true" type="Boolean" operator="equals"/>
</condition>
<then>
<log level="verbose" message="Found necessary ROLE permission: ${primaryPermission}_${mainAction}"/>
@@ -144,7 +144,7 @@
<entity-one entity-name="DataResource" value-name="thisDataResource">
<field-map field-name="dataResourceId"/>
</entity-one>
<if-empty field-name="thisDataResource">
<if-empty field="thisDataResource">
<add-error><fail-message message="DataResource record not found for ID [${dataResourceId}]"/></add-error>
<check-errors/>
</if-empty>
@@ -155,4 +155,4 @@
</then>
</if>
</simple-method>
</simple-methods>
</simple-methods>
@@ -195,8 +195,8 @@
<condition>
<and>
<if-compare field-name="surveyQuestionTypeId" value="ENUMERATION" operator="equals"/>
<if-empty field-name="enumTypeId"/>
<if-compare field="surveyQuestionTypeId" value="ENUMERATION" operator="equals"/>
<if-empty field="enumTypeId"/>
</and>
</condition>
<then>
@@ -206,8 +206,8 @@
<if>
<condition>
<and>
<if-compare field-name="surveyQuestionTypeId" value="GEO" operator="equals"/>
<if-empty field-name="geoId"/>
<if-compare field="surveyQuestionTypeId" value="GEO" operator="equals"/>
<if-empty field="geoId"/>
</and>
</condition>
<then>
@@ -229,8 +229,8 @@
<if>
<condition>
<and>
<if-compare field-name="parameters.surveyQuestionTypeId" value="ENUMERATION" operator="equals"/>
<if-empty field-name="parameters.enumTypeId"/>
<if-compare field="parameters.surveyQuestionTypeId" value="ENUMERATION" operator="equals"/>
<if-empty field="parameters.enumTypeId"/>
</and>
</condition>
<then>
@@ -240,8 +240,8 @@
<if>
<condition>
<and>
<if-compare field-name="parameters.surveyQuestionTypeId" value="GEO" operator="equals"/>
<if-empty field-name="parameters.geoId"/>
<if-compare field="parameters.surveyQuestionTypeId" value="GEO" operator="equals"/>
<if-empty field="parameters.geoId"/>
</and>
</condition>
<then>
@@ -312,7 +312,7 @@
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp"/>
</if-empty>
@@ -442,7 +442,7 @@
<simple-method method-name="createSurveyResponse" short-description="Create Survey Response" login-required="false">
<!-- lookup the survey -->
<entity-one entity-name="Survey" value-name="survey" use-cache="true"/>
<if-empty field-name="survey">
<if-empty field="survey">
<add-error><fail-message message="No survey found for survey ID: ${surveyLookup.surveyId}"/></add-error>
<check-errors/>
</if-empty>
@@ -451,27 +451,27 @@
<entity-and entity-name="SurveyQuestionAndAppl" list-name="surveyQuestionAndApplList" use-cache="true">
<field-map field-name="surveyId" env-name="survey.surveyId"/>
</entity-and>
<if-empty field-name="surveyQuestionAndApplList">
<if-empty field="surveyQuestionAndApplList">
<add-error><fail-message message="No questions found for survey ID: ${survey.surveyId}"/></add-error>
<check-errors/>
</if-empty>
<!-- check if anonymous is allowed and if not that we have a partyId -->
<if-compare field-name="isAnonymous" map-name="survey" operator="not-equals" value="Y">
<if-empty field-name="parameters.partyId">
<if-compare field="survey.isAnonymous" operator="not-equals" value="Y">
<if-empty field="parameters.partyId">
<add-error><fail-message message="Anonymous response to this survey is not allowed (you must be logged in)"/></add-error>
<check-errors/>
</if-empty>
</if-compare>
<!-- if this is a single use and we have a partyId check for existing responses -->
<if-compare field-name="survey.allowMultiple" operator="not-equals" value="Y">
<if-not-empty field-name="parameters.partyId">
<if-compare field="survey.allowMultiple" operator="not-equals" value="Y">
<if-not-empty field="parameters.partyId">
<entity-and entity-name="SurveyResponse" list-name="existingResponses">
<field-map field-name="partyId" env-name="parameters.partyId"/>
<field-map field-name="surveyId" env-name="survey.surveyId"/>
</entity-and>
<if-not-empty field-name="existingResponses">
<if-not-empty field="existingResponses">
<add-error><fail-message message="You have already responded to this survey; multiple responses are not allowed"/></add-error>
<check-errors/>
</if-not-empty>
@@ -479,7 +479,7 @@
</if-compare>
<!-- make sure we have answers to check -->
<if-empty field-name="parameters.answers">
<if-empty field="parameters.answers">
<add-error><fail-message message="No answers were found"/></add-error>
<check-errors/>
</if-empty>
@@ -489,9 +489,9 @@
<iterate entry-name="surveyQuestionAndAppl" list-name="surveyQuestionAndApplList">
<!-- for validation get SurveyMultiResp and SurveyMultiRespColumn entries and if exist process for each surveyMultiRespColId -->
<get-related-one value-name="surveyQuestionAndAppl" relation-name="SurveyMultiResp" to-value-name="surveyMultiResp" use-cache="true"/>
<if-not-empty field-name="surveyMultiResp">
<if-not-empty field="surveyMultiResp">
<!-- if the surveyQuestionAndAppl has a surveyMultiRespColId, then just look for one answer with that ID -->
<if-empty field-name="surveyQuestionAndAppl.surveyMultiRespColId">
<if-empty field="surveyQuestionAndAppl.surveyMultiRespColId">
<get-related value-name="surveyMultiResp" relation-name="SurveyMultiRespColumn" list-name="surveyMultiRespColumnList" use-cache="true"/>
<iterate entry-name="surveyMultiRespColumn" list-name="surveyMultiRespColumnList">
<set field="answerFieldName" value="answers.${surveyQuestionAndAppl.surveyQuestionId}_${surveyMultiRespColumn.surveyMultiRespColId}"/>
@@ -513,21 +513,21 @@
<now-timestamp-to-env env-name="nowTimestamp"/>
<!-- create/update the response -->
<if-compare field-name="survey.allowUpdate" operator="equals" value="Y">
<if-not-empty field-name="parameters.surveyResponseId">
<if-compare field="survey.allowUpdate" operator="equals" value="Y">
<if-not-empty field="parameters.surveyResponseId">
<set from-field="parameters.surveyResponseId" field="lookupRespMap.surveyResponseId"/>
<find-by-primary-key entity-name="SurveyResponse" map-name="lookupRespMap" value-name="surveyResponse"/>
</if-not-empty>
</if-compare>
<if-empty field-name="surveyResponse">
<if-empty field="surveyResponse">
<make-value value-name="surveyResponse" entity-name="SurveyResponse"/>
<sequenced-id-to-env sequence-name="SurveyResponse" env-name="surveyResponse.surveyResponseId"/>
<set-nonpk-fields value-name="surveyResponse" map-name="parameters"/>
<create-value value-name="surveyResponse"/>
</if-empty>
<if-empty field-name="surveyResponse.responseDate">
<if-empty field="surveyResponse.responseDate">
<set from-field="nowTimestamp" field="surveyResponse.responseDate"/>
</if-empty>
<set from-field="nowTimestamp" field="surveyResponse.lastModifiedDate"/>
@@ -536,7 +536,7 @@
<field-to-result field-name="surveyResponse.surveyResponseId" result-name="surveyResponseId"/>
<!-- if a dataResourceId was passed in use it to set DataResource.relatedDetailId to the surveyResponse.surveyResponseId -->
<if-not-empty field-name="parameters.dataResourceId">
<if-not-empty field="parameters.dataResourceId">
<entity-one entity-name="DataResource" value-name="dataResource"/>
<set field="dataResource.relatedDetailId" from-field="surveyResponse.surveyResponseId"/>
<store-value value-name="dataResource"/>
@@ -550,9 +550,9 @@
<condition>
<and>
<not>
<if-empty field-name="existingAnswer.surveyMultiRespColId"/>
<if-empty field="existingAnswer.surveyMultiRespColId"/>
</not>
<if-compare operator="not-equals" field-name="existingAnswer.surveyMultiRespColId" value="_NA_"/>
<if-compare operator="not-equals" field="existingAnswer.surveyMultiRespColId" value="_NA_"/>
</and>
</condition>
<then>
@@ -566,9 +566,9 @@
<iterate entry-name="surveyQuestionAndAppl" list-name="surveyQuestionAndApplList">
<!-- for process inputs get SurveyMultiResp and SurveyMultiRespColumn entries and if exist process for each surveyMultiRespColId -->
<get-related-one value-name="surveyQuestionAndAppl" relation-name="SurveyMultiResp" to-value-name="surveyMultiResp" use-cache="true"/>
<if-not-empty field-name="surveyMultiResp">
<if-not-empty field="surveyMultiResp">
<!-- if the surveyQuestionAndAppl has a surveyMultiRespColId, then just look for one answer with that ID -->
<if-empty field-name="surveyQuestionAndAppl.surveyMultiRespColId">
<if-empty field="surveyQuestionAndAppl.surveyMultiRespColId">
<get-related value-name="surveyMultiResp" relation-name="SurveyMultiRespColumn" list-name="surveyMultiRespColumnList" use-cache="true"/>
<iterate entry-name="surveyMultiRespColumn" list-name="surveyMultiRespColumnList">
<set field="currentFieldName" value="${surveyQuestionAndAppl.surveyQuestionId}_${surveyMultiRespColumn.surveyMultiRespColId}"/>
@@ -588,7 +588,7 @@
<!-- run the survey response service (async) -->
<set from-field="surveyResponse.surveyResponseId" field="respServiceCtx.surveyResponseId"/>
<if-not-empty field-name="responseService" map-name="survey">
<if-not-empty field="survey.responseService">
<call-service-asynch service-name="${survey.responseService}" in-map-name="respServiceCtx" include-user-login="true"/>
</if-not-empty>
@@ -600,31 +600,31 @@
<!-- =============== Inline method used by createSurveyResponse ============== -->
<simple-method method-name="validateSurveyResponseInline" short-description="validateSurveyResponseInline" login-required="false">
<!-- Is required? -->
<if-compare field-name="requiredField" map-name="surveyQuestionAndAppl" operator="equals" value="Y">
<if-empty field-name="${answerFieldName}">
<if-compare field="surveyQuestionAndAppl.requiredField" operator="equals" value="Y">
<if-empty field="${answerFieldName}">
<add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a response."/></add-error>
</if-empty>
</if-compare>
<!-- validate the field -->
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="CREDIT_CARD">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="CREDIT_CARD">
<if-validate-method field-name="${answerFieldName}" method="isCreditCard">
<else>
<add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid credit-card number."/></add-error>
</else>
</if-validate-method>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="GIFT_CARD">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="GIFT_CARD">
<set field="finAccountMap.finAccountTypeId" value="GIFTCERT_ACCOUNT"/>
<set field="finAccountMap.statusId" value="FNACT_ACTIVE"/>
<set field="codeOk" value="false"/>
<find-by-and entity-name="FinAccount" map-name="finAccountMap" list-name="finAccountList"/>
<iterate entry-name="finAccount" list-name="finAccountList">
<if-compare field-name="finAccount.finAccountCode" operator="equals" value="${${answerFieldName}}">
<if-compare field="finAccount.finAccountCode" operator="equals" value="${${answerFieldName}}">
<set field="codeOk" value="true"/>
</if-compare>
</iterate>
<if-compare field-name="codeOk" value="true" operator="not-equals">
<if-compare field="codeOk" value="true" operator="not-equals">
<if-validate-method field-name="${answerFieldName}" method="isGiftCard">
<else>
<add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid gift-card number."/></add-error>
@@ -632,42 +632,42 @@
</if-validate-method>
</if-compare>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="DATE">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="DATE">
<if-validate-method field-name="${answerFieldName}" method="isDate">
<else>
<add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid date string (mm/dd/yyyy)."/></add-error>
</else>
</if-validate-method>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="EMAIL">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="EMAIL">
<if-validate-method field-name="${answerFieldName}" method="isEmail">
<else>
<add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid email address."/></add-error>
</else>
</if-validate-method>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_CURRENCY">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_CURRENCY">
<if-validate-method field-name="${answerFieldName}" method="isSignedDouble">
<else>
<add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid currency amount."/></add-error>
</else>
</if-validate-method>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_FLOAT">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_FLOAT">
<if-validate-method field-name="${answerFieldName}" method="isSignedDouble">
<else>
<add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid decimal number."/></add-error>
</else>
</if-validate-method>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_LONG">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_LONG">
<if-validate-method field-name="${answerFieldName}" method="isSignedLong">
<else>
<add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid whole number."/></add-error>
</else>
</if-validate-method>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="URL">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="URL">
<if-validate-method field-name="${answerFieldName}" method="isUrl">
<else>
<add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid URL."/></add-error>
@@ -677,20 +677,20 @@
</simple-method>
<simple-method method-name="processSurveyResponseInline" short-description="processSurveyResponseInline" login-required="false">
<if-not-empty field-name="currentAnswers">
<if-not-empty field="currentAnswers">
<set field="responseAnswer" from-field="currentAnswers.${currentFieldName}"/>
</if-not-empty>
<if>
<condition>
<or>
<if-empty field-name="responseAnswer"/>
<if-compare-field field-name="responseAnswer.surveyQuestionId" operator="not-equals" to-field-name="surveyQuestionAndAppl.surveyQuestionId"/>
<if-empty field="responseAnswer"/>
<if-compare-field field="responseAnswer.surveyQuestionId" to-field="surveyQuestionAndAppl.surveyQuestionId" operator="not-equals"/>
<and>
<not>
<if-empty field-name="surveyMultiRespColumn"/>
<if-empty field="surveyMultiRespColumn"/>
</not>
<if-compare-field field-name="responseAnswer.surveyMultiRespColId" operator="not-equals" to-field-name="surveyMultiRespColumn.surveyMultiRespColId" />
<if-compare-field field="responseAnswer.surveyMultiRespColId" to-field="surveyMultiRespColumn.surveyMultiRespColId" operator="not-equals"/>
</and>
</or>
</condition>
@@ -700,7 +700,7 @@
<set from-field="surveyQuestionAndAppl.surveyQuestionId" field="responseAnswer.surveyQuestionId"/>
<!-- If this has a surveyMultiRespColumn then set surveyMultiRespId and surveyMultiRespColId otherwise set surveyMultiRespColId to _NA_ -->
<if-not-empty field-name="surveyMultiRespColumn">
<if-not-empty field="surveyMultiRespColumn">
<set field="responseAnswer.surveyMultiRespId" from-field="surveyMultiRespColumn.surveyMultiRespId"/>
<set field="responseAnswer.surveyMultiRespColId" from-field="surveyMultiRespColumn.surveyMultiRespColId"/>
<else>
@@ -711,56 +711,56 @@
<create-value value-name="responseAnswer"/>
</then>
</if>
<if-not-empty field-name="answers.${currentFieldName}">
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="BOOLEAN">
<if-not-empty field="answers.${currentFieldName}">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="BOOLEAN">
<set field="responseAnswer.booleanResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="EMAIL">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="EMAIL">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="DATE">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="DATE">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="URL">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="URL">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="CREDIT_CARD">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="CREDIT_CARD">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="GIFT_CARD">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="GIFT_CARD">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="PASSWORD">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="PASSWORD">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="TEXT_SHORT">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="TEXT_SHORT">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="TEXT_LONG">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="TEXT_LONG">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="TEXTAREA">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="TEXTAREA">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_CURRENCY">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_CURRENCY">
<set field="responseAnswer.currencyResponse" from-field="answers.${currentFieldName}" type="Double"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_FLOAT">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_FLOAT">
<set field="responseAnswer.floatResponse" from-field="answers.${currentFieldName}" type="Double"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_LONG">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="NUMBER_LONG">
<set field="responseAnswer.numericResponse" from-field="answers.${currentFieldName}" type="Long"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="OPTION">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="OPTION">
<set from-field="answers.${currentFieldName}" field="responseAnswer.surveyOptionSeqId"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="GEO">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="GEO">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="ENUMERATION">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="ENUMERATION">
<set field="responseAnswer.textResponse" from-field="answers.${currentFieldName}"/>
</if-compare>
<if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="CONTENT">
<if-compare field="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="CONTENT">
<!-- <log level="always" message="Found CONTENT type question"/> -->
<if-instance-of field-name="answers.${currentFieldName}" class="java.nio.ByteBuffer">
<set from-field="answers._${surveyQuestionAndAppl.surveyQuestionId}_contentType" field="partyContent._uploadedFile_contentType"/>
@@ -778,7 +778,7 @@
</if-instance-of>
</if-compare>
<if-empty field-name="sequenceNum" map-name="responseAnswer">
<if-empty field="responseAnswer.sequenceNum">
<set from-field="surveyQuestionAndAppl.sequenceNum" field="responseAnswer.sequenceNum"/>
</if-empty>
<set from-field="nowTimestamp" field="responseAnswer.answeredDate"/>
@@ -47,7 +47,7 @@ under the License.
<make-value value-name="newEntity" entity-name="WebSiteContent"/>
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<set-nonpk-fields value-name="newEntity" map-name="parameters"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-date-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp"/>
</if-empty>
@@ -72,7 +72,7 @@ under the License.
<make-value value-name="newEntity" entity-name="WebSiteContentType"/>
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<set-nonpk-fields value-name="newEntity" map-name="parameters"/>
<if-empty field-name="newEntity.webSiteContentTypeId">
<if-empty field="newEntity.webSiteContentTypeId">
<sequenced-id-to-env sequence-name="WebSiteContentTypeId" env-name="webSiteContentTypeId"/>
<set field="newEntity.webSiteContentTypeId" from-field="webSiteContentTypeId"/>
</if-empty>
@@ -125,7 +125,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp" />
</if-empty>
@@ -28,10 +28,10 @@ under the License.
<set from-field="productStore.allowPassword" field="allowPassword"/>
<set from-field="productStore.defaultPassword" field="defaultPassword"/>
<if-empty field-name="allowPassword">
<if-empty field="allowPassword">
<set field="allowPassword" value="Y"/>
</if-empty>
<if-empty field-name="defaultPassword">
<if-empty field="defaultPassword">
<set field="defaultPassword" value="ungssblepswd"/>
</if-empty>
@@ -41,21 +41,21 @@ under the License.
<now-timestamp-to-env env-name="nowStamp"/>
<set value="CUSTOMER" field="parameters.roleTypeId"/>
<if-compare field-name="allowPassword" operator="not-equals" value="Y">
<if-compare field="allowPassword" operator="not-equals" value="Y">
<set from-field="defaultPassword" field="parameters.PASSWORD"/>
<set from-field="defaultPassword" field="parameters.CONFIRM_PASSWORD"/>
<set value="No hint set, account not yet enabled" field="parameters.PASSWORD_HINT"/>
</if-compare>
<if-compare field-name="productStore.usePrimaryEmailUsername" operator="equals" value="Y">
<if-compare field="productStore.usePrimaryEmailUsername" operator="equals" value="Y">
<set field="parameters.USERNAME" from-field="parameters.CUSTOMER_EMAIL"/>
</if-compare>
<!-- if username and/or password should be lowercased, do that now -->
<if-compare field-name="username_lowercase" operator="equals" value="true">
<if-compare field="username_lowercase" operator="equals" value="true">
<call-object-method obj-field-name="USERNAME" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="USERNAME" ret-map-name="parameters"/>
</if-compare>
<if-compare field-name="password_lowercase" operator="equals" value="true">
<if-compare field="password_lowercase" operator="equals" value="true">
<call-object-method obj-field-name="PASSWORD" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="PASSWORD" ret-map-name="parameters"/>
<call-object-method obj-field-name="CONFIRM_PASSWORD" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="CONFIRM_PASSWORD" ret-map-name="parameters"/>
</if-compare>
@@ -73,10 +73,10 @@ under the License.
<process field="PASSWORD_HINT"><copy to-field="passwordHint"/></process>
</simple-map-processor>
</call-map-processor>
<if-not-empty field-name="userLoginId" map-name="userLoginContext">
<if-not-empty field="userLoginContext.userLoginId">
<set from-field="userLoginContext.userLoginId" field="userLoginExistsMap.userLoginId"/>
<find-by-primary-key entity-name="UserLogin" map-name="userLoginExistsMap" value-name="existingUserLogin"/>
<if-not-empty field-name="existingUserLogin">
<if-not-empty field="existingUserLogin">
<string-to-list string="Username in use, please choose another." message-field-name="USERNAME" list-name="error_list"/>
</if-not-empty>
</if-not-empty>
@@ -121,7 +121,7 @@ under the License.
<set from-field="parameters.roleTypeId" field="partyRoleContext.roleTypeId"/>
<!-- Create the Postal Address -->
<if-compare field-name="USE_ADDRESS" map-name="parameters" operator="equals" value="false">
<if-compare field="parameters.USE_ADDRESS" operator="equals" value="false">
<!-- address not used, do nothing -->
<else>
<call-map-processor in-map-name="parameters" out-map-name="addressContext">
@@ -154,13 +154,13 @@ under the License.
<process field="CUSTOMER_ADDRESS_ALLOW_SOL"><copy to-field="allowSolicitation"/></process>
</simple-map-processor>
</call-map-processor>
<if-compare value="USA" operator="equals" field-name="CUSTOMER_COUNTRY" map-name="parameters">
<if-empty field-name="CUSTOMER_STATE" map-name="parameters">
<if-compare value="USA" operator="equals" field="parameters.CUSTOMER_COUNTRY">
<if-empty field="parameters.CUSTOMER_STATE">
<string-to-list string="State is missing, and is required for an address in the United States." message-field-name="CUSTOMER_STATE" list-name="error_list"/>
</if-empty>
</if-compare>
<if-compare value="CAN" operator="equals" field-name="CUSTOMER_COUNTRY" map-name="parameters">
<if-empty field-name="CUSTOMER_STATE" map-name="parameters">
<if-compare value="CAN" operator="equals" field="parameters.CUSTOMER_COUNTRY">
<if-empty field="parameters.CUSTOMER_STATE">
<string-to-list string="State is missing, and is required for an address in the Canada." message-field-name="CUSTOMER_STATE" list-name="error_list"/>
</if-empty>
</if-compare>
@@ -168,7 +168,7 @@ under the License.
</if-compare>
<!-- Create the Home Phone -->
<if-not-empty field-name="CUSTOMER_HOME_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_HOME_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="homePhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -182,7 +182,7 @@ under the License.
</if-not-empty>
<!-- Create the Work Phone -->
<if-not-empty field-name="CUSTOMER_WORK_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_WORK_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="workPhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -196,7 +196,7 @@ under the License.
</if-not-empty>
<!-- Create the Fax Phone -->
<if-not-empty field-name="CUSTOMER_FAX_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_FAX_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="faxPhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -210,7 +210,7 @@ under the License.
</if-not-empty>
<!-- Create the Mobile Phone -->
<if-not-empty field-name="CUSTOMER_MOBILE_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_MOBILE_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="mobilePhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -224,10 +224,10 @@ under the License.
</if-not-empty>
<!-- Check for required Phone -->
<if-compare field-name="REQUIRE_PHONE" map-name="parameters" operator="equals" value="true">
<if-empty field-name="CUSTOMER_HOME_CONTACT" map-name="parameters">
<if-empty field-name="CUSTOMER_WORK_CONTACT" map-name="parameters">
<if-empty field-name="CUSTOMER_MOBILE_CONTACT" map-name="parameters">
<if-compare field="parameters.REQUIRE_PHONE" operator="equals" value="true">
<if-empty field="parameters.CUSTOMER_HOME_CONTACT">
<if-empty field="parameters.CUSTOMER_WORK_CONTACT">
<if-empty field="parameters.CUSTOMER_MOBILE_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="dummymap">
<simple-map-processor name="checkRequiredPhone">
<process field="REQUIRED_PHONE">
@@ -244,7 +244,7 @@ under the License.
<!-- Create the email address -->
<!-- Check for required E-Mail -->
<if-compare field-name="REQUIRE_EMAIL" map-name="parameters" operator="not-equals" value="false">
<if-compare field="parameters.REQUIRE_EMAIL" operator="not-equals" value="false">
<call-map-processor in-map-name="parameters" out-map-name="emailContext">
<simple-map-processor name="newEmail">
<process field="roleTypeId"><copy/></process>
@@ -308,7 +308,7 @@ under the License.
<call-service service-name="createPartyRole" in-map-name="partyRoleContext" include-user-login="true"/>
<!-- shipping address -->
<if-compare field-name="USE_ADDRESS" map-name="parameters" operator="equals" value="false">
<if-compare field="parameters.USE_ADDRESS" operator="equals" value="false">
<!-- address not used, do nothing -->
<else>
<call-service service-name="createPartyPostalAddress" in-map-name="addressContext">
@@ -325,7 +325,7 @@ under the License.
</if-compare>
<!-- home phone -->
<if-not-empty field-name="CUSTOMER_HOME_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_HOME_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="homePhoneContext">
<result-to-field result-name="contactMechId" map-name="homePhonePurposeContext"/>
</call-service>
@@ -335,7 +335,7 @@ under the License.
</if-not-empty>
<!-- work phone -->
<if-not-empty field-name="CUSTOMER_WORK_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_WORK_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="workPhoneContext">
<result-to-field result-name="contactMechId" map-name="workPhonePurposeContext"/>
</call-service>
@@ -345,7 +345,7 @@ under the License.
</if-not-empty>
<!-- fax phone -->
<if-not-empty field-name="CUSTOMER_FAX_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_FAX_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="faxPhoneContext">
<result-to-field result-name="contactMechId" map-name="faxPhonePurposeContext"/>
</call-service>
@@ -355,7 +355,7 @@ under the License.
</if-not-empty>
<!-- mobile phone -->
<if-not-empty field-name="CUSTOMER_MOBILE_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_MOBILE_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="mobilePhoneContext">
<result-to-field result-name="contactMechId" map-name="mobilePhonePurposeContext"/>
</call-service>
@@ -365,7 +365,7 @@ under the License.
</if-not-empty>
<!-- email address -->
<if-not-empty field-name="emailAddress" map-name="emailContext">
<if-not-empty field="emailContext.emailAddress">
<call-service service-name="createPartyEmailAddress" in-map-name="emailContext">
<result-to-field result-name="contactMechId" map-name="emailPurposeContext"/>
</call-service>
@@ -375,10 +375,10 @@ under the License.
</if-not-empty>
<!-- club number -->
<if-not-empty field-name="REQUIRE_CLUB" map-name="parameters">
<if-not-empty field="parameters.REQUIRE_CLUB">
<set from-field="tempMap.partyId" field="personLookup.partyId"/>
<find-by-primary-key map-name="personLookup" value-name="personVo" entity-name="Person"/>
<if-empty field-name="CLUB_NUMBER" map-name="parameters">
<if-empty field="parameters.CLUB_NUMBER">
<call-bsh><![CDATA[
clubId = org.ofbiz.party.party.PartyWorker.createClubId(delegator, "999", 13);
parameters.put("CLUB_NUMBER", clubId);
@@ -389,7 +389,7 @@ under the License.
</if-not-empty>
<!-- now finished, log in the user and set the cart's partyId to that of the newly created customer ... -->
<if-compare field-name="allowPassword" operator="equals" value="Y">
<if-compare field="allowPassword" operator="equals" value="Y">
<call-bsh><![CDATA[
org.ofbiz.webapp.control.LoginWorker.doBasicLogin(createdUserLogin, request);
org.ofbiz.webapp.control.LoginWorker.autoLoginSet(request, response);
@@ -402,11 +402,11 @@ under the License.
</if-compare>
<!-- send off the registration email -->
<if-not-empty field-name="emailAddress" map-name="emailContext">
<if-not-empty field="emailContext.emailAddress">
<set from-field="parameters.emailProductStoreId" field="storeEmailLookup.productStoreId"/>
<set value="PRDS_CUST_REGISTER" field="storeEmailLookup.emailType"/>
<find-by-primary-key map-name="storeEmailLookup" entity-name="ProductStoreEmailSetting" value-name="storeEmail"/>
<if-not-empty field-name="bodyScreenLocation" map-name="storeEmail">
<if-not-empty field="storeEmail.bodyScreenLocation">
<!-- prepare the email context -->
<get-related-one value-name="createdUserLogin" relation-name="Person" to-value-name="personObj"/>
<set from-field="createdUserLogin" field="emailCtx.userLogin"/>
@@ -435,7 +435,7 @@ under the License.
<!-- =========================================== -->
<simple-method method-name="processCustomerSettings" short-description="Process Customer Settings; to be called as a Request Event" login-required="false">
<if-empty field-name="parameters.partyId">
<if-empty field="parameters.partyId">
<call-simple-method method-name="createAnonymousCustomer"/>
<else>
<call-simple-method method-name="updateCustomer"/>
@@ -447,7 +447,7 @@ under the License.
<session-to-field field-name="cart" session-name="shoppingCart"/>
<session-to-field field-name="userLogin" session-name="userLogin"/>
<log level="info" message="userLogin in Env ${userLogin} in parameters.userLogin ${parameters.userLogin}"/>
<if-empty field-name="userLogin">
<if-empty field="userLogin">
<call-object-method obj-field-name="session" method-name="removeAttribute">
<string value="autoUserLogin"/>
</call-object-method>
@@ -456,7 +456,7 @@ under the License.
<string value="autoName"/>
</call-object-method>
<check-errors/>
<if-not-empty field-name="cart">
<if-not-empty field="cart">
<call-bsh><![CDATA[
// clear out the login fields from the cart
try {
@@ -467,13 +467,13 @@ under the License.
]]></call-bsh>
</if-not-empty>
<set from-field="tempMap.partyId" field="partyId" />
<if-not-empty field-name="partyId">
<if-not-empty field="partyId">
<set field="lookupKeyValue.userLoginId" value="anonymous"/>
<find-by-primary-key map-name="lookupKeyValue" entity-name="UserLogin" value-name="userLogin"/>
<if-not-empty field-name="userLogin">
<if-not-empty field="userLogin">
<set field="userLogin.partyId" from-field="partyId"/>
<field-to-session field-name="userLogin" session-name="userLogin" />
<if-not-empty field-name="cart">
<if-not-empty field="cart">
<call-object-method obj-field-name="cart" method-name="setOrderPartyId">
<field field-name="partyId"/>
</call-object-method>
@@ -503,7 +503,7 @@ under the License.
<now-timestamp-to-env env-name="nowStamp"/>
<!-- setup the party/person -->
<if-not-empty field-name="parameters.birthDateYear">
<if-not-empty field="parameters.birthDateYear">
<set field="parameters.birthDate" value="${parameters.birthDateYear}-${parameters.birthDateMonth}-${parameters.birthDateDay}"/>
</if-not-empty>
<call-map-processor in-map-name="parameters" out-map-name="personMap">
@@ -594,7 +594,7 @@ under the License.
<simple-method method-name="createUpdateCustomerInfo" short-description="Create or Update Customer Info" login-required="false">
<!-- update the email address -->
<if-not-empty field-name="parameters.emailContactMechId">
<if-not-empty field="parameters.emailContactMechId">
<set field="emailMap.partyId" from-field="partyId"/>
<set field="emailMap.contactMechId" from-field="parameters.emailContactMechId"/>
<!-- call the update email service -->
@@ -610,14 +610,14 @@ under the License.
<!-- create home phone -->
<if-not-empty field-name="parameters.homePhoneContactMechId">
<if-not-empty field="parameters.homePhoneContactMechId">
<set field="homePhoneMap.partyId" from-field="partyId"/>
<set field="homePhoneMap.contactMechId" from-field="parameters.homePhoneContactMechId"/>
<!-- call update telecom service -->
<call-service service-name="updatePartyTelecomNumber" in-map-name="homePhoneMap"/>
<else>
<!-- create home phone -->
<if-not-empty field-name="homeContactNumber" map-name="parameters">
<if-not-empty field="parameters.homeContactNumber">
<set field="homePhoneMap.partyId" from-field="partyId"/>
<set field="homePhoneMap.contactMechPurposeTypeId" value="PHONE_HOME"/>
<!-- call create telecom service -->
@@ -627,14 +627,14 @@ under the License.
</if-not-empty>
<!-- create work phone -->
<if-not-empty field-name="parameters.workPhoneContactMechId">
<if-not-empty field="parameters.workPhoneContactMechId">
<set field="workPhoneMap.partyId" from-field="partyId"/>
<set field="workPhoneMap.contactMechId" from-field="parameters.workPhoneContactMechId"/>
<!-- call update telecom service -->
<call-service service-name="updatePartyTelecomNumber" in-map-name="workPhoneMap"/>
<else>
<!-- create work phone -->
<if-not-empty field-name="workContactNumber" map-name="parameters">
<if-not-empty field="parameters.workContactNumber">
<set field="workPhoneMap.partyId" from-field="partyId"/>
<set field="workPhoneMap.contactMechPurposeTypeId" value="PHONE_WORK"/>
<!-- call create telecom service -->
@@ -644,7 +644,7 @@ under the License.
</if-not-empty>
</simple-method>
<simple-method method-name="updateCustomer" short-description="Update Customer" login-required="true">
<if-empty field-name="parameters.partyId"><add-error><fail-message message="No partyId passed, cannot Update Customer"/></add-error></if-empty>
<if-empty field="parameters.partyId"><add-error><fail-message message="No partyId passed, cannot Update Customer"/></add-error></if-empty>
<call-simple-method method-name="validateCustomerInfo"/>
@@ -674,13 +674,13 @@ under the License.
<log level="info" message="CreatePerson : ${tempMap.partyId}"/>
<!-- the rest of the methods require a userLogin object; so if we are anonymous lets fake it -->
<if-empty field-name="userLogin">
<if-empty field="userLogin">
<set field="ulLookup.userLoginId" value="anonymous"/>
<find-by-primary-key entity-name="UserLogin" map-name="ulLookup" value-name="userLogin"/>
<set field="userLogin.partyId" from-field="tempMap.partyId"/>
<set-current-user-login value-name="userLogin"/>
<else><!-- of an anonymous vistor is coming back, update the party id in the userLogin object -->
<if-compare field-name="userLogin.userLoginId" value="anonymous" operator="equals">
<if-compare field="userLogin.userLoginId" value="anonymous" operator="equals">
<set field="userLogin.partyId" from-field="tempMap.partyId"/>
</if-compare>
</else>
@@ -697,7 +697,7 @@ under the License.
<call-simple-method method-name="createUpdateCustomerInfo"/>
<!-- create userLogin -->
<if-not-empty field-name="userLoginId" map-name="parameters">
<if-not-empty field="parameters.userLoginId">
<set field="loginMap.userLoginId" from-field="parameters.userLoginId"/>
<!-- call create userLogin -->
<!-- call reset password (to email a password) -->
@@ -735,20 +735,20 @@ under the License.
<process field="monthsAtAddress"><convert type="Long" to-field="monthsWithContactMech"><fail-message message="Months at address not a valid number: ${parameters.monthsAtAddress}"/></convert></process>
</simple-map-processor>
</call-map-processor>
<if-compare value="USA" operator="equals" field-name="countryGeoId" map-name="parameters">
<if-empty field-name="stateProvinceGeoId" map-name="parameters">
<if-compare value="USA" operator="equals" field="parameters.countryGeoId">
<if-empty field="parameters.stateProvinceGeoId">
<string-to-list string="State is missing, and is required for an address in the United States." message-field-name="CUSTOMER_STATE" list-name="error_list"/>
</if-empty>
</if-compare>
<if-compare value="CAN" operator="equals" field-name="countryGeoId" map-name="parameters">
<if-empty field-name="stateProvinceGeoId" map-name="parameters">
<if-compare value="CAN" operator="equals" field="parameters.countryGeoId">
<if-empty field="parameters.stateProvinceGeoId">
<string-to-list string="State is missing, and is required for an address in the Canada." message-field-name="CUSTOMER_STATE" list-name="error_list"/>
</if-empty>
</if-compare>
<check-errors/>
<!-- shipping address -->
<if-not-empty field-name="parameters.shippingContactMechId">
<if-not-empty field="parameters.shippingContactMechId">
<set field="addressContext.partyId" from-field="partyId"/>
<set field="addressContext.contactMechId" from-field="parameters.shippingContactMechId"/>
<!-- call the update address service -->
@@ -775,7 +775,7 @@ under the License.
</else>
</if-not-empty>
<session-to-field field-name="cart" session-name="shoppingCart"/>
<if-not-empty field-name="cart">
<if-not-empty field="cart">
<call-object-method obj-field-name="cart" method-name="addContactMech">
<string value="SHIPPING_LOCATION"/>
<field field-name="addressContext.contactMechId"/>
@@ -795,7 +795,7 @@ under the License.
}
]]></call-bsh>
<session-to-field field-name="cart" session-name="shoppingCart"/>
<if-not-empty field-name="cart">
<if-not-empty field="cart">
<set field="shipmentMethodTypeId" from-field="parameters.shipmentMethodTypeId" />
<call-object-method obj-field-name="cart" method-name="setShipmentMethodTypeId">
<field field-name="shipmentMethodTypeId"/>
@@ -807,35 +807,35 @@ under the License.
</call-object-method>
<set field="maySplit" from-field="parameters.may_split" type="Boolean"/>
<if-not-empty field-name="maySplit">
<if-not-empty field="maySplit">
<call-object-method obj-field-name="cart" method-name="setMaySplit">
<field field-name="maySplit" type="Boolean"/>
</call-object-method>
</if-not-empty>
<set field="shippingInstruction" from-field="parameters.shipping_instructions" type="String"/>
<if-not-empty field-name="shippingInstruction">
<if-not-empty field="shippingInstruction">
<call-object-method obj-field-name="cart" method-name="setShippingInstructions">
<field field-name="shippingInstruction" type="String"/>
</call-object-method>
</if-not-empty>
<set field="correspondingPoId" from-field="parameters.correspondingPoId"/>
<if-not-empty field-name="correspondingPoId">
<if-not-empty field="correspondingPoId">
<call-object-method obj-field-name="cart" method-name="setPoNumber">
<field field-name="correspondingPoId" type="String"/>
</call-object-method>
</if-not-empty>
<set field="isGift" from-field="parameters.is_gift" type="Boolean"/>
<if-not-empty field-name="isGift">
<if-not-empty field="isGift">
<call-object-method obj-field-name="cart" method-name="setIsGift">
<field field-name="isGift" type="Boolean"/>
</call-object-method>
</if-not-empty>
<set field="giftMessage" from-field="parameters.gift_message" type="String"/>
<if-not-empty field-name="giftMessage">
<if-not-empty field="giftMessage">
<call-object-method obj-field-name="cart" method-name="setGiftMessage">
<field field-name="giftMessage" type="String"/>
</call-object-method>
@@ -32,23 +32,23 @@ under the License.
<set field="default_user_password" value="ungssblepsswd" />
<now-timestamp-to-env env-name="nowStamp"/>
<if-compare field-name="create_allow_password" operator="not-equals" value="true">
<if-compare field="create_allow_password" operator="not-equals" value="true">
<set field="parameters.password" from-field="default_user_password" />
<set field="parameters.confirmPassword" from-field="default_user_password" />
<set field="parameters.passwordHint" value="No hint set, accout not yet enabled" />
</if-compare>
<!-- if username and/or password should be lowercased, do that now -->
<if-compare field-name="username_lowercase" operator="equals" value="true">
<if-compare field="username_lowercase" operator="equals" value="true">
<call-object-method obj-field-name="username" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="username" ret-map-name="parameters"/>
</if-compare>
<if-compare field-name="password_lowercase" operator="equals" value="true">
<if-compare field="password_lowercase" operator="equals" value="true">
<call-object-method obj-field-name="password" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="password" ret-map-name="parameters"/>
<call-object-method obj-field-name="confirmPassword" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="confirmPassword" ret-map-name="parameters"/>
</if-compare>
<!-- Create the UserLogin Record -->
<if-not-empty field-name="userLoginId" map-name="parameters">
<if-not-empty field="parameters.userLoginId">
<call-map-processor in-map-name="parameters" out-map-name="userLoginContext">
<simple-map-processor name="newUserLogin">
<process field="userLoginId"><copy to-field="userLoginId"/><not-empty><fail-property resource="PartyUiLabels" property="PartyUserNameMissing"/></not-empty></process>
@@ -61,10 +61,10 @@ under the License.
<process field="passwordHint"><copy to-field="passwordHint"/></process>
</simple-map-processor>
</call-map-processor>
<if-not-empty field-name="userLoginId" map-name="userLoginContext">
<if-not-empty field="userLoginContext.userLoginId">
<set field=" userLoginExistsMap.userLoginId" from-field="userLoginContext.userLoginId" />
<find-by-primary-key entity-name="UserLogin" map-name="userLoginExistsMap" value-name="existingUserLogin"/>
<if-not-empty field-name="existingUserLogin">
<if-not-empty field="existingUserLogin">
<set field="tempErrorMessage" value="Username in use, please choose another." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-not-empty>
@@ -83,7 +83,7 @@ under the License.
org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale);
]]></call-bsh>
<else>
<if-compare field-name="require_login" operator="equals" value="true">
<if-compare field="require_login" operator="equals" value="true">
<add-error><fail-property resource="PartyUiLabels" property="PartyUserNameMissing"/></add-error>
<check-errors/>
</if-compare>
@@ -104,7 +104,7 @@ under the License.
</call-map-processor>
<!-- Create the Home Phone -->
<if-not-empty field-name="homeContactNumber" map-name="parameters">
<if-not-empty field="parameters.homeContactNumber">
<call-map-processor in-map-name="parameters" out-map-name="homePhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -118,7 +118,7 @@ under the License.
</if-not-empty>
<!-- Create the Work Phone -->
<if-not-empty field-name="workContactNumber" map-name="parameters">
<if-not-empty field="parameters.workContactNumber">
<call-map-processor in-map-name="parameters" out-map-name="workPhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -132,7 +132,7 @@ under the License.
</if-not-empty>
<!-- Create the Fax Phone -->
<if-not-empty field-name="faxContactNumber" map-name="parameters">
<if-not-empty field="parameters.faxContactNumber">
<call-map-processor in-map-name="parameters" out-map-name="faxPhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -146,7 +146,7 @@ under the License.
</if-not-empty>
<!-- Create the Mobile Phone -->
<if-not-empty field-name="mobileContactNumber" map-name="parameters">
<if-not-empty field="parameters.mobileContactNumber">
<call-map-processor in-map-name="parameters" out-map-name="mobilePhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -160,10 +160,10 @@ under the License.
</if-not-empty>
<!-- Check for required Phone -->
<if-compare field-name="require_phone" operator="equals" value="true">
<if-empty field-name="homeContactNumber" map-name="parameters">
<if-empty field-name="workContactNumber" map-name="parameters">
<if-empty field-name="mobileContactNumber" map-name="parameters">
<if-compare field="require_phone" operator="equals" value="true">
<if-empty field="parameters.homeContactNumber">
<if-empty field="parameters.workContactNumber">
<if-empty field="parameters.mobileContactNumber">
<call-map-processor in-map-name="parameters" out-map-name="dummymap">
<simple-map-processor name="checkRequiredPhone">
<process field="requiredPhone">
@@ -186,8 +186,8 @@ under the License.
</call-map-processor>
<!-- Check for required E-Mail -->
<if-compare field-name="require_email" operator="equals" value="true">
<if-empty field-name="emailAddress" map-name="emailContext">
<if-compare field="require_email" operator="equals" value="true">
<if-empty field="emailContext.emailAddress">
<call-map-processor in-map-name="emailContext" out-map-name="dummymap">
<simple-map-processor name="checkRequiredEmail">
<process field="emailAddress">
@@ -196,7 +196,7 @@ under the License.
</simple-map-processor>
</call-map-processor>
</if-empty>
<if-not-empty field-name="emailAddress" map-name="emailContext">
<if-not-empty field="emailContext.emailAddress">
<call-map-processor in-map-name="emailContext" out-map-name="dummymap">
<simple-map-processor name="checkRequiredEmailFormat">
<process field="emailAddress">
@@ -213,8 +213,8 @@ under the License.
<set field="partyRoleContext.roleTypeId" from-field="parameters.roleTypeId" />
<!-- Create the Postal Address -->
<if-compare field-name="shipToPostalAddress" operator="equals" value="true">
<if-empty field-name="shipToName" map-name="parameters">
<if-compare field="shipToPostalAddress" operator="equals" value="true">
<if-empty field="parameters.shipToName">
<set field="parameters.shipToName" value="${personContext.firstName} ${personContext.middleName} ${personContext.lastName}" />
</if-empty>
<call-map-processor in-map-name="parameters" out-map-name="shippingAddressContext">
@@ -231,24 +231,24 @@ under the License.
<process field="shipToPostalAddressAllowSol"><copy to-field="allowSolicitation"/></process>
</simple-map-processor>
</call-map-processor>
<if-compare value="USA" operator="equals" field-name="shipToCountryGeoId" map-name="parameters">
<if-empty field-name="shipToStateProvinceGeoId" map-name="parameters">
<if-compare value="USA" operator="equals" field="parameters.shipToCountryGeoId">
<if-empty field="parameters.shipToStateProvinceGeoId">
<set field="tempErrorMessage" value="State is missing, and is required for an address in the United States." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-empty>
</if-compare>
<if-compare value="CAN" operator="equals" field-name="shipToCountryGeoId" map-name="parameters">
<if-empty field-name="shipToStateProvinceGeoId" map-name="parameters">
<if-compare value="CAN" operator="equals" field="parameters.shipToCountryGeoId">
<if-empty field="parameters.shipToStateProvinceGeoId">
<set field="tempErrorMessage" value="State is missing, and is required for an address in Canada." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-empty>
</if-compare>
</if-compare>
<if-compare value="Y" field-name="parameters.useShippingPostalAddressForBilling" operator="not-equals">
<if-compare value="Y" field="parameters.useShippingPostalAddressForBilling" operator="not-equals">
<!-- Check the flag if Second Postal address is not same as First So create Another Postal Address -->
<if-compare field-name="billToPostalAddress" operator="equals" value="true">
<if-empty field-name="billToName" map-name="parameters">
<if-compare field="billToPostalAddress" operator="equals" value="true">
<if-empty field="parameters.billToName">
<set field="parameters.billToName" value="${personContext.firstName} ${personContext.middleName} ${personContext.lastName}" />
</if-empty>
<call-map-processor in-map-name="parameters" out-map-name="billingAddressContext">
@@ -265,14 +265,14 @@ under the License.
<process field="billToPostalAddressAllowSol"><copy to-field="allowSolicitation"/></process>
</simple-map-processor>
</call-map-processor>
<if-compare value="USA" operator="equals" field-name="billToCountryGeoId" map-name="parameters">
<if-empty field-name="billToStateProvinceGeoId" map-name="parameters">
<if-compare value="USA" operator="equals" field="parameters.billToCountryGeoId">
<if-empty field="parameters.billToStateProvinceGeoId">
<set field="tempErrorMessage" value="State is missing, and is required for an address in the United States." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-empty>
</if-compare>
<if-compare value="CAN" operator="equals" field-name="billToCountryGeoId" map-name="parameters">
<if-empty field-name="billToStateProvinceGeoId" map-name="parameters">
<if-compare value="CAN" operator="equals" field="parameters.billToCountryGeoId">
<if-empty field="parameters.billToStateProvinceGeoId">
<set field="tempErrorMessage" value="State is missing, and is required for an address in Canada." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-empty>
@@ -293,14 +293,14 @@ under the License.
<!-- see if we should continue now... -->
<check-errors/>
<if-empty field-name="parameters.partyId">
<if-empty field="parameters.partyId">
<!-- call the create person service -->
<call-service service-name="createPerson" in-map-name="personContext">
<result-to-field result-name="partyId" field-name="partyId"/>
<result-to-request result-name="partyId"/>
</call-service>
<if-empty field-name="userLogin">
<if-empty field-name="newUserLogin">
<if-empty field="userLogin">
<if-empty field="newUserLogin">
<!-- the rest of the methods require a userLogin object; so if we are anonymous lets fake it -->
<set field="ulLookup.userLoginId" value="anonymous"/>
<find-by-primary-key entity-name="UserLogin" map-name="ulLookup" value-name="userLogin"/>
@@ -311,7 +311,7 @@ under the License.
</else>
</if-empty>
<else><!-- of an anonymous vistor is coming back, update the party id in the userLogin object -->
<if-compare field-name="userLogin.userLoginId" value="anonymous" operator="equals">
<if-compare field="userLogin.userLoginId" value="anonymous" operator="equals">
<set field="userLogin.partyId" from-field="partyId"/>
</if-compare>
</else>
@@ -337,7 +337,7 @@ under the License.
<set field="mobilePhoneContext.partyId" from-field="partyId" />
<set field="emailContext.partyId" from-field="partyId" />
<if-not-empty field-name="newUserLogin">
<if-not-empty field="newUserLogin">
<!-- If password encryption is enabled, encrpyt it now -->
<call-bsh><![CDATA[
boolean useEncryption = "true".equals(org.ofbiz.base.util.UtilProperties.getPropertyValue("security", "password.encrypt"));
@@ -351,13 +351,13 @@ under the License.
<create-value value-name="partyDataSource"/>
<!-- add contactMechPurposeTypeId for first Postal Address -->
<if-compare field-name="shipToPostalAddress" operator="equals" value="true">
<if-empty field-name="parameters.shippingContactMechId">
<if-compare field="shipToPostalAddress" operator="equals" value="true">
<if-empty field="parameters.shippingContactMechId">
<set field="shippingAddressContext.contactMechPurposeTypeId" from-field="parameters.shippingContactMechPurposeTypeId" default-value="SHIPPING_LOCATION"/>
<call-service service-name="createPartyPostalAddress" in-map-name="shippingAddressContext">
<result-to-field result-name="contactMechId" field-name="parameters.shippingContactMechId"/>
</call-service>
<if-compare value="Y" field-name="parameters.useShippingPostalAddressForBilling" operator="equals">
<if-compare value="Y" field="parameters.useShippingPostalAddressForBilling" operator="equals">
<set field="addressPurposeContext.partyId" from-field="partyId"/>
<set field="addressPurposeContext.contactMechPurposeTypeId" from-field="parameters.billingContactMechPurposeTypeId" default-value="BILLING_LOCATION"/>
<set field="addressPurposeContext.contactMechId" from-field="parameters.shippingContactMechId"/>
@@ -373,8 +373,8 @@ under the License.
</if-empty>
</if-compare>
<if-compare value="Y" field-name="parameters.useShippingPostalAddressForBilling" operator="not-equals">
<if-empty field-name="parameters.billingContactMechId">
<if-compare value="Y" field="parameters.useShippingPostalAddressForBilling" operator="not-equals">
<if-empty field="parameters.billingContactMechId">
<!-- create the Billing location -->
<set field="billingAddressContext.contactMechPurposeTypeId" from-field="parameters.billingContactMechPurposeTypeId" default-value="BILLING_LOCATION"/>
<call-service service-name="createPartyPostalAddress" in-map-name="billingAddressContext">
@@ -391,8 +391,8 @@ under the License.
</if-compare>
<!-- home phone -->
<if-not-empty field-name="homeContactNumber" map-name="parameters">
<if-empty field-name="parameters.homePhoneContactMechId">
<if-not-empty field="parameters.homeContactNumber">
<if-empty field="parameters.homePhoneContactMechId">
<!-- create home phone -->
<set field="homePhoneContext.contactMechPurposeTypeId" value="PHONE_HOME"/>
<!-- call create telecom service -->
@@ -410,8 +410,8 @@ under the License.
</if-not-empty>
<!-- work phone -->
<if-not-empty field-name="workContactNumber" map-name="parameters">
<if-empty field-name="parameters.workPhoneContactMechId">
<if-not-empty field="parameters.workContactNumber">
<if-empty field="parameters.workPhoneContactMechId">
<!-- create work phone -->
<set field="workPhoneContext.contactMechPurposeTypeId" value="PHONE_WORK"/>
<!-- call create telecom service -->
@@ -429,8 +429,8 @@ under the License.
</if-not-empty>
<!-- fax phone -->
<if-not-empty field-name="faxContactNumber" map-name="parameters">
<if-empty field-name="parameters.faxPhoneContactMechId">
<if-not-empty field="parameters.faxContactNumber">
<if-empty field="parameters.faxPhoneContactMechId">
<!-- create fax phone -->
<set field="faxPhoneContext.contactMechPurposeTypeId" value="FAX_NUMBER"/>
<!-- call create telecom service -->
@@ -448,8 +448,8 @@ under the License.
</if-not-empty>
<!-- mobile phone -->
<if-not-empty field-name="mobileContactNumber" map-name="parameters">
<if-empty field-name="parameters.mobilePhoneContactMechId">
<if-not-empty field="parameters.mobileContactNumber">
<if-empty field="parameters.mobilePhoneContactMechId">
<set field="mobilePhoneContext.contactMechPurposeTypeId" value="PHONE_MOBILE"/>
<!-- call create telecom service -->
<call-service service-name="createPartyTelecomNumber" in-map-name="mobilePhoneContext">
@@ -466,8 +466,8 @@ under the License.
</if-not-empty>
<!-- email address -->
<if-not-empty field-name="emailAddress" map-name="parameters">
<if-empty field-name="emailContactMechId" map-name="parameters">
<if-not-empty field="parameters.emailAddress">
<if-empty field="parameters.emailContactMechId">
<set field="emailContext.contactMechPurposeTypeId" value="PRIMARY_EMAIL" />
<call-service service-name="createPartyEmailAddress" in-map-name="emailContext">
<result-to-field result-name="contactMechId" field-name="parameters.emailContactMechId"/>
@@ -498,7 +498,7 @@ under the License.
<!-- see if we should continue now... -->
<session-to-field field-name="cart" session-name="shoppingCart"/>
<session-to-field field-name="userLogin" session-name="userLogin"/>
<if-empty field-name="userLogin">
<if-empty field="userLogin">
<call-object-method obj-field-name="session" method-name="removeAttribute">
<string value="autoUserLogin"/>
</call-object-method>
@@ -507,7 +507,7 @@ under the License.
<string value="autoName"/>
</call-object-method>
<check-errors/>
<if-not-empty field-name="cart">
<if-not-empty field="cart">
<call-bsh><![CDATA[
// clear out the login fields from the cart
try {
@@ -518,13 +518,13 @@ under the License.
]]></call-bsh>
</if-not-empty>
<set from-field="partyId" field="partyId" />
<if-not-empty field-name="partyId">
<if-not-empty field="partyId">
<set field="lookupKeyValue.userLoginId" value="anonymous"/>
<find-by-primary-key map-name="lookupKeyValue" entity-name="UserLogin" value-name="userLogin"/>
<if-not-empty field-name="userLogin">
<if-not-empty field="userLogin">
<set field="userLogin.partyId" from-field="partyId"/>
<field-to-session field-name="userLogin" session-name="userLogin" />
<if-not-empty field-name="cart">
<if-not-empty field="cart">
<call-object-method obj-field-name="cart" method-name="setOrderPartyId">
<field field-name="partyId"/>
</call-object-method>
@@ -542,7 +542,7 @@ under the License.
</if-empty>
<check-errors/>
<if-not-empty field-name="cart">
<if-not-empty field="cart">
<call-object-method obj-field-name="cart" method-name="addContactMech">
<string value="SHIPPING_LOCATION"/>
<field field-name="parameters.shippingContactMechId"/>
@@ -553,10 +553,10 @@ under the License.
</if-not-empty>
<if-compare value="Y" field-name="parameters.useShippingPostalAddressForBilling" operator="not-equals">
<if-compare value="Y" field="parameters.useShippingPostalAddressForBilling" operator="not-equals">
<field-to-session field-name="parameters.billingContactMechId" session-name="billingContactMechId"></field-to-session>
<else>
<if-not-empty field-name="cart">
<if-not-empty field="cart">
<call-object-method obj-field-name="cart" method-name="getShippingContactMechId" ret-field-name="shippingContactMechId"/>
</if-not-empty>
<field-to-session field-name="shippingContactMechId" session-name="billingContactMechId"></field-to-session>
@@ -575,7 +575,7 @@ under the License.
}
]]></call-bsh>
<session-to-field field-name="cart" session-name="shoppingCart"/>
<if-not-empty field-name="cart">
<if-not-empty field="cart">
<set field="shipmentMethodTypeId" from-field="parameters.shipmentMethodTypeId" />
<call-object-method obj-field-name="cart" method-name="setShipmentMethodTypeId">
<field field-name="shipmentMethodTypeId"/>
@@ -592,14 +592,14 @@ under the License.
</call-object-method>
<set field="shippingInstruction" from-field="parameters.shipping_instructions" type="String"/>
<if-not-empty field-name="shippingInstruction">
<if-not-empty field="shippingInstruction">
<call-object-method obj-field-name="cart" method-name="setShippingInstructions">
<field field-name="shippingInstruction" type="String"/>
</call-object-method>
</if-not-empty>
<set field="correspondingPoId" from-field="parameters.correspondingPoId" type="String"/>
<if-not-empty field-name="correspondingPoId">
<if-not-empty field="correspondingPoId">
<call-object-method obj-field-name="cart" method-name="setPoNumber">
<field field-name="correspondingPoId" type="String"/>
</call-object-method>
@@ -611,7 +611,7 @@ under the License.
</call-object-method>
<set field="giftMessage" from-field="parameters.gift_message" type="String"/>
<if-not-empty field-name="giftMessage">
<if-not-empty field="giftMessage">
<call-object-method obj-field-name="cart" method-name="setGiftMessage">
<field field-name="giftMessage" type="String"/>
</call-object-method>
@@ -83,7 +83,7 @@ under the License.
processor-name="newAffilFax" in-map-name="parameters" out-map-name="fax_context"/>
<check-errors/>
<if-not-empty field-name="contactNumber" map-name="fax_context">
<if-not-empty field="fax_context.contactNumber">
<call-service service-name="createTelecomNumber" in-map-name="fax_context">
<result-to-field result-name="contactMechId" map-name="parameters"/>
</call-service>
@@ -93,7 +93,7 @@ under the License.
<call-map-processor xml-resource="org/ofbiz/ecommerce/misc/AffiliateMapProcs.xml"
processor-name="newAffilFaxPurpose" in-map-name="parameters" out-map-name="faxp_context"/>
<check-errors/>
<if-not-empty field-name="contactNumber" map-name="faxp_context">
<if-not-empty field="faxp_context.contactNumber">
<call-service service-name="createPartyContactMechPurpose" in-map-name="faxp_context"/>
</if-not-empty>
@@ -71,8 +71,8 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="partySkill.partyId" operator="equals" to-field-name="parameters.partyId"/>
<if-compare-field field-name="partySkill.skillTypeId" operator="equals" to-field-name="parameters.skillTypeId"/>
<if-compare-field field="partySkill.partyId" to-field="parameters.partyId" operator="equals"/>
<if-compare-field field="partySkill.skillTypeId" to-field="parameters.skillTypeId" operator="equals"/>
</and>
</condition>
<then>
@@ -142,7 +142,7 @@ under the License.
<make-value entity-name="PerformanceNote" value-name="newEntity"/>
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
@@ -164,7 +164,7 @@ under the License.
<make-value entity-name="PersonTraining" value-name="newEntity"/>
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
@@ -187,7 +187,7 @@ under the License.
<make-value entity-name="Employment" value-name="newEntity"/>
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
@@ -231,7 +231,7 @@ under the License.
<make-value entity-name="PartyBenefit" value-name="newEntity"/>
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
@@ -255,7 +255,7 @@ under the License.
<simple-method method-name="createPayGrade" short-description="Create a Pay Grade">
<make-value entity-name="PayGrade" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-not-empty field-name="parameters.payGradeId">
<if-not-empty field="parameters.payGradeId">
<set field="newEntity.payGradeId" from-field="parameters.payGradeId"/>
<else>
<sequenced-id-to-env sequence-name="PayGrade" env-name="newEntity.payGradeId"/>
@@ -280,7 +280,7 @@ under the License.
<make-value entity-name="PayHistory" value-name="newEntity"/>
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
@@ -405,7 +405,7 @@ under the License.
<make-value entity-name="EmplPositionFulfillment" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
@@ -427,13 +427,13 @@ under the License.
<make-value entity-name="EmplPositionReportingStruct" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
<if>
<condition>
<if-compare-field field-name="parameters.emplPositionIdManagedBy" operator="not-equals" to-field-name="parameters.emplPositionIdReportingTo"/>
<if-compare-field field="parameters.emplPositionIdManagedBy" to-field="parameters.emplPositionIdReportingTo" operator="not-equals"/>
</condition>
<then>
<create-value value-name="newEntity"/>
@@ -462,7 +462,7 @@ under the License.
<make-value entity-name="EmplPositionResponsibility" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
@@ -484,7 +484,7 @@ under the License.
<make-value entity-name="ValidResponsibility" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
@@ -524,7 +524,7 @@ under the License.
<simple-method method-name="createEmployee" short-description="Create New Employee">
<set field="parameters.roleTypeId" value="EMPLOYEE"/>
<call-simple-method method-name="createPersonRoleAndContactMechs" xml-resource="org/ofbiz/party/party/PartySimpleMethods.xml"/>
<if-not-empty field-name="parameters.partyIdFrom">
<if-not-empty field="parameters.partyIdFrom">
<set field="partyRelationshipCtx.partyId" from-field="partyId"/>
<set field="partyRelationshipCtx.partyIdFrom" from-field="parameters.partyIdFrom"/>
<set field="partyRelationshipCtx.partyIdTo" from-field="partyId"/>
@@ -533,7 +533,7 @@ under the License.
<set field="partyRelationshipCtx.relationshipName" value="EMPLOYMENT"/>
<set field="partyRelationshipCtx.fromDate" from-field="parameters.fromDate"/>
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="partyRelationshipCtx.fromDate">
<if-empty field="partyRelationshipCtx.fromDate">
<set field="partyRelationshipCtx.fromDate" from-field="nowTimestamp"/>
</if-empty>
<call-service service-name="createPartyRelationship" in-map-name="partyRelationshipCtx"/>
@@ -546,7 +546,7 @@ under the License.
<make-value entity-name="ResponsibilityType" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.responsibilityTypeId">
<if-empty field="newEntity.responsibilityTypeId">
<sequenced-id-to-env sequence-name="ResponsibilityType" env-name="newEntity.responsibilityTypeId"/>
</if-empty>
<field-to-result field-name="newEntity.responsibilityTypeId" result-name="responsibilityTypeId"/>
@@ -567,7 +567,7 @@ under the License.
<simple-method method-name="createTerminationType" short-description="Create a TerminationType">
<make-value entity-name="TerminationType" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.terminationTypeId">
<if-empty field="newEntity.terminationTypeId">
<sequenced-id-to-env sequence-name="TerminationType" env-name="newEntity.terminationTypeId"/>
</if-empty>
<field-to-result field-name="newEntity.terminationTypeId" result-name="terminationTypeId"/>
@@ -588,7 +588,7 @@ under the License.
<simple-method method-name="createEmplPositionType" short-description="Create a PositionType">
<make-value entity-name="EmplPositionType" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.emplPositionTypeId">
<if-empty field="newEntity.emplPositionTypeId">
<sequenced-id-to-env sequence-name="EmplPositionType" env-name="newEntity.emplPositionTypeId"/>
</if-empty>
<field-to-result field-name="newEntity.emplPositionTypeId" result-name="emplPositionTypeId"/>
@@ -658,7 +658,7 @@ under the License.
<make-value entity-name="EmplLeaveType" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.leaveTypeId">
<if-empty field="newEntity.leaveTypeId">
<sequenced-id-to-env sequence-name="EmplLeaveType" env-name="newEntity.leaveTypeId"/>
</if-empty>
<field-to-result field-name="newEntity.leaveTypeId" result-name="leaveTypeId"/>
@@ -675,4 +675,4 @@ under the License.
<entity-one entity-name="EmplLeaveType" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -53,7 +53,7 @@ under the License.
<calcop operator="get" field-name="arguments.width"/>
</calcop>
</calculate>
<if-compare-field field-name="quantityInt" to-field-name="quantityDou" operator="less">
<if-compare-field field="quantityInt" to-field="quantityDou" operator="less">
<calculate field-name="quantity">
<calcop operator="add">
<calcop operator="get" field-name="quantityInt"/>
@@ -22,21 +22,21 @@ under the License.
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<!-- ProductAssoc -->
<simple-method method-name="createBOMAssoc" short-description="Create Product to Product Association">
<if-empty field-name="parameters.fromDate">
<if-empty field="parameters.fromDate">
<now-timestamp-to-env env-name="parameters.fromDate"/>
</if-empty>
<set field="" from-field=""/>
<set field="searchDuplicatedAncestorContext.productId" from-field="parameters.productId"/>
<set field="searchDuplicatedAncestorContext.productIdTo" from-field="parameters.productIdTo"/>
<if-not-empty field-name="parameters.fromDate">
<if-not-empty field="parameters.fromDate">
<set field="searchDuplicatedAncestorContext.fromDate" from-field="parameters.fromDate"/>
</if-not-empty>
<set field="searchDuplicatedAncestorContext.productAssocTypeId" from-field="parameters.productAssocTypeId"/>
<call-service service-name="searchDuplicatedAncestor" in-map-name="searchDuplicatedAncestorContext">
<result-to-field result-name="duplicatedProductAssoc" field-name="duplicatedProductAssoc"/>
</call-service>
<if-not-empty field-name="duplicatedProductAssoc">
<if-not-empty field="duplicatedProductAssoc">
<set field="productToProduct[]" from-field="duplicatedProductAssoc.productId"/>
<set field="productToProduct[]" from-field="duplicatedProductAssoc.productIdTo"/>
<property-to-field property="ManufacturingDuplicatedComponentInBOM" resource="ManufacturingUiLabels" field-name="errorMessage" arg-list-name="productToProduct"/>
@@ -60,7 +60,7 @@ under the License.
</simple-method>
<simple-method method-name="eventEditBOM" short-description="Add, update, delete components in BOM">
<if-compare value="UPDATE" field-name="UPDATE_MODE" map-name="parameters" operator="equals">
<if-compare value="UPDATE" field="parameters.UPDATE_MODE" operator="equals">
<set-service-fields service-name="updateProductAssoc" map-name="parameters" to-map-name="context"/>
<call-map-processor xml-resource="org/ofbiz/manufacturing/bom/BomMapProcs.xml"
processor-name="prepareUpdateBOMAssoc"
@@ -69,7 +69,7 @@ under the License.
<call-service service-name="updateProductAssoc" in-map-name="context"/>
<check-errors/>
</if-compare>
<if-compare value="CREATE" field-name="UPDATE_MODE" map-name="parameters" operator="equals">
<if-compare value="CREATE" field="parameters.UPDATE_MODE" operator="equals">
<set-service-fields service-name="createBOMAssoc" map-name="parameters" to-map-name="context"/>
<call-map-processor xml-resource="org/ofbiz/manufacturing/bom/BomMapProcs.xml"
processor-name="prepareUpdateBOMAssoc"
@@ -78,14 +78,14 @@ under the License.
<call-service service-name="createBOMAssoc" in-map-name="context">
<result-to-field field-name="errorMessage" result-name="errorMessage"/>
</call-service>
<if-not-empty field-name="errorMessage">
<if-not-empty field="errorMessage">
<add-error>
<fail-message message="${errorMessage}"/>
</add-error>
</if-not-empty>
<!--<check-errors/>-->
</if-compare>
<if-compare value="DELETE" field-name="UPDATE_MODE" map-name="parameters" operator="equals">
<if-compare value="DELETE" field="parameters.UPDATE_MODE" operator="equals">
<set-service-fields service-name="deleteProductAssoc" map-name="parameters" to-map-name="context"/>
<call-map-processor xml-resource="org/ofbiz/manufacturing/bom/BomMapProcs.xml"
processor-name="prepareDeleteProductAssoc"
@@ -94,7 +94,7 @@ under the License.
<call-service service-name="deleteProductAssoc" in-map-name="context"/>
<check-errors/>
</if-compare>
<if-compare value="COPY" field-name="UPDATE_MODE" map-name="parameters" operator="equals">
<if-compare value="COPY" field="parameters.UPDATE_MODE" operator="equals">
<set-service-fields service-name="copyBOMAssocs" map-name="parameters" to-map-name="context"/>
<call-service service-name="copyBOMAssocs" in-map-name="context"/>
<check-errors/>
@@ -121,14 +121,14 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="ProductManufacturingRule"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="ProductManufacturingRule" map-name="lookupPKMap" value-name="newEntity"/>
<if-not-empty field-name="ruleId" map-name="newEntity">
<if-not-empty field="newEntity.ruleId">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingMachineGroupIdAlreadyExist"/>
</add-error>
<check-errors/>
<else>
<make-value value-name="newEntity" entity-name="ProductManufacturingRule"/>
<if-empty field-name="parameters.ruleId">
<if-empty field="parameters.ruleId">
<sequenced-id-to-env sequence-name="ProductManufacturingRule" env-name="parameters.ruleId"/>
</if-empty>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
@@ -146,7 +146,7 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="ProductManufacturingRule"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="ProductManufacturingRule" map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-not-empty field-name="lookedUpValue.ruleId">
<if-not-empty field="lookedUpValue.ruleId">
<remove-value value-name="lookedUpValue"/>
</if-not-empty>
</simple-method>
@@ -25,14 +25,14 @@ under the License.
<simple-method method-name="issueProductionRunTask" short-description="Issues the Inventory for a Production Run Task" login-required="false">
<entity-one entity-name="WorkEffort" value-name="workEffort"/>
<if-empty field-name="parameters.failIfItemsAreNotAvailable">
<if-empty field="parameters.failIfItemsAreNotAvailable">
<set field="parameters.failIfItemsAreNotAvailable" value="Y"/>
</if-empty>
<if-empty field-name="parameters.failIfItemsAreNotOnHand">
<if-empty field="parameters.failIfItemsAreNotOnHand">
<set field="parameters.failIfItemsAreNotOnHand" value="Y"/>
</if-empty>
<if-not-empty field-name="workEffort">
<if-compare value="PRUN_CANCELLED" operator="not-equals" field-name="currentStatusId" map-name="workEffort">
<if-not-empty field="workEffort">
<if-compare value="PRUN_CANCELLED" operator="not-equals" field="workEffort.currentStatusId">
<set from-field="parameters.workEffortId" field="lookupComponentsMap.workEffortId"/>
<set value="WEGS_CREATED" field="lookupComponentsMap.statusId"/>
<set field="lookupComponentsMap.workEffortGoodStdTypeId" value="PRUNT_PROD_NEEDED"/>
@@ -41,7 +41,7 @@ under the License.
<filter-list-by-date list-name="components"/>
<!-- now go through each work effort good standard and call a service to issue the inventory -->
<iterate list-name="components" entry-name="component">
<if-not-empty field-name="component.productId">
<if-not-empty field="component.productId">
<clear-field field-name="callSvcMap"/>
<set-service-fields to-map-name="callSvcMap" service-name="issueProductionRunTaskComponent" map-name="component"/>
<set from-field="reserveOrderEnumId" field="callSvcMap.reserveOrderEnumId"/>
@@ -56,7 +56,7 @@ under the License.
</if-not-empty>
</simple-method>
<simple-method method-name="issueProductionRunTaskComponent" short-description="Issues the Inventory for a Production Run Task Component" login-required="false">
<if-empty field-name="parameters.fromDate">
<if-empty field="parameters.fromDate">
<set from-field="parameters.productId" field="productId"/>
<set from-field="parameters.quantity" field="estimatedQuantity" default-value="0.0" type="Double"/>
<else>
@@ -67,7 +67,7 @@ under the License.
<field-map field-name="workEffortGoodStdTypeId" value="PRUNT_PROD_NEEDED"/>
</entity-one>
<set from-field="workEffortGoodStandard.productId" field="productId"/>
<if-empty field-name="parameters.quantity">
<if-empty field="parameters.quantity">
<set from-field="workEffortGoodStandard.estimatedQuantity" field="estimatedQuantity"/>
<else>
<set from-field="parameters.quantity" field="estimatedQuantity" default-value="0.0" type="Double"/>
@@ -77,20 +77,20 @@ under the License.
</if-empty>
<!-- kind of like the inventory reservation routine, find InventoryItems to issue from, but instead of doing the reservation just create an issuance and an inventory item detail for the change -->
<if-not-empty field-name="productId">
<if-not-empty field="productId">
<now-timestamp-to-env env-name="nowTimestamp"/>
<!-- NOTE: the inventory will be issued from the WorkEffort.facilityId -->
<entity-one entity-name="WorkEffort" value-name="workEffort"/>
<!-- before we do the find, put together the orderBy list based on which reserveOrderEnumId is specified -->
<if-compare value="INVRO_FIFO_EXP" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_FIFO_EXP" operator="equals" field="parameters.reserveOrderEnumId">
<set value="+expireDate" field="orderByString"/>
<else>
<if-compare value="INVRO_LIFO_EXP" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_LIFO_EXP" operator="equals" field="parameters.reserveOrderEnumId">
<set value="-expireDate" field="orderByString"/>
<else>
<if-compare value="INVRO_LIFO_REC" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_LIFO_REC" operator="equals" field="parameters.reserveOrderEnumId">
<set value="+datetimeReceived" field="orderByString"/>
<else>
<!-- the default reserveOrderEnumId is INVRO_FIFO_REC, ie FIFO based on date received -->
@@ -106,14 +106,14 @@ under the License.
<set from-field="productId" field="lookupFieldMap.productId"/>
<set from-field="workEffort.facilityId" field="lookupFieldMap.facilityId"/>
<!-- if locationSeqId is passed, then only the inventory items in the location are considered -->
<if-not-empty field-name="parameters.locationSeqId">
<if-not-empty field="parameters.locationSeqId">
<set from-field="parameters.locationSeqId" field="lookupFieldMap.locationSeqId"/>
</if-not-empty>
<find-by-and entity-name="InventoryItem" map-name="lookupFieldMap" list-name="primaryInventoryItemList" order-by-list-name="orderByList"/>
<set from-field="primaryInventoryItemList" field="inventoryItemList"/>
<!-- if secondaryLocationSeqId is also passed, then also the inventory items in the secondary location are considered, after the ones in the main location -->
<if-not-empty field-name="parameters.locationSeqId">
<if-not-empty field-name="parameters.secondaryLocationSeqId">
<if-not-empty field="parameters.locationSeqId">
<if-not-empty field="parameters.secondaryLocationSeqId">
<set from-field="parameters.secondaryLocationSeqId" field="lookupFieldMap.locationSeqId"/>
<find-by-and entity-name="InventoryItem" map-name="lookupFieldMap" list-name="secondaryInventoryItemList" order-by-list-name="orderByList"/>
<list-to-list list-name="secondaryInventoryItemList" to-list-name="inventoryItemList"/>
@@ -131,14 +131,14 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="parameters.failIfItemsAreNotAvailable" operator="not-equals" value="Y" type="String"/>
<if-compare field-name="parameters.quantityNotIssued" operator="greater" value="0" type="Double"/>
<if-compare field="parameters.failIfItemsAreNotAvailable" operator="not-equals" value="Y" type="String"/>
<if-compare field="parameters.quantityNotIssued" operator="greater" value="0" type="Double"/>
</and>
</condition>
<then>
<set field="parameters.useReservedItems" value="Y"/>
<iterate entry-name="inventoryItem" list-name="inventoryItemList">
<if-compare field-name="parameters.quantityNotIssued" operator="greater" value="0" type="Double">
<if-compare field="parameters.quantityNotIssued" operator="greater" value="0" type="Double">
<refresh-value value-name="inventoryItem"/>
<!-- this is a little trick to get the InventoryItem value object without doing a query, possible since all fields on InventoryItem are also on InventoryItemAndLocation with the same names -->
<call-simple-method method-name="issueProductionRunTaskComponentInline"/>
@@ -148,12 +148,12 @@ under the License.
</if>
<!-- if quantityNotIssued is not 0, then pull it from the last non-serialized inventory item found, in the quantityNotIssued field -->
<if-compare field-name="parameters.quantityNotIssued" operator="not-equals" value="0" type="Double">
<if-compare field="parameters.quantityNotIssued" operator="not-equals" value="0" type="Double">
<if>
<condition>
<or>
<if-compare field-name="parameters.failIfItemsAreNotAvailable" operator="equals" value="Y" type="String"/>
<if-compare field-name="parameters.failIfItemsAreNotOnHand" operator="equals" value="Y" type="String"/>
<if-compare field="parameters.failIfItemsAreNotAvailable" operator="equals" value="Y" type="String"/>
<if-compare field="parameters.failIfItemsAreNotOnHand" operator="equals" value="Y" type="String"/>
</or>
</condition>
<then>
@@ -162,7 +162,7 @@ under the License.
</then>
</if>
<check-errors/>
<if-not-empty field-name="lastNonSerInventoryItem">
<if-not-empty field="lastNonSerInventoryItem">
<!-- create ItemIssuance record -->
<set from-field="parameters.workEffortId" field="issuanceCreateMap.workEffortId"/>
<set from-field="lastNonSerInventoryItem.inventoryItemId" field="issuanceCreateMap.inventoryItemId"/>
@@ -221,7 +221,7 @@ under the License.
</if-not-empty>
<calculate field-name="quantityNotIssued" map-name="parameters"><number value="0"/></calculate>
</if-compare>
<if-not-empty field-name="workEffortGoodStandard">
<if-not-empty field="workEffortGoodStandard">
<entity-and list-name="issuances" entity-name="WorkEffortAndInventoryAssign">
<field-map field-name="workEffortId" env-name="workEffortGoodStandard.workEffortId"/>
<field-map field-name="productId" env-name="workEffortGoodStandard.productId"/>
@@ -234,7 +234,7 @@ under the License.
</calcop>
</calculate>
</iterate>
<if-compare-field field-name="workEffortGoodStandard.estimatedQuantity" operator="less-equals" to-field-name="totalIssuance" type="Double">
<if-compare-field field="workEffortGoodStandard.estimatedQuantity" to-field="totalIssuance" operator="less-equals" type="Double">
<set value="WEGS_COMPLETED" field="workEffortGoodStandard.statusId"/>
<store-value value-name="workEffortGoodStandard"/>
</if-compare-field>
@@ -243,9 +243,9 @@ under the License.
</simple-method>
<simple-method method-name="issueProductionRunTaskComponentInline" short-description="Does a issuance for one InventoryItem, meant to be called in-line">
<!-- only do something with this inventoryItem if there is more inventory to issue -->
<if-compare field-name="parameters.quantityNotIssued" operator="greater" value="0" type="Double">
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field-name="inventoryItemTypeId" map-name="inventoryItem">
<if-compare value="INV_AVAILABLE" operator="equals" field-name="statusId" map-name="inventoryItem">
<if-compare field="parameters.quantityNotIssued" operator="greater" value="0" type="Double">
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId">
<if-compare value="INV_AVAILABLE" operator="equals" field="inventoryItem.statusId">
<!-- change status on inventoryItem -->
<set value="INV_DELIVERED" field="inventoryItem.statusId"/>
<store-value value-name="inventoryItem"/>
@@ -265,22 +265,22 @@ under the License.
<if>
<condition>
<and>
<if-empty field-name="inventoryItem.statusId"/>
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM"/>
<if-empty field="inventoryItem.statusId"/>
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM"/>
</and>
</condition>
<then>
<if-compare field-name="parameters.useReservedItems" operator="equals" value="Y">
<if-compare field="parameters.useReservedItems" operator="equals" value="Y">
<set field="inventoryItemQuantity" from-field="inventoryItem.quantityOnHandTotal"/>
<else>
<set field="inventoryItemQuantity" from-field="inventoryItem.availableToPromiseTotal"/>
</else>
</if-compare>
<if-not-empty field-name="inventoryItemQuantity">
<if-not-empty field="inventoryItemQuantity">
<!-- reduce atp on inventoryItem if availableToPromise greater than 0, if not the code at the end of this method will handle it -->
<if-compare field-name="inventoryItemQuantity" operator="greater" value="0" type="Double">
<if-compare-field field-name="parameters.quantityNotIssued" operator="greater" to-field-name="inventoryItemQuantity" type="Double">
<if-compare field="inventoryItemQuantity" operator="greater" value="0" type="Double">
<if-compare-field field="parameters.quantityNotIssued" to-field="inventoryItemQuantity" operator="greater" type="Double">
<set from-field="inventoryItemQuantity" field="parameters.deductAmount"/>
<else>
<set from-field="parameters.quantityNotIssued" field="parameters.deductAmount"/>
@@ -332,8 +332,8 @@ under the License.
<simple-method method-name="issueInventoryItemToWorkEffort" short-description="Issue one InventoryItem to a WorkEffort">
<set field="inventoryItem" from-field="parameters.inventoryItem"/>
<field-to-result field-name="inventoryItem.productId" result-name="finishedProductId"/>
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field-name="inventoryItem.inventoryItemTypeId">
<if-compare value="INV_AVAILABLE" operator="equals" field-name="inventoryItem.statusId">
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId">
<if-compare value="INV_AVAILABLE" operator="equals" field="inventoryItem.statusId">
<!-- change status on inventoryItem -->
<set field="inventoryItem.statusId" value="INV_DELIVERED"/>
<call-service service-name="updateInventoryItem" in-map-name="updateContext"/>
@@ -349,17 +349,17 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM"/>
<not><if-empty field-name="inventoryItem.availableToPromiseTotal"/></not>
<if-compare field-name="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double"/>
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM"/>
<not><if-empty field="inventoryItem.availableToPromiseTotal"/></not>
<if-compare field="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double"/>
</and>
</condition>
<then>
<if>
<condition>
<or>
<if-empty field-name="parameters.quantity"/>
<if-compare-field field-name="parameters.quantity" operator="greater" to-field-name="inventoryItem.availableToPromiseTotal" type="Double"/>
<if-empty field="parameters.quantity"/>
<if-compare-field field="parameters.quantity" to-field="inventoryItem.availableToPromiseTotal" operator="greater" type="Double"/>
</or>
</condition>
<then>
@@ -25,21 +25,21 @@ under the License.
<set from-field="parameters.productId" field="lookupRouting.productId"/>
<set value="ROU_PROD_TEMPLATE" field="lookupRouting.workEffortGoodStdTypeId"/>
<!-- If applicableDate has been passed use the value with all filter-by-date calls-->
<if-not-empty field-name="applicableDate" map-name="parameters">
<if-not-empty field="parameters.applicableDate">
<set from-field="parameters.applicableDate" field="filterDate"/>
<else>
<now-timestamp-to-env env-name="filterDate"/>
</else>
</if-not-empty>
<!-- If a workEffortId has been passed, use it to look up the desired routing-->
<if-not-empty field-name="workEffortId" map-name="parameters">
<if-not-empty field="parameters.workEffortId">
<set from-field="parameters.workEffortId" field="lookupRouting.workEffortId"/>
<find-by-and entity-name="WorkEffortGoodStandard" list-name="routings" map-name="lookupRouting"/>
<filter-list-by-date list-name="routings" valid-date-name="filterDate"/>
<first-from-list list-name="routings" entry-name="routingGS"/>
<!-- If the routing is not associated with our product and it's a variant, then
check to see if it's virtual product has the routing -->
<if-empty field-name="routingGS">
<if-empty field="routingGS">
<entity-condition entity-name="ProductAssoc" list-name="virtualProductAssocList">
<condition-list combine="and">
<condition-expr field-name="productIdTo" env-name="parameters.productId" />
@@ -48,7 +48,7 @@ under the License.
</entity-condition>
<filter-list-by-date list-name="virtualProductAssocList" valid-date-name="filterDate"/>
<first-from-list list-name="virtualProductAssocList" entry-name="virtualProductAssoc"/>
<if-not-empty field-name="virtualProductAssoc">
<if-not-empty field="virtualProductAssoc">
<set from-field="virtualProductAssoc.productId" field="lookupRouting.productId"/>
<find-by-and entity-name="WorkEffortGoodStandard" list-name="routings" map-name="lookupRouting"/>
<!-- Consider the validity against a date passed as (optional) parameter -->
@@ -65,7 +65,7 @@ under the License.
<first-from-list list-name="routings" entry-name="routingGS"/>
<!-- If there are no routings associated with our product and it's a variant, then
check to see if it's virtual product has a routing -->
<if-empty field-name="routingGS">
<if-empty field="routingGS">
<entity-condition entity-name="ProductAssoc" list-name="virtualProductAssocList">
<condition-list combine="and">
<condition-expr field-name="productIdTo" env-name="parameters.productId" />
@@ -74,7 +74,7 @@ under the License.
</entity-condition>
<filter-list-by-date list-name="virtualProductAssocList" valid-date-name="filterDate"/>
<first-from-list list-name="virtualProductAssocList" entry-name="virtualProductAssoc"/>
<if-not-empty field-name="virtualProductAssoc">
<if-not-empty field="virtualProductAssoc">
<set from-field="virtualProductAssoc.productId" field="lookupRouting.productId"/>
<set value="ROU_PROD_TEMPLATE" field="lookupRouting.workEffortGoodStdTypeId"/>
<find-by-and entity-name="WorkEffortGoodStandard" list-name="routings" map-name="lookupRouting"/>
@@ -86,7 +86,7 @@ under the License.
</if-empty>
</else>
</if-not-empty>
<if-not-empty field-name="routingGS">
<if-not-empty field="routingGS">
<clear-field field-name="lookupRouting"/>
<set from-field="routingGS.workEffortId" field="lookupRouting.workEffortId"/>
<find-by-primary-key entity-name="WorkEffort" value-name="routing" map-name="lookupRouting"/>
@@ -96,8 +96,8 @@ under the License.
<if>
<condition>
<or>
<if-empty field-name="parameters.ignoreDefaultRouting"/>
<if-compare field-name="parameters.ignoreDefaultRouting" operator="equals" value="N"/>
<if-empty field="parameters.ignoreDefaultRouting"/>
<if-compare field="parameters.ignoreDefaultRouting" operator="equals" value="N"/>
</or>
</condition>
<then>
@@ -108,7 +108,7 @@ under the License.
</if>
</else>
</if-not-empty>
<if-not-empty field-name="routing">
<if-not-empty field="routing">
<set from-field="routing.workEffortId" field="lookupTasks.workEffortIdFrom"/>
<string-to-list string="sequenceNum" list-name="tasksOrder"/>
<set value="ROUTING_COMPONENT" field="lookupTasks.workEffortAssocTypeId"/>
@@ -22,7 +22,7 @@ under the License.
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="addRoutingTaskAssoc"
short-description="If copyTask field = Y create a copy of the routingTask, in all the case add a RoutingTaskAssociation">
<if-compare field-name="parameters.copyTask" operator="equals" value="Y">
<if-compare field="parameters.copyTask" operator="equals" value="Y">
<make-value value-name="lookupPKMap" entity-name="WorkEffort"/>
<set field="lookupPKMap.workEffortId" from-field="parameters.workEffortIdTo"/>
<find-by-primary-key entity-name="WorkEffort" map-name="lookupPKMap" value-name="lookedUpValue"/>
@@ -33,7 +33,7 @@ under the License.
<result-to-field result-name="workEffortId" map-name="parameters" field-name="workEffortIdTo"/>
</call-service>
</if-compare>
<if-empty field-name="fromDate" map-name="parameters">
<if-empty field="parameters.fromDate">
<now-timestamp-to-env env-name="parameters.fromDate"/>
</if-empty>
<call-map-processor xml-resource="org/ofbiz/manufacturing/techdata/RoutingMapProcs.xml"
@@ -43,7 +43,7 @@ under the License.
<call-service service-name="checkRoutingTaskAssoc" in-map-name="context1">
<result-to-field result-name="sequenceNumNotOk" field-name="sequenceNumNotOk"/>
</call-service>
<if-compare field-name="sequenceNumNotOk" operator="equals" value="Y">
<if-compare field="sequenceNumNotOk" operator="equals" value="Y">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingTwoRoutingTaskWithSameSeqId"/>
</add-error>
@@ -64,7 +64,7 @@ under the License.
<call-service service-name="checkRoutingTaskAssoc" in-map-name="context1">
<result-to-field result-name="sequenceNumNotOk" field-name="sequenceNumNotOk"/>
</call-service>
<if-compare field-name="sequenceNumNotOk" operator="equals" value="Y">
<if-compare field="sequenceNumNotOk" operator="equals" value="Y">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingTwoRoutingTaskWithSameSeqId"/>
</add-error>
@@ -26,7 +26,7 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="TechDataCalendar"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="TechDataCalendar" map-name="lookupPKMap" value-name="newEntity"/>
<if-not-empty field-name="calendarId" map-name="newEntity">
<if-not-empty field="newEntity.calendarId">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarIdAlreadyExist"/>
</add-error>
@@ -35,7 +35,7 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="TechDataCalendarWeek"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="TechDataCalendarWeek" map-name="lookupPKMap" value-name="newEntity"/>
<if-empty field-name="calendarWeekId" map-name="newEntity">
<if-empty field="newEntity.calendarWeekId">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarWeekIdNotExisting"/>
</add-error>
@@ -68,7 +68,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<get-related value-name="lookupPKMap" relation-name="TechDataCalendarExcDay" list-name="relatedResultList" />
<first-from-list entry-name="relatedResult" list-name="relatedResultList"/>
<if-not-empty field-name="relatedResult">
<if-not-empty field="relatedResult">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarExceptionDayUseCalendar"/>
</add-error>
@@ -76,14 +76,14 @@ under the License.
</if-not-empty>
<get-related value-name="lookupPKMap" relation-name="TechDataCalendarExcWeek" list-name="relatedResultList" />
<first-from-list entry-name="relatedResult" list-name="relatedResultList"/>
<if-not-empty field-name="relatedResult">
<if-not-empty field="relatedResult">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarExceptionWeekUseCalendar"/>
</add-error>
<check-errors/>
</if-not-empty>
<find-by-primary-key entity-name="TechDataCalendar" map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-not-empty map-name="lookedUpValue" field-name="calendarWeekId">
<if-not-empty field="lookedUpValue.calendarWeekId">
<remove-value value-name="lookedUpValue"/>
</if-not-empty>
</simple-method>
@@ -94,7 +94,7 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="TechDataCalendarWeek"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="TechDataCalendarWeek" map-name="lookupPKMap" value-name="newEntity"/>
<if-not-empty field-name="calendarWeekId" map-name="newEntity">
<if-not-empty field="newEntity.calendarWeekId">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarWeekIdAlreadyExist"/>
</add-error>
@@ -125,7 +125,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<get-related value-name="lookupPKMap" relation-name="TechDataCalendar" list-name="relatedResultList" />
<first-from-list entry-name="relatedResult" list-name="relatedResultList"/>
<if-not-empty field-name="relatedResult">
<if-not-empty field="relatedResult">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarUseCalendarWeek"/>
</add-error>
@@ -133,14 +133,14 @@ under the License.
</if-not-empty>
<get-related value-name="lookupPKMap" relation-name="TechDataCalendarExcWeek" list-name="relatedResultList" />
<first-from-list entry-name="relatedResult" list-name="relatedResultList"/>
<if-not-empty field-name="relatedResult">
<if-not-empty field="relatedResult">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarWeekExceptionUseCalendarWeek"/>
</add-error>
<check-errors/>
</if-not-empty>
<find-by-primary-key entity-name="TechDataCalendarWeek" map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-not-empty map-name="lookedUpValue" field-name="calendarWeekId">
<if-not-empty field="lookedUpValue.calendarWeekId">
<remove-value value-name="lookedUpValue"/>
</if-not-empty>
</simple-method>
@@ -151,7 +151,7 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="TechDataCalendarExcDay"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="TechDataCalendarExcDay" map-name="lookupPKMap" value-name="newEntity"/>
<if-not-empty field-name="calendarId" map-name="newEntity">
<if-not-empty field="newEntity.calendarId">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarExceptionDayIdAlreadyExist"/>
</add-error>
@@ -181,7 +181,7 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="TechDataCalendarExcDay"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="TechDataCalendarExcDay" map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-not-empty map-name="lookedUpValue" field-name="calendarId">
<if-not-empty field="lookedUpValue.calendarId">
<remove-value value-name="lookedUpValue"/>
</if-not-empty>
</simple-method>
@@ -192,7 +192,7 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="TechDataCalendarExcWeek"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="TechDataCalendarExcWeek" map-name="lookupPKMap" value-name="newEntity"/>
<if-not-empty field-name="calendarId" map-name="newEntity">
<if-not-empty field="newEntity.calendarId">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarExceptionWeekIdAlreadyExist"/>
</add-error>
@@ -222,7 +222,7 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="TechDataCalendarExcWeek"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="TechDataCalendarExcWeek" map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-not-empty map-name="lookedUpValue" field-name="calendarId">
<if-not-empty field="lookedUpValue.calendarId">
<remove-value value-name="lookedUpValue"/>
</if-not-empty>
</simple-method>
@@ -123,7 +123,7 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="userLogin.partyId" operator="not-equals" to-field-name="parameters.partyId"/>
<if-compare-field field="userLogin.partyId" to-field="parameters.partyId" operator="not-equals"/>
<not><if-has-permission permission="MARKETING" action="_CREATE"/></not>
</and>
</condition>
@@ -147,7 +147,7 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="userLogin.partyId" operator="not-equals" to-field-name="parameters.partyId"/>
<if-compare-field field="userLogin.partyId" to-field="parameters.partyId" operator="not-equals"/>
<not><if-has-permission permission="MARKETING" action="_UPDATE"/></not>
</and>
</condition>
@@ -26,7 +26,7 @@ under the License.
<check-errors/>
<make-value entity-name="ContactList" value-name="newEntity"/>
<if-empty field-name="parameters.contactListId">
<if-empty field="parameters.contactListId">
<sequenced-id-to-env sequence-name="ContactList" env-name="newEntity.contactListId"/>
<else>
<set field="newEntity.contactListId" from-field="parameters.contactListId"/>
@@ -55,11 +55,11 @@ under the License.
<!-- ContactListParty methods -->
<simple-method method-name="inlineCheckContactListMechType" short-description="inlineCheckContactListMechType">
<!-- check the preferredContactMechId, make sure it is the right type -->
<if-not-empty field-name="parameters.preferredContactMechId">
<if-not-empty field="parameters.preferredContactMechId">
<entity-one entity-name="ContactMech" value-name="preferredContactMech" auto-field-map="false">
<field-map field-name="contactMechId" env-name="parameters.preferredContactMechId"/>
</entity-one>
<if-compare-field field-name="preferredContactMech.contactMechTypeId" operator="not-equals" to-field-name="contactList.contactMechTypeId">
<if-compare-field field="preferredContactMech.contactMechTypeId" to-field="contactList.contactMechTypeId" operator="not-equals">
<entity-one entity-name="ContactMechType" value-name="preferredContactMechType" auto-field-map="false">
<field-map field-name="contactMechTypeId" env-name="preferredContactMech.contactMechTypeId"/>
</entity-one>
@@ -75,8 +75,8 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="contactList.contactMechTypeId" operator="not-equals" value="EMAIL_ADDRESS"/>
<if-compare field-name="parameters.statusId" operator="equals" value="CLPT_PENDING"/>
<if-compare field="contactList.contactMechTypeId" operator="not-equals" value="EMAIL_ADDRESS"/>
<if-compare field="parameters.statusId" operator="equals" value="CLPT_PENDING"/>
</and>
</condition>
<then>
@@ -89,7 +89,7 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="userLogin.partyId" operator="not-equals" to-field-name="parameters.partyId"/>
<if-compare-field field="userLogin.partyId" to-field="parameters.partyId" operator="not-equals"/>
<not><if-has-permission permission="MARKETING" action="_CREATE"/></not>
</and>
</condition>
@@ -107,7 +107,7 @@ under the License.
<make-value entity-name="ContactListParty" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<create-value value-name="newEntity"/>
@@ -119,7 +119,7 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="userLogin.partyId" operator="not-equals" to-field-name="parameters.partyId"/>
<if-compare-field field="userLogin.partyId" to-field="parameters.partyId" operator="not-equals"/>
<not><if-has-permission permission="MARKETING" action="_UPDATE"/></not>
</and>
</condition>
@@ -132,8 +132,8 @@ under the License.
<call-simple-method method-name="inlineCheckContactListStatusParameter"/>
<entity-one entity-name="ContactListParty" value-name="lookedUpValue"/>
<if-not-empty field-name="parameters.statusId">
<if-compare-field field-name="parameters.statusId" operator="not-equals" to-field-name="lookedUpValue.statusId">
<if-not-empty field="parameters.statusId">
<if-compare-field field="parameters.statusId" to-field="lookedUpValue.statusId" operator="not-equals">
<!-- NOTE: must be parameters as this will have the new statusId, and it will have additional attributes like optInVerifyCode -->
<set-service-fields service-name="createContactListPartyStatus" map-name="parameters" to-map-name="createContactListPartyStatusMap"/>
<call-service service-name="createContactListPartyStatus" in-map-name="createContactListPartyStatusMap"/>
@@ -163,7 +163,7 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="userLogin.partyId" operator="not-equals" to-field-name="parameters.partyId"/>
<if-compare-field field="userLogin.partyId" to-field="parameters.partyId" operator="not-equals"/>
<not><if-has-permission permission="MARKETING" action="_CREATE"/></not>
<not><if-has-permission permission="MARKETING" action="_UPDATE"/></not>
</and>
@@ -181,12 +181,12 @@ under the License.
<!-- if statusId is CLPT_PENDING, set optInVerifyCode; else if statusId is CLPT_ACCEPTED, make sure optInVerifyCode is the same as the last CLPT_PENDING -->
<if>
<condition><if-compare field-name="newEntity.statusId" operator="equals" value="CLPT_PENDING"/></condition>
<condition><if-compare field="newEntity.statusId" operator="equals" value="CLPT_PENDING"/></condition>
<then>
<call-bsh><![CDATA[newEntity.set("optInVerifyCode", Long.toString(Math.round(9999999999L * Math.random())))]]></call-bsh>
</then>
<else-if>
<condition><if-compare field-name="newEntity.statusId" operator="equals" value="CLPT_ACCEPTED"/></condition>
<condition><if-compare field="newEntity.statusId" operator="equals" value="CLPT_ACCEPTED"/></condition>
<then>
<!-- look up the last ContactListPartyStatus with statusId=CLPT_PENDING -->
<entity-condition entity-name="ContactListPartyStatus" list-name="lastContactListPartyStatusList">
@@ -201,9 +201,9 @@ under the License.
<first-from-list entry-name="lastContactListPartyStatus" list-name="lastContactListPartyStatusList"/>
<!-- only require an optInVerifyCode if there was one in place -->
<if-not-empty field-name="lastContactListPartyStatus.optInVerifyCode">
<if-not-empty field-name="parameters.optInVerifyCode">
<if-compare-field field-name="lastContactListPartyStatus.optInVerifyCode" operator="not-equals" to-field-name="parameters.optInVerifyCode">
<if-not-empty field="lastContactListPartyStatus.optInVerifyCode">
<if-not-empty field="parameters.optInVerifyCode">
<if-compare-field field="lastContactListPartyStatus.optInVerifyCode" to-field="parameters.optInVerifyCode" operator="not-equals">
<add-error><fail-message message="The Opt-in Verify Code specified [${parameters.optInVerifyCode}] was not correct. Please check the code you were sent."/></add-error>
</if-compare-field>
<else>
@@ -224,7 +224,7 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="userLogin.partyId" operator="not-equals" to-field-name="parameters.partyId"/>
<if-compare-field field="userLogin.partyId" to-field="parameters.partyId" operator="not-equals"/>
<not><if-has-permission permission="MARKETING" action="_VIEW"/></not>
</and>
</condition>
@@ -239,10 +239,10 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="contactList.verifyEmailFrom"></if-empty></not>
<not><if-empty field-name="contactList.verifyEmailSubject"></if-empty></not>
<not><if-empty field-name="contactList.verifyEmailScreen"></if-empty></not>
<not><if-empty field-name="contactList.verifyEmailWebSiteId"></if-empty></not>
<not><if-empty field="contactList.verifyEmailFrom"></if-empty></not>
<not><if-empty field="contactList.verifyEmailSubject"></if-empty></not>
<not><if-empty field="contactList.verifyEmailScreen"></if-empty></not>
<not><if-empty field="contactList.verifyEmailWebSiteId"></if-empty></not>
</and>
</condition>
<then>
@@ -186,8 +186,8 @@ under the License.
<if>
<condition>
<and>
<if-empty field-name="segmentGroupViewRelatedPartiesList"/>
<!-- <if-empty field-name="segmentGroupViewRelatedPartiesClassList"/> -->
<if-empty field="segmentGroupViewRelatedPartiesList"/>
<!-- <if-empty field="segmentGroupViewRelatedPartiesClassList"/> -->
</and>
</condition>
<then>
@@ -60,10 +60,10 @@ under the License.
<log level="info" message="======== Created contactListId [${contactListId}] ======="/>
<entity-one entity-name="ContactList" value-name="contactList"/>
<assert>
<not><if-empty field-name="contactList"/></not>
<if-compare-field field-name="contactList.contactListTypeId" operator="equals" to-field-name="contactListTypeId"/>
<if-compare-field field-name="contactList.contactListName" operator="equals" to-field-name="contactListName"/>
<if-compare-field field-name="contactList.contactMechTypeId" operator="equals" to-field-name="contactMechTypeId"/>
<not><if-empty field="contactList"/></not>
<if-compare-field field="contactList.contactListTypeId" to-field="contactListTypeId" operator="equals"/>
<if-compare-field field="contactList.contactListName" to-field="contactListName" operator="equals"/>
<if-compare-field field="contactList.contactMechTypeId" to-field="contactMechTypeId" operator="equals"/>
</assert>
<check-errors/>
@@ -82,11 +82,11 @@ under the License.
<entity-one entity-name="ContactList" value-name="contactList"/>
<assert>
<not><if-empty field-name="contactList"/></not>
<if-compare-field field-name="contactList.contactListTypeId" operator="equals" to-field-name="contactListTypeId"/>
<if-compare-field field-name="contactList.contactListName" operator="equals" to-field-name="contactListName"/>
<if-compare-field field-name="contactList.contactMechTypeId" operator="equals" to-field-name="contactMechTypeId"/>
<not><if-empty field="contactList"/></not>
<if-compare-field field="contactList.contactListTypeId" to-field="contactListTypeId" operator="equals"/>
<if-compare-field field="contactList.contactListName" to-field="contactListName" operator="equals"/>
<if-compare-field field="contactList.contactMechTypeId" to-field="contactMechTypeId" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -143,7 +143,7 @@ under the License.
</simple-method>
<simple-method method-name="createTrackingCodeOrderReturns" short-description="Create TrackingCodeOrderReturn for all the Return Items with Orders that have trackingCodeOrder entry">
<if-not-empty field-name="returnId" map-name="parameters">
<if-not-empty field="parameters.returnId">
<set field="returnHeaderFindContext.returnId" from-field="parameters.returnId" />
<find-by-primary-key entity-name="ReturnHeader" value-name="returnHeader" map-name="returnHeaderFindContext"/>
<get-related list-name="returnItems" relation-name="ReturnItem" value-name="returnHeader"/>
@@ -157,7 +157,7 @@ under the License.
<find-by-and entity-name="TrackingCodeOrder" list-name="trackingCodeOrders" map-name="trackingCodeOrderFindContext"/>
<set field="trackingCodeOrder" from-field="trackingCodeOrders[0]"/>
<log level="info" message="Create Tracking Code Order Return For ${trackingCodeOrder}"/>
<if-not-empty field-name="trackingCodeOrder">
<if-not-empty field="trackingCodeOrder">
<set-service-fields to-map-name="trackingCodeOrderReturnContext" service-name="createTrackingCodeOrderReturn" map-name="trackingCodeOrder"/>
<set field="trackingCodeOrderReturnContext.returnId" from-field="parameters.returnId"/>
<set field="trackingCodeOrderReturnContext.orderId" from-field="trackingCodeOrder.orderId"/>
@@ -20,15 +20,15 @@
<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="createAccount" short-description="create Account Group">
<if-not-empty field-name="parameters.accountType">
<if-not-empty field="parameters.accountType">
<set field="accountType" from-field="parameters.accountType"/>
<else>
<set field="accountType" value="GROUP"/>
</else>
</if-not-empty>
<set field="parameters.roleTypeId" value="ACCOUNT"/>
<if-compare field-name="accountType" operator="equals" value="GROUP">
<if-compare field="accountType" operator="equals" value="GROUP">
<call-simple-method method-name="createPartyGroupRoleAndContactMechs" xml-resource="org/ofbiz/party/party/PartySimpleMethods.xml"/>
</if-compare>
</simple-method>
</simple-methods>
</simple-methods>
@@ -22,7 +22,7 @@
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method short-description="Create Contact" method-name="createContact">
<set field="parameters.roleTypeId" value="CONTACT"/>
<if-compare field-name="parameters.quickAdd" operator="not-equals" value="true">
<if-compare field="parameters.quickAdd" operator="not-equals" value="true">
<call-simple-method method-name="createPersonRoleAndContactMechs" xml-resource="org/ofbiz/party/party/PartySimpleMethods.xml"/>
<else>
<call-map-processor processor-name="person" in-map-name="parameters" out-map-name="personCtx"
@@ -31,12 +31,12 @@
<result-to-field result-name="partyId" field-name="partyId"/>
<result-to-result result-name="partyId" service-result-name="partyId"/>
</call-service>
<if-not-empty field-name="parameters.roleTypeId">
<if-not-empty field="parameters.roleTypeId">
<set field="createPartyRoleCtx.partyId" from-field="partyId"/>
<set field="createPartyRoleCtx.roleTypeId" from-field="parameters.roleTypeId"/>
<call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/>
</if-not-empty>
<if-not-empty field-name="parameters.emailAddress">
<if-not-empty field="parameters.emailAddress">
<call-map-processor in-map-name="parameters" out-map-name="emailAddressCtx">
<simple-map-processor name="emailAddress">
<process field="emailAddress">
@@ -74,10 +74,10 @@
<set field="phoneContactMechId" from-field="parameters.phoneContactMechId"/>
<set field="emailContactMechId" from-field="parameters.emailContactMechId"/>
<set field="infoString" from-field="parameters.infoString"/>
<if-compare-field field-name="partyIdTo" operator="not-equals" to-field-name="partyId">
<if-compare field-name="parameters.useAddress2" operator="equals" value="Y" >
<if-not-empty field-name="addrContactMechId">
<if-not-empty field-name="addrContactMechIdTo">
<if-compare-field field="partyIdTo" to-field="partyId" operator="not-equals">
<if-compare field="parameters.useAddress2" operator="equals" value="Y">
<if-not-empty field="addrContactMechId">
<if-not-empty field="addrContactMechIdTo">
<set field="updatePartyContactMechCtx.partyId" from-field="partyIdTo"/>
<set field="updatePartyContactMechCtx.contactMechTypeId" value="POSTAL_ADDRESS"/>
<set field="updatePartyContactMechCtx.contactMechId" from-field="addrContactMechIdTo"/>
@@ -92,9 +92,9 @@
<clear-field field-name="deletePartyContactMechCtx"/>
</if-not-empty>
</if-compare>
<if-compare field-name="parameters.useContactNum2" operator="equals" value="Y" >
<if-not-empty field-name="phoneContactMechId">
<if-not-empty field-name="phoneContactMechIdTo">
<if-compare field="parameters.useContactNum2" operator="equals" value="Y">
<if-not-empty field="phoneContactMechId">
<if-not-empty field="phoneContactMechIdTo">
<set field="updatePartyContactMechCtx.partyId" from-field="partyIdTo"/>
<set field="updatePartyContactMechCtx.contactMechId" from-field="phoneContactMechIdTo"/>
<set field="updatePartyContactMechCtx.contactMechTypeId" value="TELECOM_NUMBER"/>
@@ -109,9 +109,9 @@
<clear-field field-name="deletePartyContactMechCtx"/>
</if-not-empty>
</if-compare>
<if-compare field-name="parameters.useEmail2" operator="equals" value="Y" >
<if-not-empty field-name="emailContactMechId">
<if-not-empty field-name="emailContactMechIdTo">
<if-compare field="parameters.useEmail2" operator="equals" value="Y">
<if-not-empty field="emailContactMechId">
<if-not-empty field="emailContactMechIdTo">
<set field="updatePartyContactMechCtx.partyId" from-field="partyIdTo"/>
<set field="updatePartyContactMechCtx.contactMechId" from-field="emailContactMechIdTo"/>
<set field="updatePartyContactMechCtx.contactMechTypeId" value="EMAIL_ADDRESS"/>
@@ -23,7 +23,7 @@
<simple-method method-name="createLead" short-description="create Lead Person or Lead Group">
<set field="parameters.roleTypeId" value="LEAD"/>
<if-compare field-name="parameters.quickAdd" operator="not-equals" value="Y">
<if-compare field="parameters.quickAdd" operator="not-equals" value="Y">
<call-simple-method method-name="createPersonRoleAndContactMechs" xml-resource="org/ofbiz/party/party/PartySimpleMethods.xml"/>
<else>
<call-map-processor processor-name="person" in-map-name="parameters" out-map-name="personCtx"
@@ -32,12 +32,12 @@
<result-to-field result-name="partyId" field-name="partyId"/>
<result-to-result result-name="partyId" service-result-name="partyId"/>
</call-service>
<if-not-empty field-name="parameters.roleTypeId">
<if-not-empty field="parameters.roleTypeId">
<set field="createPartyRoleCtx.partyId" from-field="partyId"/>
<set field="createPartyRoleCtx.roleTypeId" from-field="parameters.roleTypeId"/>
<call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/>
</if-not-empty>
<if-not-empty field-name="parameters.emailAddress">
<if-not-empty field="parameters.emailAddress">
<call-map-processor in-map-name="parameters" out-map-name="emailAddressCtx">
<simple-map-processor name="emailAddress">
<process field="emailAddress">
@@ -55,7 +55,7 @@
</else>
</if-compare>
<if-not-empty field-name="userLogin.partyId">
<if-not-empty field="userLogin.partyId">
<set field="createPartyRoleCtx.partyId" from-field="userLogin.partyId"/>
<set field="createPartyRoleCtx.roleTypeId" value="OWNER"/>
@@ -73,7 +73,7 @@
<call-service service-name="setPartyStatus" in-map-name="updatePartyCtx"/>
</if-not-empty>
<!-- Now create PartyGroup corresponding to the companyName, if its not null and then set up relationship of Person and PartyGroup as Employee and title -->
<if-not-empty field-name="parameters.groupName">
<if-not-empty field="parameters.groupName">
<set field="parameters.partyTypeId" value="PARTY_GROUP"/>
<call-map-processor processor-name="partyGroup" in-map-name="parameters" out-map-name="partyGroupCtx"
xml-resource="org/ofbiz/party/party/PartyMapProcs.xml"/>
@@ -98,7 +98,7 @@
</if-not-empty>
<log level="verbose" message=" ${partyGroupPartyId}"></log>
<if-not-empty field-name="parameters.leadSource">
<if-not-empty field="parameters.leadSource">
<make-value entity-name="DataSource" value-name="dataSource"/>
<sequenced-id-to-env sequence-name="DataSource" env-name="dataSourceId"/>
<set field="dataSource.dataSourceId" from-field="dataSourceId"/>
@@ -131,7 +131,7 @@
<filter-list-by-date list-name="partyRelationships" to-list-name="partyRelationships"/>
<first-from-list list-name="partyRelationships" entry-name="partyRelationship"/>
<if-not-empty field-name="partyRelationship">
<if-not-empty field="partyRelationship">
<set-service-fields service-name="updatePartyRelationship" map-name="partyRelationship" to-map-name="deletePartyRelationship"/>
<call-service service-name="deletePartyRelationship" in-map-name="deletePartyRelationship"/>
<set field="partyGroupId" from-field="partyRelationship.partyIdFrom"/>
@@ -140,7 +140,7 @@
</else>
</if-not-empty>
<if-empty field-name="partyGroupId">
<if-empty field="partyGroupId">
<add-error><fail-message message="Party Group ID not found in realtionship AND not supplied"/></add-error>
</if-empty>
<check-errors/>
@@ -23,7 +23,7 @@
<simple-method method-name="createOpportunity" short-description="Create Opportunity for SFA">
<make-value entity-name="SalesOpportunity" value-name="newEntity"/>
<if-empty field-name="parameters.salesOpportunityId">
<if-empty field="parameters.salesOpportunityId">
<sequenced-id-to-env sequence-name="SalesOpportunity" env-name="parameters.salesOpportunityId"/>
</if-empty>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -58,7 +58,7 @@ under the License.
</call-map-processor>
<!-- Create the Postal Address -->
<if-compare field-name="parameters.useAddress" operator="equals" value="true">
<if-compare field="parameters.useAddress" operator="equals" value="true">
<call-map-processor in-map-name="parameters" out-map-name="addressContext">
<simple-map-processor name="newAddress">
<make-in-string field="fullName">
@@ -91,15 +91,15 @@ under the License.
<process field="allowSolicitation"><copy/></process>
</simple-map-processor>
</call-map-processor>
<if-compare value="USA" operator="equals" field-name="countryGeoId" map-name="parameters">
<if-empty field-name="stateProvinceGeoId" map-name="parameters">
<if-compare value="USA" operator="equals" field="parameters.countryGeoId">
<if-empty field="parameters.stateProvinceGeoId">
<add-error>
<fail-property resource="PartyUiLabels" property="PartyStateInUsMissing"/>
</add-error>
</if-empty>
</if-compare>
<if-compare value="CAN" operator="equals" field-name="countryGeoId" map-name="parameters">
<if-empty field-name="stateProvinceGeoId" map-name="parameters">
<if-compare value="CAN" operator="equals" field="parameters.countryGeoId">
<if-empty field="parameters.stateProvinceGeoId">
<add-error>
<fail-property resource="PartyUiLabels" property="PartyProveinceInCanadaMissing"/>
</add-error>
@@ -142,14 +142,14 @@ under the License.
<simple-method method-name="createUpdateCustomerInfo" short-description="Create Customer" login-required="false">
<!-- update the email address -->
<if-not-empty field-name="parameters.emailContactMechId">
<if-not-empty field="parameters.emailContactMechId">
<set from-field="partyId" field="emailMap.partyId"/>
<set from-field="parameters.emailContactMechId" field="emailMap.contactMechId"/>
<!-- call the update email service -->
<call-service service-name="updatePartyEmailAddress" in-map-name="emailMap"/>
<else>
<!-- create the email address -->
<if-not-empty field-name="parameters.emailAddress">
<if-not-empty field="parameters.emailAddress">
<set from-field="partyId" field="emailMap.partyId"/>
<set field="emailMap.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
<!-- call the create email service -->
@@ -160,14 +160,14 @@ under the License.
<!-- create home phone -->
<if-not-empty field-name="parameters.homePhoneContactMechId">
<if-not-empty field="parameters.homePhoneContactMechId">
<set from-field="partyId" field="homePhoneMap.partyId"/>
<set from-field="parameters.homePhoneContactMechId" field="homePhoneMap.contactMechId"/>
<!-- call update telecom service -->
<call-service service-name="updatePartyTelecomNumber" in-map-name="homePhoneMap"/>
<else>
<!-- create home phone -->
<if-not-empty field-name="homeContactNumber" map-name="parameters">
<if-not-empty field="parameters.homeContactNumber">
<set from-field="partyId" field="homePhoneMap.partyId"/>
<set field="homePhoneMap.contactMechPurposeTypeId" value="PHONE_HOME"/>
<!-- call create telecom service -->
@@ -177,14 +177,14 @@ under the License.
</if-not-empty>
<!-- create work phone -->
<if-not-empty field-name="parameters.workPhoneContactMechId">
<if-not-empty field="parameters.workPhoneContactMechId">
<set from-field="partyId" field="workPhoneMap.partyId"/>
<set from-field="parameters.workPhoneContactMechId" field="workPhoneMap.contactMechId"/>
<!-- call update telecom service -->
<call-service service-name="updatePartyTelecomNumber" in-map-name="workPhoneMap"/>
<else>
<!-- create work phone -->
<if-not-empty field-name="workContactNumber" map-name="parameters">
<if-not-empty field="parameters.workContactNumber">
<set from-field="partyId" field="workPhoneMap.partyId"/>
<set field="workPhoneMap.contactMechPurposeTypeId" value="PHONE_WORK"/>
<!-- call create telecom service -->
@@ -194,7 +194,7 @@ under the License.
</if-not-empty>
<!-- shipping address -->
<if-not-empty field-name="parameters.shippingContactMechId">
<if-not-empty field="parameters.shippingContactMechId">
<set from-field="partyId" field="addressContext.partyId"/>
<set from-field="parameters.shippingContactMechId" field="addressContext.contactMechId"/>
<!-- call the update address service -->
@@ -203,7 +203,7 @@ under the License.
<result-to-request result-name="contactMechId"/>
</call-service>
<else>
<if-compare field-name="parameters.useAddress" operator="equals" value="true">
<if-compare field="parameters.useAddress" operator="equals" value="true">
<set from-field="partyId" field="addressContext.partyId"/>
<call-service service-name="createPartyPostalAddress" in-map-name="addressContext">
<result-to-field result-name="contactMechId" map-name="addressPurposeContext"/>
@@ -234,13 +234,13 @@ under the License.
</call-service>
<!-- the rest of the methods require a userLogin object; so if we are anonymous lets fake it -->
<if-empty field-name="userLogin">
<if-empty field="userLogin">
<set field="ulLookup.userLoginId" value="anonymous"/>
<find-by-primary-key entity-name="UserLogin" map-name="ulLookup" value-name="userLogin"/>
<set field="userLogin.partyId" from-field="tempMap.partyId"/>
<set-current-user-login value-name="userLogin"/>
<else><!-- of an anonymous vistor is coming back, update the party id in the userLogin object -->
<if-compare field-name="userLogin.userLoginId" value="anonymous" operator="equals">
<if-compare field="userLogin.userLoginId" value="anonymous" operator="equals">
<set field="userLogin.partyId" from-field="tempMap.partyId"/>
</if-compare>
</else>
@@ -257,7 +257,7 @@ under the License.
<call-simple-method method-name="createUpdateCustomerInfo"/>
<!-- create userLogin -->
<if-not-empty field-name="userLoginId" map-name="parameters">
<if-not-empty field="parameters.userLoginId">
<set field="loginMap.userLoginId" from-field="parameters.userLoginId"/>
<!-- call create userLogin -->
<!-- call reset password (to email a password) -->
@@ -265,7 +265,7 @@ under the License.
</simple-method>
<simple-method method-name="updateCustomer" short-description="Update Customer" login-required="true">
<if-empty field-name="parameters.partyId"><add-error><fail-property resource="EcommerceUiLabels" property="PartyNoPartyForUpdateCustomer"/></add-error></if-empty>
<if-empty field="parameters.partyId"><add-error><fail-property resource="EcommerceUiLabels" property="PartyNoPartyForUpdateCustomer"/></add-error></if-empty>
<call-simple-method method-name="validateCustomerInfo"/>
@@ -100,4 +100,4 @@ This file contains basic services for SalesOpportunity and SalesForecast.
<entity-one entity-name="SalesForecastDetail" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -29,7 +29,7 @@ under the License.
<make-value entity-name="OrderDeliverySchedule" value-name="schedule"/>
<set-pk-fields map-name="parameters" value-name="schedule"/>
<if-empty field-name="orderItemSeqId" map-name="schedule">
<if-empty field="schedule.orderItemSeqId">
<set value="_NA_" field="schedule.orderItemSeqId"/>
</if-empty>
@@ -75,7 +75,7 @@ under the License.
<call-simple-method method-name="checkSupplierRelatedPermission"/>
<check-errors/>
<if-empty field-name="parameters.orderItemSeqId">
<if-empty field="parameters.orderItemSeqId">
<set field="parameters.orderItemSeqId" value="_NA_"/>
</if-empty>
@@ -109,7 +109,7 @@ under the License.
<!-- set subject, contentType, templateName, templateData -->
<set field="sendEmailMap.subject" value="Delivery Information Updated for Order #${orderDeliverySchedule.orderId}"/>
<if-compare field-name="orderDeliverySchedule.orderItemSeqId" operator="not-equals" value="_NA_">
<if-compare field="orderDeliverySchedule.orderItemSeqId" operator="not-equals" value="_NA_">
<string-append string=" Item #${orderDeliverySchedule.orderItemSeqId}" field-name="subject" map-name="sendEmailMap"/>
</if-compare>
<set field="sendEmailMap.contentType" value="text/html"/>
@@ -121,8 +121,8 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="sendTo" map-name="sendEmailMap"/></not>
<not><if-empty field-name="sendFrom" map-name="sendEmailMap"/></not>
<not><if-empty field="sendEmailMap.sendTo"/></not>
<not><if-empty field="sendEmailMap.sendFrom"/></not>
</and>
</condition>
<then>
@@ -143,10 +143,10 @@ under the License.
<!-- Should be called in-line to use its out parameter indicating whether the user has permission or not. -->
<simple-method method-name="checkSupplierRelatedPermission" short-description="Check Supplier Related Permission">
<if-empty field-name="callingMethodName">
<if-empty field="callingMethodName">
<set value="this operation" field="callingMethodName"/>
</if-empty>
<if-empty field-name="checkAction">
<if-empty field="checkAction">
<set value="UPDATE" field="checkAction"/>
</if-empty>
<set field="hasSupplierRelatedPermission" value="false"/>
@@ -164,7 +164,7 @@ under the License.
<find-by-primary-key entity-name="OrderRole" map-name="lookupOrderRoleMap" value-name="permOrderRole"/>
<if>
<condition>
<if-empty field-name="permOrderRole"/>
<if-empty field="permOrderRole"/>
</condition>
<then>
<set field="hasSupplierRelatedPermission" value="false"/>
@@ -27,7 +27,7 @@ under the License.
<condition>
<and>
<not><if-has-permission permission="ORDERMGR" action="_CREATE"/></not>
<not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-field-name="fromPartyId" to-map-name="parameters"/></not>
<not><if-compare-field field="userLogin.partyId" to-field="parameters.fromPartyId" operator="equals"/></not>
</and>
</condition>
<then>
@@ -35,9 +35,9 @@ under the License.
</then>
</if>
<if-empty field-name="parameters.toPartyId">
<if-empty field="parameters.toPartyId">
<!-- no toPartyId was specified. use destination facility to determine the party of the return -->
<if-not-empty field-name="parameters.destinationFacilityId">
<if-not-empty field="parameters.destinationFacilityId">
<entity-one entity-name="Facility" value-name="destinationFacility" auto-field-map="false">
<field-map field-name="facilityId" env-name="parameters.destinationFacilityId"/>
</entity-one>
@@ -51,7 +51,7 @@ under the License.
<field-map field-name="partyId" env-name="parameters.toPartyId"/>
<field-map field-name="roleTypeId" value="INTERNAL_ORGANIZATIO"/>
</entity-one>
<if-empty field-name="partyRole">
<if-empty field="partyRole">
<add-error><fail-message message="Error: a return must be to a party in the role of internal organization"/></add-error>
</if-empty>
</else>
@@ -59,7 +59,7 @@ under the License.
<check-errors/>
<!-- check the needs (auto) inventory receive flag (default to no) -->
<if-empty field-name="parameters.needsInventoryReceive">
<if-empty field="parameters.needsInventoryReceive">
<set field="parameters.needsInventoryReceive" value="N"/>
</if-empty>
@@ -71,7 +71,7 @@ under the License.
<call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
<result-to-field result-name="partyAccountingPreference" field-name="partyAcctgPreference"/>
</call-service>
<if-compare field-name="partyAcctgPreference.useInvoiceIdForReturns" operator="equals" value="Y">
<if-compare field="partyAcctgPreference.useInvoiceIdForReturns" operator="equals" value="Y">
<set field="getNextInvoiceIdMap.partyId" from-field="parameters.toPartyId"/>
<call-service service-name="getNextInvoiceId" in-map-name="getNextInvoiceIdMap">
<result-to-field result-name="invoiceId" field-name="newEntity.returnId"/>
@@ -93,11 +93,11 @@ under the License.
</then>
</if>
<if-empty field-name="newEntity.entryDate">
<if-empty field="newEntity.entryDate">
<set from-field="nowTimestamp" field="newEntity.entryDate"/>
</if-empty>
<if-empty field-name="newEntity.statusId">
<if-empty field="newEntity.statusId">
<set value="RETURN_REQUESTED" field="newEntity.statusId"/>
</if-empty>
<set field="newEntity.createdBy" from-field="userLogin.userLoginId"/>
@@ -113,7 +113,7 @@ under the License.
<entity-one entity-name="ReturnHeader" value-name="returnHeader"/>
<!-- test the total return amount vs the total order amount -->
<if-compare field-name="parameters.statusId" value="RETURN_ACCEPTED" operator="equals">
<if-compare field="parameters.statusId" value="RETURN_ACCEPTED" operator="equals">
<!-- get the list of ReturnItems. Note: return may be associated with many different orders -->
<entity-condition entity-name="ReturnItem" list-name="returnItems" distinct="true">
<condition-expr field-name="returnId" env-name="returnHeader.returnId"/>
@@ -143,11 +143,11 @@ under the License.
<if>
<condition>
<and>
<if-empty field-name="returnHeader.paymentMethodId"/>
<if-empty field-name="parameters.paymentMethodId"/><!-- because we haven't done the set-nonpk-fields yet, check this too -->
<if-empty field="returnHeader.paymentMethodId"/>
<if-empty field="parameters.paymentMethodId"/><!-- because we haven't done the set-nonpk-fields yet, check this too -->
<or>
<if-compare field-name="returnItem.returnTypeId" operator="equals" value="RTN_CSREPLACE"/>
<if-compare field-name="returnItem.returnTypeId" operator="equals" value="RTN_REPAIR_REPLACE"/>
<if-compare field="returnItem.returnTypeId" operator="equals" value="RTN_CSREPLACE"/>
<if-compare field="returnItem.returnTypeId" operator="equals" value="RTN_REPAIR_REPLACE"/>
</or>
</and>
</condition>
@@ -167,7 +167,7 @@ under the License.
</calculate>
<!-- compare return vs order total -->
<if-not-empty field-name="returnItem.orderId">
<if-not-empty field="returnItem.orderId">
<set field="returnTotalCtx.orderId" from-field="returnItem.orderId"/>
<!-- no adjustment needed: adjustment is passed in to calculate the effect of an additional item on return total. -->
<calculate field-name="returnTotalCtx.adjustment" type="BigDecimal"><number value="0.0"/></calculate>
@@ -178,7 +178,7 @@ under the License.
</call-service>
<log level="info" message="Available amount for return on order #${returnItem.orderId} is [${availableReturnTotal}] (orderTotal = [${orderTotal}] - returnTotal = [${returnTotal}]"/>
<if-compare field-name="availableReturnTotal" operator="less" value="-0.01" type="BigDecimal">
<if-compare field="availableReturnTotal" operator="less" value="-0.01" type="BigDecimal">
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderReturnPriceCannotExceedTheOrderTotal"/></add-error>
</if-compare>
<check-errors/>
@@ -191,15 +191,15 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="parameters.statusId"></if-empty></not>
<if-compare-field operator="not-equals" field-name="parameters.statusId" to-field-name="returnHeader.statusId"/>
<not><if-empty field="parameters.statusId"></if-empty></not>
<if-compare-field operator="not-equals" field="parameters.statusId" to-field="returnHeader.statusId"/>
</and>
</condition>
<then>
<set field="statusIdTo" from-field="parameters.statusId"/>
<set field="statusId" from-field="returnHeader.statusId"/>
<entity-one entity-name="StatusValidChange" value-name="statusValidChange"/>
<if-empty field-name="statusValidChange">
<if-empty field="statusValidChange">
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderErrorReturnHeaderItemStatusNotChangedIsNotAValidChange"/></add-error>
</if-empty>
<check-errors/>
@@ -215,7 +215,7 @@ under the License.
</calcop>
</calculate>
</iterate>
<if-compare field-name="returnTotalAmount" operator="less" value="0" type="Double">
<if-compare field="returnTotalAmount" operator="less" value="0" type="Double">
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderReturnTotalCannotLessThanZero"/></add-error>
</if-compare>
<check-errors/>
@@ -234,7 +234,7 @@ under the License.
<condition>
<and>
<not><if-has-permission permission="ORDERMGR" action="_CREATE"/></not>
<not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-field-name="fromPartyId" to-map-name="returnHeader"/></not>
<not><if-compare-field field="userLogin.partyId" to-field="returnHeader.fromPartyId" operator="equals"/></not>
</and>
</condition>
<then>
@@ -243,13 +243,13 @@ under the License.
</if>
<check-errors/>
<if-empty field-name="returnItemTypeId" map-name="parameters">
<if-not-empty field-name="returnItemMapKey" map-name="parameters">
<if-empty field="parameters.returnItemTypeId">
<if-not-empty field="parameters.returnItemMapKey">
<!-- find the item mapping -->
</if-not-empty>
</if-empty>
<if-empty field-name="returnItemTypeId" map-name="parameters">
<if-empty field="parameters.returnItemTypeId">
<add-error><fail-message message="Return Item Type is not defined for this item; or no mapping was found."/></add-error>
<check-errors/>
</if-empty>
@@ -257,11 +257,11 @@ under the License.
<if>
<condition>
<and>
<if-empty field-name="returnHeader.paymentMethodId"/>
<if-compare field-name="returnHeader.statusId" operator="equals" value="RETURN_ACCEPTED"/>
<if-empty field="returnHeader.paymentMethodId"/>
<if-compare field="returnHeader.statusId" operator="equals" value="RETURN_ACCEPTED"/>
<or>
<if-compare field-name="parameters.returnTypeId" operator="equals" value="RTN_CSREPLACE"/>
<if-compare field-name="parameters.returnTypeId" operator="equals" value="RTN_REPAIR_REPLACE"/>
<if-compare field="parameters.returnTypeId" operator="equals" value="RTN_CSREPLACE"/>
<if-compare field="parameters.returnTypeId" operator="equals" value="RTN_REPAIR_REPLACE"/>
</or>
</and>
</condition>
@@ -271,7 +271,7 @@ under the License.
</if>
<check-errors/>
<if-compare field-name="returnQuantity" map-name="parameters" operator="equals" value="0" type="Double">
<if-compare field="parameters.returnQuantity" operator="equals" value="0" type="Double">
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderNoReturnQuantityAvailablePreviousReturnsMayExist"/></add-error>
<check-errors/>
</if-compare>
@@ -281,10 +281,10 @@ under the License.
<set field="returnablePrice" value="0" type="Double"/>
<!-- if an orderItemSeqId is provided, then find the corresponding orderItem -->
<if-not-empty field-name="parameters.orderItemSeqId">
<if-not-empty field="parameters.orderItemSeqId">
<make-value value-name="itemLookup" entity-name="OrderItem"/>
<set-pk-fields map-name="parameters" value-name="itemLookup"/>
<if-not-empty field-name="parameters.orderItemSeqId">
<if-not-empty field="parameters.orderItemSeqId">
<find-by-primary-key entity-name="OrderItem" value-name="orderItem" map-name="itemLookup"/>
<log level="info" message="Return item is an OrderItem - ${orderItem.orderItemSeqId}"/>
</if-not-empty>
@@ -292,7 +292,7 @@ under the License.
<!-- get the returnableQuantity and returnablePrice: for orderItems, it's found by getReturnableQuantity; for adjustments,
either order adjustments or manual adjustments, it's always 1 and based on input parameter -->
<if-not-empty field-name="orderItem">
<if-not-empty field="orderItem">
<set field="serviceContext.orderItem" from-field="orderItem"/>
<call-service service-name="getReturnableQuantity" in-map-name="serviceContext">
<result-to-field result-name="returnableQuantity" field-name="returnableQuantity"/>
@@ -301,7 +301,7 @@ under the License.
</if-not-empty>
<if-compare field-name="returnableQuantity" value="0" operator="greater" type="Double">
<if-compare field="returnableQuantity" value="0" operator="greater" type="Double">
<!-- the user is only allowed to set a returnPrice if he has ORDERMGR_CREATE privilege, otherwise only the returnablePrice
calculated by service is used -->
<if>
@@ -314,13 +314,13 @@ under the License.
</if>
<!-- make sure the returnQuantity is not greater than the returnableQuantity from service or the quantity on the original orderItem -->
<if-compare-field field-name="returnQuantity" map-name="parameters" operator="greater" to-field-name="returnableQuantity" type="Double">
<if-compare-field field="parameters.returnQuantity" to-field="returnableQuantity" operator="greater" type="Double">
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderRequestedReturnQuantityNotAvailablePreviousReturnsMayExist"/></add-error>
</if-compare-field>
<!-- SC 20060202: Is this really needed? Or does the above duplicate it. If not, we should remove it -->
<if-not-empty field-name="orderItem">
<if-compare-field field-name="returnQuantity" map-name="parameters" operator="greater" to-field-name="quantity" to-map-name="orderItem" type="Double">
<if-not-empty field="orderItem">
<if-compare-field field="parameters.returnQuantity" to-field="orderItem.quantity" operator="greater" type="Double">
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderReturnQuantityCannotExceedTheOrderedQuantity"/></add-error>
</if-compare-field>
</if-not-empty>
@@ -336,8 +336,8 @@ under the License.
</calculate>
<!-- just checking greater-equals sometimes returns an error if the difference is actually zero -->
<if-compare-field field-name="returnPriceDelta" operator="not-equals" to-field-name="zero" type="Double">
<if-compare-field field-name="returnPriceDelta" operator="greater-equals" to-field-name="epsilon" type="Double">
<if-compare-field field="returnPriceDelta" to-field="zero" operator="not-equals" type="Double">
<if-compare-field field="returnPriceDelta" to-field="epsilon" operator="greater-equals" type="Double">
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderReturnPriceCannotExceedThePurchasePrice"/></add-error>
</if-compare-field >
</if-compare-field>
@@ -360,7 +360,7 @@ under the License.
<set from-field="parameters.returnId" field="lookupMap.returnId"/>
<string-to-list string="-returnItemSeqId" list-name="orderBy"/>
<find-by-and entity-name="ReturnItem" list-name="currentItems" map-name="lookupMap" order-by-list-name="orderBy"></find-by-and>
<if-empty field-name="currentItems">
<if-empty field="currentItems">
<set value="1" field="newEntity.returnItemSeqId"/>
<else>
<first-from-list entry-name="newestItem" list-name="currentItems"/>
@@ -383,13 +383,13 @@ under the License.
<if>
<condition>
<or>
<if-empty field-name="parameters.includeAdjustments"/>
<if-compare field-name="parameters.includeAdjustments" operator="equals" value="Y"/>
<if-empty field="parameters.includeAdjustments"/>
<if-compare field="parameters.includeAdjustments" operator="equals" value="Y"/>
</or>
</condition>
<then>
<!-- create return adjustments for all adjustments associated with the order item -->
<if-not-empty field-name="orderItem">
<if-not-empty field="orderItem">
<get-related value-name="orderItem" relation-name="OrderAdjustment" list-name="orderAdjustments"/>
<iterate entry-name="orderAdjustment" list-name="orderAdjustments">
<clear-field field-name="returnAdjCtx"/>
@@ -450,7 +450,7 @@ under the License.
<set from-field="parameters.returnId" field="headerPKMap.returnId"/>
<find-by-primary-key entity-name="ReturnHeader" map-name="headerPKMap" value-name="returnHeader"/>
<if-compare field-name="statusId" map-name="returnHeader" operator="not-equals" type="String" value="RETURN_REQUESTED">
<if-compare field="returnHeader.statusId" operator="not-equals" type="String" value="RETURN_REQUESTED">
<add-error><fail-property resource="OrderErrorUiLabels" property="OrderCannotRemoveItemsOnceReturnIsApproved"/></add-error>
<check-errors/>
</if-compare>
@@ -495,7 +495,7 @@ under the License.
<set from-field="parameters.returnAdjustmentId" field="lookupPKMap.returnAdjustmentId"/>
<find-by-primary-key entity-name="ReturnAdjustment" map-name="lookupPKMap" value-name="returnAdjustment"/>
<if-not-empty field-name="returnAdjustment">
<if-not-empty field="returnAdjustment">
<remove-value value-name="returnAdjustment"/>
</if-not-empty>
</simple-method>
@@ -508,7 +508,7 @@ under the License.
<find-by-primary-key entity-name="ReturnHeader" map-name="lookupPKMap" value-name="returnHeader"/>
<find-by-and entity-name="ShipmentReceipt" map-name="lookupPKMap" list-name="shipmentReceipts"/>
<iterate list-name="shipmentReceipts" entry-name="receipt">
<if-empty field-name="${receipt.returnItemSeqId}" map-name="totalsMap">
<if-empty field="totalsMap.${receipt.returnItemSeqId}">
<calculate field-name="${receipt.returnItemSeqId}" map-name="totalsMap">
<number value="0"/>
</calculate>
@@ -526,7 +526,7 @@ under the License.
</entity-one>
<set field="returnItem.receivedQuantity" from-field="totalsMap.${receipt.returnItemSeqId}"/>
<if-compare-field field-name="totalsMap.${receipt.returnItemSeqId}" operator="greater-equals" to-field-name="returnItem.returnQuantity" type="Double">
<if-compare-field field="totalsMap.${receipt.returnItemSeqId}" to-field="returnItem.returnQuantity" operator="greater-equals" type="Double">
<!-- update the status for the item -->
<set field="returnItem.statusId" value="RETURN_RECEIVED"/>
<store-value value-name="returnItem"/>
@@ -553,8 +553,8 @@ under the License.
<set field="allReceived" value="true"/>
<find-by-and entity-name="ReturnItem" map-name="lookupPKMap" list-name="allReturnItems"/>
<iterate list-name="allReturnItems" entry-name="item">
<if-compare field-name="statusId" map-name="item" operator="not-equals" value="RETURN_RECEIVED">
<if-not-empty field-name="orderItemSeqId" map-name="item">
<if-compare field="item.statusId" operator="not-equals" value="RETURN_RECEIVED">
<if-not-empty field="item.orderItemSeqId">
<!-- non-order items (i.e. adjustments) are not received -->
<set value="false" field="allReceived"/>
</if-not-empty>
@@ -562,15 +562,15 @@ under the License.
</iterate>
<!-- if the items are all received, then update the return header, store the status history change, and set the shipment to received -->
<if-compare field-name="allReceived" operator="equals" value="true">
<if-compare field="allReceived" operator="equals" value="true">
<!-- Go through all the items yet again and set their shipment status to PURCH_SHIP_RECEIVED (if it isn't already)
This activates SECAS such as creating return invoices. This MUST be done before updating the return header so that
the ReturnItemBillings are created and then whatever SECA binds to the return header update will have them. . -->
<iterate list-name="shipmentReceipts" entry-name="receipt">
<get-related-one relation-name="Shipment" value-name="receipt" to-value-name="shipment"/>
<if-not-empty field-name="shipment.shipmentId">
<if-compare field-name="statusId" map-name="shipment" operator="not-equals" value="RETURN_RECEIVED">
<if-not-empty field="shipment.shipmentId">
<if-compare field="shipment.statusId" operator="not-equals" value="RETURN_RECEIVED">
<set field="serviceInput.shipmentId" from-field="shipment.shipmentId"/>
<set field="serviceInput.statusId" value="PURCH_SHIP_RECEIVED"/>
<call-service service-name="updateShipment" in-map-name="serviceInput"/>
@@ -610,7 +610,7 @@ under the License.
<condition>
<and>
<not><if-has-permission permission="ORDERMGR" action="_CREATE"/></not>
<not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-field-name="fromPartyId" to-map-name="parameters"/></not>
<not><if-compare-field field="userLogin.partyId" to-field="parameters.fromPartyId" operator="equals"/></not>
</and>
</condition>
<then>
@@ -643,7 +643,7 @@ under the License.
<get-related-one relation-name="ProductStore" value-name="orderHeader" to-value-name="productStore"/>
<set from-field="productStore.payToPartyId" field="createHeaderCtx.toPartyId"/>
<if-empty field-name="destinationFacilityId" map-name="createHeaderCtx">
<if-empty field="createHeaderCtx.destinationFacilityId">
<get-related-one value-name="orderHeader" relation-name="ProductStore" to-value-name="productStore"/>
<set from-field="productStore.inventoryFacilityId" field="createHeaderCtx.destinationFacilityId"/>
</if-empty>
@@ -663,10 +663,10 @@ under the License.
</condition-list>
</entity-condition>
<if-empty field-name="returnReasonId" map-name="parameters">
<if-empty field="parameters.returnReasonId">
<set value="RTN_NOT_WANT" field="parameters.returnReasonId"/>
</if-empty>
<if-empty field-name="returnTypeId" map-name="parameters">
<if-empty field="parameters.returnTypeId">
<set value="RTN_REFUND" field="parameters.returnTypeId"/>
</if-empty>
@@ -676,7 +676,7 @@ under the License.
<set from-field="parameters.returnReasonId" field="newItemCtx.returnReasonId"/>
<set from-field="parameters.returnTypeId" field="newItemCtx.returnTypeId"/>
<if-not-empty field-name="orderItem.productId">
<if-not-empty field="orderItem.productId">
<set from-field="orderItem.productId" field="newItemCtx.productId"/>
</if-not-empty>
@@ -694,7 +694,7 @@ under the License.
<!-- get the matching return item type from the order item type -->
<set from-field="orderItem.orderItemTypeId" field="orderItemTypeId"/>
<if-compare field-name="orderItemTypeId" value="PRODUCT_ORDER_ITEM" operator="equals">
<if-compare field="orderItemTypeId" value="PRODUCT_ORDER_ITEM" operator="equals">
<!-- Check if orderItemTypeId equals PRODUCT_ORDER_ITEM, if so, use ProductType and ReturnItemTypeMap to get ReturnItemType-->
<entity-one entity-name="Product" value-name="product">
<field-map field-name="productId" env-name="orderItem.productId"/>
@@ -714,7 +714,7 @@ under the License.
</else>
</if-compare>
<if-empty field-name="returnItemTypeId" map-name="returnItemTypeMapping" >
<if-empty field="returnItemTypeMapping.returnItemTypeId">
<add-error><fail-message message="No matching return item type map found for order item: [${orderItem}]"/></add-error>
<check-errors/>
<else>
@@ -723,11 +723,11 @@ under the License.
</if-empty>
<!-- create the return item -->
<if-not-empty field-name="newItemCtx.orderAdjustmentId">
<if-not-empty field="newItemCtx.orderAdjustmentId">
<log level="info" message="Found unexpected orderAdjustment:${newItemCtx.orderAdjustmentId}"/>
<clear-field field-name="newItemCtx.orderAdjustmentId"/>
</if-not-empty>
<if-compare field-name="newItemCtx.returnQuantity" value="0" operator="greater" type="Double">
<if-compare field="newItemCtx.returnQuantity" value="0" operator="greater" type="Double">
<!-- otherwise, items which have been fully returned would still get passed in and then come back with an error -->
<call-service service-name="createReturnItem" in-map-name="newItemCtx" include-user-login="true"/>
<else>
@@ -751,7 +751,7 @@ under the License.
<entity-count entity-name="ReturnAdjustment" count-name="returnCount">
<condition-expr field-name="orderAdjustmentId" operator="equals" env-name="orderAdjustment.orderAdjustmentId"/>
</entity-count>
<if-compare field-name="returnCount" value="0" operator="equals">
<if-compare field="returnCount" value="0" operator="equals">
<log level="info" message="Create new return adjustment: ${returnAdjCtx}"/>
<call-service service-name="createReturnAdjustment" in-map-name="returnAdjCtx" include-user-login="true"/>
</if-compare>
@@ -766,7 +766,7 @@ under the License.
<log level="info" message="OrderTotal [${orderTotal}] - ReturnTotal [${returnTotal}] = available Return Total [${availableReturnTotal}]"/>
<!-- create a manual balance adjustment based on the difference between order total and return total -->
<if-compare field-name="availableReturnTotal" operator="not-equals" value="0.00" type="BigDecimal">
<if-compare field="availableReturnTotal" operator="not-equals" value="0.00" type="BigDecimal">
<set value="Balance Adjustment" field="balanceItemCtx.description"/>
<set value="RET_MAN_ADJ" field="balanceItemCtx.returnAdjustmentTypeId"/>
@@ -785,7 +785,7 @@ under the License.
<call-service service-name="updateReturnHeader" in-map-name="updateHeaderCtx" include-user-login="true"/>
<!-- auto-receive this return if we passed in the flag -->
<if-compare field-name="receiveReturn" map-name="parameters" operator="equals" value="true" type="Boolean">
<if-compare field="parameters.receiveReturn" operator="equals" value="true" type="Boolean">
<set from-field="returnId" field="receiveCtx.returnId"/>
<call-service service-name="quickReceiveReturn" in-map-name="receiveCtx"/>
<else>
@@ -798,7 +798,7 @@ under the License.
</simple-method>
<simple-method method-name="createReturnAndItemOrAdjustment" short-description="If returnId is null, create a return; then create Return Item or Adjustment based on the parameters passed in">
<if-empty field-name="parameters.returnId">
<if-empty field="parameters.returnId">
<set-service-fields service-name="createReturnHeader" map-name="parameters" to-map-name="returnHeaderInMap"/>
<call-service service-name="createReturnHeader" in-map-name="returnHeaderInMap">
<result-to-field result-name="returnId" field-name="returnId"/>
@@ -845,9 +845,9 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="returnItem.returnTypeId" operator="equals" value="RTN_REPLACE"/>
<if-compare field-name="returnItem.returnTypeId" operator="equals" value="RTN_CSREPLACE"/>
<if-compare field-name="returnItem.returnTypeId" operator="equals" value="RTN_REPAIR_REPLACE"/>
<if-compare field="returnItem.returnTypeId" operator="equals" value="RTN_REPLACE"/>
<if-compare field="returnItem.returnTypeId" operator="equals" value="RTN_CSREPLACE"/>
<if-compare field="returnItem.returnTypeId" operator="equals" value="RTN_REPAIR_REPLACE"/>
</or>
</condition>
<then>
@@ -25,7 +25,7 @@ under the License.
<condition>
<and>
<not><if-has-permission permission="ORDERMGR" action="_VIEW"/></not>
<if-compare-field field-name="parameters.partyId" operator="not-equals" to-field-name="userLogin.partyId"/>
<if-compare-field field="parameters.partyId" to-field="userLogin.partyId" operator="not-equals"/>
</and>
</condition>
<then>
@@ -34,7 +34,7 @@ under the License.
</if>
<check-errors/>
<if-not-empty field-name="monthsToInclude">
<if-not-empty field="monthsToInclude">
<now-timestamp-to-env env-name="nowTimestamp"/>
<call-bsh><![CDATA[
calendar = java.util.Calendar.getInstance();
@@ -45,13 +45,13 @@ under the License.
<set from-field="nowTimestamp" field="parameters.thruDate"/>
</if-not-empty>
<if-empty field-name="parameters.roleTypeId">
<if-empty field="parameters.roleTypeId">
<set value="PLACING_CUSTOMER" field="parameters.roleTypeId"/>
</if-empty>
<if-empty field-name="parameters.orderTypeId">
<if-empty field="parameters.orderTypeId">
<set value="SALES_ORDER" field="parameters.orderTypeId"/>
</if-empty>
<if-empty field-name="parameters.statusId">
<if-empty field="parameters.statusId">
<set value="ORDER_COMPLETED" field="parameters.statusId"/>
</if-empty>
@@ -80,7 +80,7 @@ under the License.
<!-- because we specified the partyId and the roleTypeId, should only be one item in list returned -->
<first-from-list list-name="orderInfoList" entry-name="orderInfo"/>
<if-not-empty field-name="orderInfo">
<if-not-empty field="orderInfo">
<field-to-result field-name="orderInfo.totalGrandAmount" result-name="totalGrandAmount"/>
<field-to-result field-name="orderInfo.totalSubRemainingAmount" result-name="totalSubRemainingAmount"/>
<field-to-result field-name="orderInfo.totalOrders" result-name="totalOrders"/>
@@ -142,7 +142,7 @@ under the License.
<!-- Include the facilityId corresponding to this order by looking up the ProductStore -->
<entity-one entity-name="OrderHeader" value-name="orderHeader" auto-field-map="true"/>
<get-related-one value-name="orderHeader" relation-name="ProductStore" to-value-name="productStore" use-cache="true"/>
<if-not-empty field-name="productStore.inventoryFacilityId">
<if-not-empty field="productStore.inventoryFacilityId">
<set from-field="productStore.inventoryFacilityId" field="inputMap.facilityId"/>
</if-not-empty>
@@ -175,19 +175,19 @@ under the License.
</simple-method>
<simple-method method-name="getProductRequirementMethod" short-description="finds the requirement method for the product">
<if-not-empty field-name="parameters.orderId">
<if-not-empty field="parameters.orderId">
<entity-one entity-name="OrderHeader" auto-field-map="true" value-name="order"/>
</if-not-empty>
<entity-one entity-name="Product" auto-field-map="true" value-name="product"/>
<set from-field="product.requirementMethodEnumId" field="requirementMethodId"/>
<if-empty field-name="requirementMethodId">
<if-empty field="requirementMethodId">
<if>
<condition>
<and>
<if-compare field-name="product.productTypeId" operator="not-equals" value="MARKETING_PKG_AUTO"/>
<if-compare field-name="product.productTypeId" operator="not-equals" value="MARKETING_PKG_PICK"/>
<if-compare field-name="product.productTypeId" operator="not-equals" value="DIGITAL_GOOD"/>
<not><if-empty field-name="order"/></not>
<if-compare field="product.productTypeId" operator="not-equals" value="MARKETING_PKG_AUTO"/>
<if-compare field="product.productTypeId" operator="not-equals" value="MARKETING_PKG_PICK"/>
<if-compare field="product.productTypeId" operator="not-equals" value="DIGITAL_GOOD"/>
<not><if-empty field="order"/></not>
</and>
</condition>
<then>
@@ -206,8 +206,8 @@ under the License.
</check-permission>
<check-errors/>
<call-simple-method method-name="getProductRequirementMethod"/>
<if-compare field-name="order.orderTypeId" operator="equals" value="SALES_ORDER">
<if-compare field-name="requirementMethodId" operator="equals" value="PRODRQM_AUTO">
<if-compare field="order.orderTypeId" operator="equals" value="SALES_ORDER">
<if-compare field="requirementMethodId" operator="equals" value="PRODRQM_AUTO">
<!-- create the requirement -->
<set from-field="parameters.productId" field="inputMap.productId"/>
<set from-field="parameters.quantity" field="inputMap.quantity"/>
@@ -223,7 +223,7 @@ under the License.
<check-errors/>
<!-- If the service is triggered by the updateItemIssuance service, get the ItemIssuance by the passed itemIssuanceId -->
<if-not-empty field-name="parameters.itemIssuanceId">
<if-not-empty field="parameters.itemIssuanceId">
<entity-one entity-name="ItemIssuance" auto-field-map="true" value-name="itemIssuance"/>
<entity-one entity-name="InventoryItem" value-name="inventoryItem">
<field-map env-name="itemIssuance.inventoryItemId" field-name="inventoryItemId"/>
@@ -236,23 +236,23 @@ under the License.
<set from-field="inventoryItem.productId" field="parameters.productId"/>
<call-simple-method method-name="getProductRequirementMethod"/>
<if-compare field-name="requirementMethodId" operator="equals" value="PRODRQM_STOCK">
<if-compare field="requirementMethodId" operator="equals" value="PRODRQM_STOCK">
<!-- get QOH, ATP quantities and find ProductFacility which has the minimum stock -->
<call-simple-method method-name="getProductFacilityAndQuantities"/>
<if-not-empty field-name="productFacility.minimumStock">
<if-not-empty field="productFacility.minimumStock">
<!-- No requirements are created if we are already under stock -->
<if-compare-field field-name="quantityOnHandTotal" to-field-name="productFacility.minimumStock" operator="greater-equals" type="Double">
<if-compare-field field="quantityOnHandTotal" to-field="productFacility.minimumStock" operator="greater-equals" type="Double">
<calculate field-name="newQuantityOnHand">
<calcop field-name="quantityOnHandTotal" operator="subtract">
<calcop operator="get" field-name="parameters.quantity"/>
</calcop>
</calculate>
<!-- If this new issuance will cause the quantityOnHandTotal to go below the minimumStock, create a new requirement -->
<if-compare-field field-name="newQuantityOnHand" to-field-name="productFacility.minimumStock" operator="less" type="Double">
<if-compare-field field="newQuantityOnHand" to-field="productFacility.minimumStock" operator="less" type="Double">
<set from-field="inventoryItem.productId" field="inputMap.productId"/>
<set from-field="productFacility.facilityId" field="inputMap.facilityId"/>
<if-not-empty field-name="productFacility.reorderQuantity">
<if-not-empty field="productFacility.reorderQuantity">
<set from-field="productFacility.reorderQuantity" field="inputMap.quantity"/>
<else>
<set from-field="parameters.quantity" field="inputMap.quantity"/>
@@ -282,24 +282,24 @@ under the License.
<set from-field="inventoryItem.productId" field="parameters.productId"/>
<call-simple-method method-name="getProductRequirementMethod"/>
<if-compare field-name="requirementMethodId" operator="equals" value="PRODRQM_STOCK_ATP">
<if-compare field="requirementMethodId" operator="equals" value="PRODRQM_STOCK_ATP">
<!-- get QOH, ATP quantities and find ProductFacility which has the minimum stock -->
<call-simple-method method-name="getProductFacilityAndQuantities"/>
<if-not-empty field-name="productFacility.minimumStock">
<if-not-empty field="productFacility.minimumStock">
<!-- No requirements are created if we are not under stock -->
<!-- this service is supposed to be called after inventory is reserved, so inventory should have been updated already -->
<if-compare-field field-name="availableToPromiseTotal" to-field-name="productFacility.minimumStock" operator="less" type="Double">
<if-compare-field field="availableToPromiseTotal" to-field="productFacility.minimumStock" operator="less" type="Double">
<calculate field-name="oldAvailableToPromise">
<calcop field-name="availableToPromiseTotal" operator="add">
<calcop operator="get" field-name="parameters.quantity"/>
</calcop>
</calculate>
<!-- If before this reservation the availableToPromiseTotal was over minimumStock, create a new requirement -->
<if-compare-field field-name="oldAvailableToPromise" to-field-name="productFacility.minimumStock" operator="greater-equals" type="Double">
<if-compare-field field="oldAvailableToPromise" to-field="productFacility.minimumStock" operator="greater-equals" type="Double">
<set from-field="inventoryItem.productId" field="inputMap.productId"/>
<set from-field="productFacility.facilityId" field="inputMap.facilityId"/>
<if-not-empty field-name="productFacility.reorderQuantity">
<if-not-empty field="productFacility.reorderQuantity">
<set from-field="productFacility.reorderQuantity" field="inputMap.quantity"/>
<else>
<set from-field="parameters.quantity" field="inputMap.quantity"/>
@@ -329,20 +329,20 @@ under the License.
<set from-field="inventoryItem.productId" field="parameters.productId"/>
<call-simple-method method-name="getProductRequirementMethod"/>
<if-compare field-name="requirementMethodId" operator="equals" value="PRODRQM_ATP">
<if-compare field="requirementMethodId" operator="equals" value="PRODRQM_ATP">
<!-- get the ATP, QOH quantities and the product facility's minimum stock -->
<call-simple-method method-name="getProductFacilityAndQuantities"/>
<if-not-empty field-name="productFacility">
<if-not-empty field="productFacility">
<!-- are we below minimum stock? this service is supposed to be called after inventory is reserved, so inventory should have been updated already -->
<if-compare-field field-name="availableToPromiseTotal" to-field-name="productFacility.minimumStock" operator="less" type="Double">
<if-compare-field field="availableToPromiseTotal" to-field="productFacility.minimumStock" operator="less" type="Double">
<!-- what is the right quantity? It is the lesser of the actual quantity and the quantity required to bring us back up to minimum stock -->
<calculate field-name="quantityShortfall">
<calcop field-name="productFacility.minimumStock" operator="subtract">
<calcop operator="get" field-name="availableToPromiseTotal"/>
</calcop>
</calculate>
<if-compare-field field-name="quantityShortfall" operator="less" type="Double" to-field-name="parameters.quantity">
<if-compare-field field="quantityShortfall" operator="less" to-field="parameters.quantity" type="Double">
<set from-field="quantityShortfall" field="inputMap.quantity"/>
<else>
<set from-field="parameters.quantity" field="inputMap.quantity"/>
@@ -381,7 +381,7 @@ under the License.
</calculate>
<!-- If a new requirement needs to be created, create it for the difference between the required quantity and the total quantity of existing requirements -->
<if-compare field-name="newRequirementTotal" operator="greater-equals" value="0">
<if-compare field="newRequirementTotal" operator="greater-equals" value="0">
<set from-field="inputMap.quantity" field="newRequirementTotal"/>
<call-simple-method method-name="createRequirementAndCommitment"/>
</if-compare>
@@ -405,21 +405,21 @@ under the License.
<set from-field="productFacility.productId" field="parameters.productId"/>
<clear-field field-name="requirementMethodId"/>
<call-simple-method method-name="getProductRequirementMethod"/>
<if-empty field-name="requirementMethodId">
<if-empty field="requirementMethodId">
<set field="requirementMethodId" from-field="parameters.defaultRequirementMethodId"/>
</if-empty>
<if>
<condition>
<or>
<if-compare field-name="requirementMethodId" operator="equals" value="PRODRQM_STOCK"/>
<if-compare field-name="requirementMethodId" operator="equals" value="PRODRQM_STOCK_ATP"/>
<if-compare field="requirementMethodId" operator="equals" value="PRODRQM_STOCK"/>
<if-compare field="requirementMethodId" operator="equals" value="PRODRQM_STOCK_ATP"/>
</or>
</condition>
<then>
<!-- get QOH, ATP and find ProductFacility which has the minimum stock -->
<if-not-empty field-name="productFacility.minimumStock">
<if-not-empty field="productFacility.minimumStock">
<!-- Get the product's total quantityOnHand in the facility -->
<clear-field field-name="inputMap"/>
<set from-field="productFacility.productId" field="inputMap.productId"/>
@@ -429,7 +429,7 @@ under the License.
<result-to-field field-name="availableToPromiseTotal" result-name="availableToPromiseTotal"/>
</call-service>
<if-compare field-name="requirementMethodId" operator="equals" value="PRODRQM_STOCK">
<if-compare field="requirementMethodId" operator="equals" value="PRODRQM_STOCK">
<set from-field="quantityOnHandTotal" field="currentQuantity"/>
<else>
<set from-field="availableToPromiseTotal" field="currentQuantity"/>
@@ -437,10 +437,10 @@ under the License.
</if-compare>
<!-- No requirements are created if we are already under stock -->
<if-compare-field field-name="currentQuantity" to-field-name="productFacility.minimumStock" operator="less" type="Double">
<if-compare-field field="currentQuantity" to-field="productFacility.minimumStock" operator="less" type="Double">
<clear-field field-name="inputMap"/>
<set from-field="productFacility.productId" field="inputMap.productId"/>
<if-not-empty field-name="productFacility.reorderQuantity">
<if-not-empty field="productFacility.reorderQuantity">
<set from-field="productFacility.reorderQuantity" field="inputMap.quantity" type="Double"/>
<else>
<set value="0" field="inputMap.quantity" type="Double"/>
@@ -452,7 +452,7 @@ under the License.
<calcop operator="get" field-name="currentQuantity"/>
</calcop>
</calculate>
<if-compare-field field-name="inputMap.quantity" to-field-name="quantityShortfall" operator="less" type="Double">
<if-compare-field field="inputMap.quantity" to-field="quantityShortfall" operator="less" type="Double">
<set from-field="quantityShortfall" field="inputMap.quantity" type="Double"/>
</if-compare-field>
@@ -476,12 +476,12 @@ under the License.
<if>
<condition>
<if-compare field-name="partyAcctgPreference.orderSequenceEnumId" operator="equals" value="ODRSQ_ENF_SEQ"/>
<if-compare field="partyAcctgPreference.orderSequenceEnumId" operator="equals" value="ODRSQ_ENF_SEQ"/>
</condition>
<then>
<!-- <log level="info" message="In getNextOrderId sequence enum ODRSQ_ENF_SEQ"/> -->
<!-- this is sequential sequencing, we can't skip a number, also it must be a unique sequence per partyIdFrom -->
<if-not-empty field-name="partyAcctgPreference.lastOrderNumber">
<if-not-empty field="partyAcctgPreference.lastOrderNumber">
<calculate field-name="partyAcctgPreference.lastOrderNumber" type="Long">
<calcop operator="add" field-name="partyAcctgPreference.lastOrderNumber"/>
<number value="1"/>
@@ -497,7 +497,7 @@ under the License.
<!-- <log level="info" message="In getNextOrderId sequence enum ODRSQ_STANDARD"/> -->
<!-- default to the default sequencing: ODRSQ_STANDARD -->
<set from-field="parameters.orderId" field="orderIdTemp"/>
<if-empty field-name="orderIdTemp">
<if-empty field="orderIdTemp">
<sequenced-id-to-env sequence-name="OrderHeader" env-name="orderIdTemp"/>
<else>
<!-- check the provided ID -->
@@ -508,7 +508,7 @@ under the License.
</else>
</if>
<if-not-empty field-name="parameters.productStoreId">
<if-not-empty field="parameters.productStoreId">
<entity-one entity-name="ProductStore" value-name="productStore"/>
</if-not-empty>
@@ -525,7 +525,7 @@ under the License.
<check-errors/>
<make-value value-name="newEntity" entity-name="OrderHeader"/>
<if-not-empty field-name="parameters.orderId">
<if-not-empty field="parameters.orderId">
<set field="newEntity.orderId" from-field="parameters.orderId"/>
<else>
<sequenced-id-to-env sequence-name="OrderHeader" env-name="newEntity.orderId"/>
@@ -544,7 +544,7 @@ under the License.
<check-errors/>
<entity-one entity-name="OrderHeader" value-name="orderHeader"/>
<if-empty field-name="orderHeader">
<if-empty field="orderHeader">
<add-error><fail-message message="ERROR: Cannot update specified contact info because it does not correspond to the specified work effort"/></add-error>
</if-empty>
<check-errors/>
@@ -564,8 +564,8 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="orderItem.isPromo" value="Y" operator="equals"/>
<if-compare field-name="orderItem.statusId" value="ITEM_CANCELLED" operator="not-equals"/>
<if-compare field="orderItem.isPromo" value="Y" operator="equals"/>
<if-compare field="orderItem.statusId" value="ITEM_CANCELLED" operator="not-equals"/>
</and>
</condition>
<then>
@@ -584,7 +584,7 @@ under the License.
<iterate list-name="orderAdjustments" entry-name="orderAdjustment">
<if>
<condition>
<not><if-empty field-name="orderAdjustment.productPromoId"/></not>
<not><if-empty field="orderAdjustment.productPromoId"/></not>
</condition>
<then>
<calculate field-name="existingOrderAdjustmentTotal" decimal-scale="3">
@@ -607,7 +607,7 @@ under the License.
<call-object-method obj-field-name="cart" method-name="items" ret-field-name="items"/>
<iterate list-name="items" entry-name="item">
<call-object-method obj-field-name="item" method-name="getOrderItemSeqId" ret-field-name="orderItemSeqId"/>
<if-empty field-name="orderItemSeqId">
<if-empty field="orderItemSeqId">
<!-- this is a new (promo) item -->
<!-- a new order item is created -->
<make-value value-name="newOrderItem" entity-name="OrderItem"/>
@@ -622,7 +622,7 @@ under the License.
<call-object-method obj-field-name="item" method-name="getQuantity" ret-field-name="newOrderItem.quantity"/>
<set field="newOrderItem.isModifiedPrice" value="N"/>
<set field="newOrderItem.isPromo" value="Y"/>
<if-empty field-name="newOrderItem.statusId">
<if-empty field="newOrderItem.statusId">
<set field="newOrderItem.statusId" value="ITEM_CREATED"/>
</if-empty>
<make-next-seq-id value-name="newOrderItem" seq-field-name="orderItemSeqId"/>
@@ -640,7 +640,7 @@ under the License.
<iterate list-name="adjustments" entry-name="adjustment">
<if>
<condition>
<not><if-empty field-name="orderAdjustment.productPromoId"/></not>
<not><if-empty field="orderAdjustment.productPromoId"/></not>
</condition>
<then>
<calculate field-name="newOrderAdjustmentTotal" decimal-scale="3">
@@ -661,7 +661,7 @@ under the License.
</calculate>
<!-- If the total has changed, create an OrderAdjustment to reflect the fact -->
<if-compare field-name="orderAdjustmentTotalDifference" value="0" operator="not-equals" type="BigDecimal">
<if-compare field="orderAdjustmentTotalDifference" value="0" operator="not-equals" type="BigDecimal">
<set field="createOrderAdjContext.orderAdjustmentTypeId" value="PROMOTION_ADJUSTMENT"/>
<set field="createOrderAdjContext.orderId" from-field="parameters.orderId"/>
<set field="createOrderAdjContext.orderItemSeqId" value="_NA_"/>
@@ -685,12 +685,12 @@ under the License.
<set from-field="parameters.orderId" field="inputMap.orderId"/>
<set from-field="parameters.contactMechPurposeTypeId" field="inputMap.contactMechPurposeTypeId"/>
<set from-field="parameters.contactMechId" field="inputMap.contactMechId"/>
<if-compare value="SHIPPING_LOCATION" field-name="parameters.contactMechPurposeTypeId" operator="equals">
<if-compare value="parameters.oldContactMechId" field-name="parameters.contactMechId" operator="not-equals">
<if-compare value="SHIPPING_LOCATION" field="parameters.contactMechPurposeTypeId" operator="equals">
<if-compare value="parameters.oldContactMechId" field="parameters.contactMechId" operator="not-equals">
<set field="orderItemShipGroupMap.orderId" from-field="parameters.orderId"/>
<set field="orderItemShipGroupMap.contactMechId" from-field="parameters.oldContactMechId"/>
<find-by-and entity-name="OrderItemShipGroup" list-name="shipGroupList" map-name="orderItemShipGroupMap"/>
<if-not-empty field-name="shipGroupList">
<if-not-empty field="shipGroupList">
<iterate list-name="shipGroupList" entry-name="shipGroup">
<set field="inputMap.shipGroupSeqId" from-field="shipGroup.shipGroupSeqId"/>
<set field="inputMap.shipmentMethod" value="${shipGroup.shipmentMethodTypeId}@${shipGroup.carrierPartyId}"/>
@@ -703,7 +703,7 @@ under the License.
<else>
<find-by-and entity-name="OrderContactMech" map-name="inputMap" list-name="orderContactMechList"/>
<!-- If orderContactMechList value is null then create new entry in OrderContactMech entity-->
<if-empty field-name="orderContactMechList">
<if-empty field="orderContactMechList">
<set-service-fields service-name="createOrderContactMech" map-name="parameters" to-map-name="createOrderContactMechMap"/>
<call-service service-name="createOrderContactMech" in-map-name="createOrderContactMechMap" include-user-login="true"/>
<set from-field="parameters.orderId" field="orderContactMechLookupMap.orderId"/>
@@ -743,7 +743,7 @@ under the License.
<set from-field="parameters.contactMechId" field="inputMap.contactMechId"/>
<find-by-and entity-name="OrderContactMech" map-name="inputMap" list-name="orderContactMechList"/>
<!-- If orderContactMechList value is null then create new entry in OrderContactMech entity-->
<if-empty field-name="orderContactMechList">
<if-empty field="orderContactMechList">
<set-service-fields service-name="createOrderContactMech" map-name="parameters" to-map-name="createOrderContactMechMap"/>
<call-service service-name="createOrderContactMech" in-map-name="createOrderContactMechMap" include-user-login="true"/>
</if-empty>
@@ -752,7 +752,7 @@ under the License.
<set from-field="parameters.orderId" field="shipGroupLookupMap.orderId"/>
<set from-field="parameters.oldContactMechId" field="shipGroupLookupMap.contactMechId"/>
<find-by-and entity-name="OrderItemShipGroup" map-name="shipGroupLookupMap" list-name="orderItemShipGroupList"/>
<if-empty field-name="orderItemShipGroupList">
<if-empty field="orderItemShipGroupList">
<set from-field="parameters.orderId" field="inputMap.orderId"/>
<set from-field="parameters.contactMechPurposeTypeId" field="inputMap.contactMechPurposeTypeId"/>
<set from-field="parameters.oldContactMechId" field="inputMap.contactMechId"/>
@@ -764,7 +764,7 @@ under the License.
<simple-method method-name="getOrderItemShipGroupEstimatedShipDate" short-description="Compute and return the OrderItemShipGroup estimated ship date based on the associated items.">
<entity-one entity-name="OrderItemShipGroup" value-name="orderItemShipGroup"/>
<if-compare field-name="orderItemShipGroup.maySplit" operator="equals" value="Y">
<if-compare field="orderItemShipGroup.maySplit" operator="equals" value="Y">
<set field="orderByList[]" value="+promisedDatetime"/>
<else>
<set field="orderByList[]" value="-promisedDatetime"/>
@@ -858,7 +858,7 @@ under the License.
<simple-method method-name="getOrderStatus" short-description="Gets an order status" login-required="false">
<entity-one entity-name="OrderHeader" value-name="order"/>
<if-empty field-name="order">
<if-empty field="order">
<add-error><fail-message message="Order not found [{parameters.orderId}]"/></add-error>
<check-errors/>
</if-empty>
@@ -874,7 +874,7 @@ under the License.
<condition-expr field-name="quantityNotAvailable" operator="greater" env-name="zeroEnv"/>
</condition-list>
</entity-condition>
<if-empty field-name="orderItemShipGrpInvResList">
<if-empty field="orderItemShipGrpInvResList">
<set field="isBackOrder" value="false" type="Boolean"/>
<else>
<set field="isBackOrder" value="true" type="Boolean"/>
@@ -886,11 +886,11 @@ under the License.
<simple-method method-name="createOrderItemChange" short-description="Creates a new Order Item Change record">
<make-value value-name="newEntity" entity-name="OrderItemChange"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="parameters.changeDatetime">
<if-empty field="parameters.changeDatetime">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.changeDatetime" from-field="nowTimestamp"/>
</if-empty>
<if-empty field-name="parameters.changeUserLogin">
<if-empty field="parameters.changeUserLogin">
<set field="newEntity.changeUserLogin" from-field="userLogin.userLoginId"/>
</if-empty>
<sequenced-id-to-env sequence-name="OrderItemChange" env-name="newEntity.orderItemChangeId"/>
@@ -85,7 +85,7 @@ under the License.
<field-map field-name="orderId" env-name="parameters.orderId"/>
</entity-and>
<iterate list-name="shipmentReceipts" entry-name="receipt">
<if-empty field-name="totalsMap.${receipt.orderItemSeqId}">
<if-empty field="totalsMap.${receipt.orderItemSeqId}">
<set field="totalsMap.${receipt.orderItemSeqId}" value="0" type="Double"/>
</if-empty>
<calculate field-name="${receipt.orderItemSeqId}" map-name="totalsMap" type="Double">
@@ -97,8 +97,8 @@ under the License.
<set from-field="receipt.orderId" field="newLookupMap.orderId"/>
<set from-field="receipt.orderItemSeqId" field="newLookupMap.orderItemSeqId"/>
<find-by-primary-key entity-name="OrderItem" map-name="newLookupMap" value-name="orderItem"/>
<if-compare field-name="statusId" map-name="orderItem" operator="not-equals" value="ITEM_COMPLETED">
<if-compare-field field-name="quantity" map-name="orderItem" operator="less-equals" to-field-name="${receipt.orderItemSeqId}" to-map-name="totalsMap" type="Double">
<if-compare field="orderItem.statusId" operator="not-equals" value="ITEM_COMPLETED">
<if-compare-field field="orderItem.quantity" to-field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals" type="Double">
<!-- update the status for the item -->
<set field="orderItem.statusId" value="ITEM_COMPLETED"/>
<store-value value-name="orderItem"/>
@@ -122,12 +122,12 @@ under the License.
</entity-and>
<set value="true" field="allCompleted"/>
<iterate list-name="allOrderItems" entry-name="item">
<if-compare field-name="item.statusId" operator="not-equals" value="ITEM_COMPLETED">
<if-compare field="item.statusId" operator="not-equals" value="ITEM_COMPLETED">
<set value="false" field="allCompleted"/>
</if-compare>
</iterate>
<if-compare field-name="allCompleted" operator="equals" value="true">
<if-compare field="allCompleted" operator="equals" value="true">
<!-- update the order header -->
<set field="orderHeader.statusId" value="ORDER_COMPLETED"/>
<store-value value-name="orderHeader"/>
@@ -32,12 +32,12 @@ under the License.
<if>
<condition>
<if-compare field-name="partyAcctgPreference.quoteSequenceEnumId" operator="equals" value="QTESQ_ENF_SEQ"/>
<if-compare field="partyAcctgPreference.quoteSequenceEnumId" operator="equals" value="QTESQ_ENF_SEQ"/>
</condition>
<then>
<!-- <log level="info" message="In getNextQuoteId sequence enum QTESQ_ENF_SEQ"/> -->
<!-- this is sequential sequencing, we can't skip a number, also it must be a unique sequence per partyIdFrom -->
<if-not-empty field-name="partyAcctgPreference.lastQuoteNumber">
<if-not-empty field="partyAcctgPreference.lastQuoteNumber">
<calculate field-name="partyAcctgPreference.lastQuoteNumber" type="Long">
<calcop operator="add" field-name="partyAcctgPreference.lastQuoteNumber"/>
<number value="1"/>
@@ -53,7 +53,7 @@ under the License.
<!-- <log level="info" message="In getNextQuoteId sequence enum QTESQ_STANDARD"/> -->
<!-- default to the default sequencing: QTESQ_STANDARD -->
<set from-field="parameters.quoteId" field="quoteIdTemp"/>
<if-empty field-name="quoteIdTemp">
<if-empty field="quoteIdTemp">
<sequenced-id-to-env sequence-name="Quote" env-name="quoteIdTemp"/>
<else>
<!-- check the provided ID -->
@@ -74,8 +74,8 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="parameters.partyId"/></not>
<not><if-compare-field field-name="parameters.partyId" operator="equals" to-field-name="userLogin.partyId"/></not>
<not><if-empty field="parameters.partyId"/></not>
<not><if-compare-field field="parameters.partyId" to-field="userLogin.partyId" operator="equals"/></not>
<not><if-has-permission permission="ORDERMGR" action="_CREATE"/></not>
</and>
</condition>
@@ -87,13 +87,13 @@ under the License.
<!-- create new entity and create all the fields -->
<make-value value-name="newEntity" entity-name="Quote"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.statusId">
<if-empty field="newEntity.statusId">
<set value="QUO_CREATED" field="newEntity.statusId"/>
</if-empty>
<!-- create a non existing ID; if we have a productStoreId do it for the payToPartyId of that ProductStore according to PartyAcctgPreferences, otherwise get from standard sequence -->
<entity-one entity-name="ProductStore" value-name="productStore"/>
<if-not-empty field-name="productStore.payToPartyId">
<if-not-empty field="productStore.payToPartyId">
<set field="getNextQuoteIdContext.partyId" from-field="productStore.payToPartyId"/>
<call-service service-name="getNextQuoteId" in-map-name="getNextQuoteIdContext">
<result-to-field result-name="quoteId" field-name="newEntity.quoteId"/>
@@ -111,7 +111,7 @@ under the License.
then we associate it to the quote as the request taker.
This is not done if they are the same e.g. a logged in customer that is creating a quote for its
own sake. -->
<if-compare-field field-name="parameters.partyId" operator="not-equals" to-field-name="userLogin.partyId">
<if-compare-field field="parameters.partyId" to-field="userLogin.partyId" operator="not-equals">
<set from-field="newEntity.quoteId" field="takerMap.quoteId"/>
<set from-field="userLogin.partyId" field="takerMap.partyId"/>
<set value="REQ_TAKER" field="takerMap.roleTypeId"/>
@@ -129,17 +129,17 @@ under the License.
<check-errors/>
<entity-one entity-name="Quote" value-name="quote" auto-field-map="true"/>
<check-errors/>
<if-empty field-name="parameters.statusId">
<if-empty field="parameters.statusId">
<set field="parameters.statusId" from-field="quote.statusId"/>
</if-empty>
<if-compare-field field-name="quote.statusId" operator="not-equals" to-field-name="parameters.statusId">
<if-compare-field field="quote.statusId" to-field="parameters.statusId" operator="not-equals">
<!-- check if the status change is a valid change -->
<entity-and entity-name="StatusValidChange" list-name="validChange">
<field-map field-name="statusId" env-name="quote.statusId"/>
<field-map field-name="statusIdTo" env-name="parameters.statusId"/>
</entity-and>
<if-empty field-name="validChange">
<if-empty field="validChange">
<add-error><fail-message message="The status change from ${quote.statusId} to ${parameters.statusId} is not a valid change"/></add-error>
<log level="error" message="The status change from ${quote.statusId} to ${parameters.statusId} is not a valid change"/>
<check-errors/>
@@ -163,7 +163,7 @@ under the License.
<call-service service-name="createQuote" in-map-name="createQuoteInMap">
<result-to-field result-name="quoteId" field-name="quoteIdTo"/>
</call-service>
<if-compare field-name="parameters.copyQuoteItems" value="Y" operator="equals">
<if-compare field="parameters.copyQuoteItems" value="Y" operator="equals">
<get-related value-name="quote" relation-name="QuoteItem" list-name="quoteItems"/>
<iterate list-name="quoteItems" entry-name="quoteItem">
<clear-field field-name="createQuoteItemInMap"/>
@@ -174,10 +174,10 @@ under the License.
</iterate>
</if-compare>
<if-compare field-name="parameters.copyQuoteAdjustments" value="Y" operator="equals">
<if-compare field="parameters.copyQuoteAdjustments" value="Y" operator="equals">
<get-related value-name="quote" relation-name="QuoteAdjustment" list-name="quoteAdjustments"/>
<iterate list-name="quoteAdjustments" entry-name="quoteAdjustment">
<if-empty field-name="quoteAdjustment.quoteItemSeqId">
<if-empty field="quoteAdjustment.quoteItemSeqId">
<clear-field field-name="createQuoteAdjustmentInMap"/>
<set-service-fields service-name="createQuoteAdjustment" to-map-name="createQuoteAdjustmentInMap" map-name="quoteAdjustment"/>
<set from-field="quoteIdTo" field="createQuoteAdjustmentInMap.quoteId"/>
@@ -186,10 +186,10 @@ under the License.
</iterate>
</if-compare>
<if-compare field-name="parameters.copyQuoteRoles" value="Y" operator="equals">
<if-compare field="parameters.copyQuoteRoles" value="Y" operator="equals">
<get-related value-name="quote" relation-name="QuoteRole" list-name="quoteRoles"/>
<iterate list-name="quoteRoles" entry-name="quoteRole">
<if-compare field-name="quoteRole.roleTypeId" value="REQ_TAKER" operator="not-equals">
<if-compare field="quoteRole.roleTypeId" value="REQ_TAKER" operator="not-equals">
<clear-field field-name="createQuoteRoleInMap"/>
<set-service-fields service-name="createQuoteRole" to-map-name="createQuoteRoleInMap" map-name="quoteRole"/>
<set from-field="quoteIdTo" field="createQuoteRoleInMap.quoteId"/>
@@ -198,7 +198,7 @@ under the License.
</iterate>
</if-compare>
<if-compare field-name="parameters.copyQuoteAttributes" value="Y" operator="equals">
<if-compare field="parameters.copyQuoteAttributes" value="Y" operator="equals">
<get-related value-name="quote" relation-name="QuoteAttribute" list-name="quoteAttributes"/>
<iterate list-name="quoteAttributes" entry-name="quoteAttribute">
<clear-field field-name="createQuoteAttributeInMap"/>
@@ -208,7 +208,7 @@ under the License.
</iterate>
</if-compare>
<if-compare field-name="parameters.copyQuoteCoefficients" value="Y" operator="equals">
<if-compare field="parameters.copyQuoteCoefficients" value="Y" operator="equals">
<get-related value-name="quote" relation-name="QuoteCoefficient" list-name="quoteCoefficients"/>
<iterate list-name="quoteCoefficients" entry-name="quoteCoefficient">
<clear-field field-name="createQuoteCoefficientInMap"/>
@@ -241,7 +241,7 @@ under the License.
<set from-field="parameters.partyId" field="lookupPKMap.partyId"/>
<set from-field="parameters.roleTypeId" field="lookupPKMap.roleTypeId"/>
<find-by-primary-key entity-name="PartyRole" map-name="lookupPKMap" value-name="partyRole"/>
<if-empty map-name="partyRole" field-name="partyId">
<if-empty field="partyRole.partyId">
<make-value value-name="partyRole" entity-name="PartyRole"/>
<set-pk-fields map-name="lookupPKMap" value-name="partyRole"/>
<create-value value-name="partyRole"/>
@@ -271,8 +271,8 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="quote.partyId"/></not>
<not><if-compare-field field-name="quote.partyId" operator="equals" to-field-name="userLogin.partyId"/></not>
<not><if-empty field="quote.partyId"/></not>
<not><if-compare-field field="quote.partyId" to-field="userLogin.partyId" operator="equals"/></not>
<not><if-has-permission permission="ORDERMGR" action="_CREATE"/></not>
</and>
</condition>
@@ -288,7 +288,7 @@ under the License.
<set from-field="parameters.quoteId" field="newEntity.quoteId"/>
<set from-field="parameters.quoteItemSeqId" field="newEntity.quoteItemSeqId"/>
<if-empty field-name="newEntity.quoteItemSeqId">
<if-empty field="newEntity.quoteItemSeqId">
<!-- create a non existing ID -->
<make-next-seq-id value-name="newEntity" seq-field-name="quoteItemSeqId"/>
<set from-field="quoteItemSeqId" field="newEntity.quoteItemSeqId"/>
@@ -297,12 +297,12 @@ under the License.
<field-to-result field-name="newEntity.quoteItemSeqId" result-name="quoteItemSeqId"/>
<!-- if there is no price and a productItem is supplied fill the price from the product record -->
<if-empty field-name="parameters.quoteUnitPrice">
<if-not-empty field-name="parameters.productId">
<if-empty field="parameters.quoteUnitPrice">
<if-not-empty field="parameters.productId">
<entity-one entity-name="Product" value-name="product"/>
<set from-field="product" field="calculateProductPriceMap.product"/>
<set from-field="parameters.quantity" field="calculateProductPriceMap.quantity"/>
<if-not-empty field-name="parameters.selectedAmount">
<if-not-empty field="parameters.selectedAmount">
<set from-field="parameters.selectedAmount" field="calculateProductPriceMap.amount"/>
</if-not-empty>
<call-service service-name="calculateProductPrice" in-map-name="calculateProductPriceMap">
@@ -353,8 +353,8 @@ under the License.
<set-service-fields service-name="createQuoteItem" to-map-name="createQuoteItemInMap" map-name="quoteItem"/>
<set from-field="parameters.quoteIdTo" field="createQuoteItemInMap.quoteId"/>
<set from-field="parameters.quoteItemSeqId" field="createQuoteItemInMap.quoteItemSeqId"/>
<if-empty field-name="parameters.quoteIdTo">
<if-empty field-name="parameters.quoteItemSeqIdTo">
<if-empty field="parameters.quoteIdTo">
<if-empty field="parameters.quoteItemSeqIdTo">
<clear-field field-name="createQuoteItemInMap.quoteItemSeqId"/>
</if-empty>
</if-empty>
@@ -366,7 +366,7 @@ under the License.
<check-errors/>
<if-compare field-name="parameters.copyQuoteAdjustments" value="Y" operator="equals">
<if-compare field="parameters.copyQuoteAdjustments" value="Y" operator="equals">
<get-related value-name="quoteItem" relation-name="QuoteAdjustment" list-name="quoteAdjustments"/>
<iterate list-name="quoteAdjustments" entry-name="quoteAdjustment">
<clear-field field-name="createQuoteAdjustmentInMap"/>
@@ -467,7 +467,7 @@ under the License.
<entity-one entity-name="CustRequest" value-name="custRequest" auto-field-map="true"/>
<entity-one entity-name="CustRequestItem" value-name="custRequestItem" auto-field-map="true"/>
<if-empty field-name="custRequest">
<if-empty field="custRequest">
<add-error>
<fail-property resource="OrderErrorUiLabels" property="OrderErrorCustRequestWithIdDoesntExist"/>
</add-error>
@@ -478,7 +478,7 @@ under the License.
<make-value value-name="newQuoteItem" entity-name="QuoteItem"/>
<set-nonpk-fields map-name="parameters" value-name="newQuote"/>
<set-nonpk-fields map-name="parameters" value-name="newQuoteItem"/>
<if-empty field-name="newQuote.statusId">
<if-empty field="newQuote.statusId">
<set value="QUO_CREATED" field="newQuote.statusId"/>
</if-empty>
<set value="PROPOSAL" field="newQuote.quoteTypeId"/>
@@ -520,11 +520,11 @@ under the License.
<check-errors/>
<entity-one entity-name="QuoteItem" value-name="quoteItem" auto-field-map="true"/>
<check-errors/>
<if-not-empty field-name="parameters.manualQuoteUnitPrice">
<if-not-empty field="parameters.manualQuoteUnitPrice">
<set from-field="parameters.manualQuoteUnitPrice" field="quoteItem.quoteUnitPrice"/>
</if-not-empty>
<if-empty field-name="parameters.manualQuoteUnitPrice">
<if-not-empty field-name="parameters.defaultQuoteUnitPrice">
<if-empty field="parameters.manualQuoteUnitPrice">
<if-not-empty field="parameters.defaultQuoteUnitPrice">
<set from-field="parameters.defaultQuoteUnitPrice" field="quoteItem.quoteUnitPrice"/>
</if-not-empty>
<!--
@@ -549,7 +549,7 @@ under the License.
<!-- all existing promo quote items are removed -->
<get-related value-name="quote" relation-name="QuoteItem" list-name="quoteItems"/>
<iterate list-name="quoteItems" entry-name="quoteItem">
<if-compare field-name="quoteItem.isPromo" value="Y" operator="equals">
<if-compare field="quoteItem.isPromo" value="Y" operator="equals">
<clear-field field-name="removeQuoteItemInMap"/>
<set-service-fields service-name="removeQuoteItem" to-map-name="removeQuoteItemInMap" map-name="parameters"/>
<set from-field="quoteItem.quoteItemSeqId" field="removeQuoteItemInMap.quoteItemSeqId"/>
@@ -560,7 +560,7 @@ under the License.
<get-related value-name="quote" relation-name="QuoteAdjustment" list-name="quoteAdjustments"/>
<iterate list-name="quoteAdjustments" entry-name="quoteAdjustment">
<!-- make sure this is not a manual adjustments -->
<if-not-empty field-name="quoteAdjustment.productPromoId">
<if-not-empty field="quoteAdjustment.productPromoId">
<clear-field field-name="removeQuoteAdjustmentInMap"/>
<set-service-fields service-name="removeQuoteAdjustment" to-map-name="removeQuoteAdjustmentInMap" map-name="parameters"/>
<set from-field="quoteAdjustment.quoteAdjustmentId" field="removeQuoteAdjustmentInMap.quoteAdjustmentId"/>
@@ -576,7 +576,7 @@ under the License.
<call-object-method obj-field-name="cart" method-name="items" ret-field-name="items"/>
<iterate list-name="items" entry-name="item">
<call-object-method obj-field-name="item" method-name="getOrderItemSeqId" ret-field-name="orderItemSeqId"/>
<if-empty field-name="orderItemSeqId">
<if-empty field="orderItemSeqId">
<!-- this is a new (promo) item -->
<!-- a new quote item is created -->
<clear-field field-name="createQuoteItemInMap"/>
@@ -600,8 +600,8 @@ under the License.
<if>
<condition>
<or>
<if-empty field-name="quoteItem.quoteUnitPrice"/>
<if-compare field-name="quoteItem.quoteUnitPrice" value="0" operator="equals" type="Double"/>
<if-empty field="quoteItem.quoteUnitPrice"/>
<if-compare field="quoteItem.quoteUnitPrice" value="0" operator="equals" type="Double"/>
</or>
</condition>
<then>
@@ -669,8 +669,8 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="createQuoteInMap.partyId"/></not>
<not><if-compare-field field-name="createQuoteInMap.partyId" operator="equals" to-field-name="userLogin.partyId"/></not>
<not><if-empty field="createQuoteInMap.partyId"/></not>
<not><if-compare-field field="createQuoteInMap.partyId" to-field="userLogin.partyId" operator="equals"/></not>
<not><if-has-permission permission="ORDERMGR" action="_CREATE"/></not>
</and>
</condition>
@@ -696,19 +696,19 @@ under the License.
<!-- a new quote item is created -->
<clear-field field-name="createQuoteItemInMap"/>
<call-object-method obj-field-name="item" method-name="getIsPromo" ret-field-name="isPromo"/>
<if-compare field-name="isPromo" value="true" operator="equals" type="Boolean">
<if-compare field="isPromo" value="true" operator="equals" type="Boolean">
<set value="Y" field="createQuoteItemInMap.isPromo"/>
</if-compare>
<call-object-method obj-field-name="item" method-name="getConfigWrapper" ret-field-name="configWrapper"/>
<if-not-empty field-name="configWrapper">
<if-not-empty field="configWrapper">
<call-object-method obj-field-name="configWrapper" method-name="getConfigId" ret-field-name="configId"/>
<set from-field="configId" field="createQuoteItemInMap.configId"/>
</if-not-empty>
<if>
<condition>
<or>
<if-compare field-name="parameters.applyStorePromotions" value="N" operator="not-equals" type="String"/>
<if-compare field-name="createQuoteItemInMap.isPromo" value="Y" operator="not-equals" type="String"/>
<if-compare field="parameters.applyStorePromotions" value="N" operator="not-equals" type="String"/>
<if-compare field="createQuoteItemInMap.isPromo" value="Y" operator="not-equals" type="String"/>
</or>
</condition>
<then>
@@ -735,7 +735,7 @@ under the License.
<if>
<condition>
<if-compare field-name="parameters.applyStorePromotions" value="N" operator="not-equals" type="String"/>
<if-compare field="parameters.applyStorePromotions" value="N" operator="not-equals" type="String"/>
</condition>
<then>
<call-object-method obj-field-name="parameters.cart" method-name="makeAllQuoteAdjustments" ret-field-name="adjustments"/>
@@ -773,8 +773,8 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="custRequest.custRequestTypeId" operator="not-equals" value="RF_QUOTE"/>
<if-compare field-name="custRequest.custRequestTypeId" operator="not-equals" value="RF_PUR_QUOTE"/>
<if-compare field="custRequest.custRequestTypeId" operator="not-equals" value="RF_QUOTE"/>
<if-compare field="custRequest.custRequestTypeId" operator="not-equals" value="RF_PUR_QUOTE"/>
</and>
</condition>
<then>
@@ -792,8 +792,8 @@ under the License.
<set field="createQuoteInMap.statusId" value="QUO_CREATED"/>
<set field="createQuoteInMap.quoteTypeId" from-field="parameters.quoteTypeId"/>
<!-- set the quoteType (product or purchase) -->
<if-empty field-name="createQuoteInMap.quoteTypeId">
<if-compare field-name="custRequest.custRequestTypeId" operator="equals" value="RF_QUOTE">
<if-empty field="createQuoteInMap.quoteTypeId">
<if-compare field="custRequest.custRequestTypeId" operator="equals" value="RF_QUOTE">
<set field="createQuoteInMap.quoteTypeId" value="PRODUCT_QUOTE"/>
<else>
<set field="createQuoteInMap.quoteTypeId" value="PURCHASE_QUOTE"/>
@@ -826,7 +826,7 @@ under the License.
<iterate list-name="custRequestRoles" entry-name="custRequestRole">
<clear-field field-name="createQuoteRoleInMap"/>
<!-- The REQ_TAKER role is automatically added by the createQuote service -->
<if-compare field-name="custRequestRole.roleTypeId" value="REQ_TAKER" operator="not-equals">
<if-compare field="custRequestRole.roleTypeId" value="REQ_TAKER" operator="not-equals">
<set field="createQuoteRoleInMap.quoteId" from-field="quoteId"/>
<set field="createQuoteRoleInMap.partyId" from-field="custRequestRole.partyId"/>
<set field="createQuoteRoleInMap.roleTypeId" from-field="custRequestRole.roleTypeId"/>
@@ -842,11 +842,11 @@ under the License.
<make-value entity-name="QuoteWorkEffort" value-name="lookupMap"/>
<set-pk-fields map-name="parameters" value-name="lookupMap"/>
<find-by-primary-key entity-name="QuoteWorkEffort" map-name="lookupMap" value-name="quoteWorkEffort"/>
<if-not-empty field-name="quoteId" map-name="quoteWorkEffort">
<if-not-empty field="quoteWorkEffort.quoteId">
<add-error><fail-message message="ERROR: QuoteWorkEffort [${parameters.quoteId}][${parameters.workEffortId}] already exists."/></add-error>
<check-errors/>
</if-not-empty>
<if-empty field-name="quoteId" map-name="quoteWorkEffort">
<if-empty field="quoteWorkEffort.quoteId">
<set-nonpk-fields map-name="parameters" value-name="lookupMap"/>
<create-value value-name="lookupMap"/>
<field-to-result field-name="quoteId" map-name="lookupMap"/>
@@ -857,12 +857,12 @@ under the License.
<make-value entity-name="QuoteWorkEffort" value-name="lookupMap"/>
<set-pk-fields map-name="parameters" value-name="lookupMap"/>
<find-by-primary-key entity-name="QuoteWorkEffort" map-name="lookupMap" value-name="quoteWorkEffort"/>
<if-empty field-name="quoteId" map-name="quoteWorkEffort">
<if-empty field="quoteWorkEffort.quoteId">
<add-error><fail-message message="ERROR: QuoteWorkEffort [${parameters.quoteId}][${parameters.workEffortId}] does not exist."/></add-error>
<check-errors/>
</if-empty>
<if-not-empty field-name="quoteId" map-name="quoteWorkEffort">
<if-not-empty field="quoteWorkEffort.quoteId">
<remove-value value-name="quoteWorkEffort"/>
</if-not-empty>
</simple-method>
</simple-methods>
</simple-methods>
@@ -24,8 +24,8 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="parameters.fromPartyId"/></not>
<not><if-compare-field field-name="parameters.fromPartyId" operator="equals" to-field-name="userLogin.partyId"/></not>
<not><if-empty field="parameters.fromPartyId"/></not>
<not><if-compare-field field="parameters.fromPartyId" to-field="userLogin.partyId" operator="equals"/></not>
<not><if-has-permission permission="ORDERMGR" action="_CRQ_CREATE"/></not>
</and>
</condition>
@@ -43,7 +43,7 @@ under the License.
<set from-field="userLogin.userLoginId" field="newEntity.lastModifiedByUserLogin"/>
<set from-field="userLogin.userLoginId" field="newEntity.createdByUserLogin"/>
<if-empty field-name="statusId" map-name="parameters">
<if-empty field="parameters.statusId">
<set value="CRQ_SUBMITTED" field="newEntity.statusId"/>
</if-empty>
@@ -57,8 +57,8 @@ under the License.
then we associate it to the request as the request taker.
This is not done if they are the same e.g. a logged in customer that is creating a request for its
own sake. -->
<if-not-empty field-name="userLogin.partyId"> <!-- just in case the service is called by the "system" userLogin -->
<if-compare-field field-name="parameters.fromPartyId" operator="not-equals" to-field-name="userLogin.partyId">
<if-not-empty field="userLogin.partyId"> <!-- just in case the service is called by the "system" userLogin -->
<if-compare-field field="parameters.fromPartyId" to-field="userLogin.partyId" operator="not-equals">
<set from-field="newEntity.custRequestId" field="takerMap.custRequestId"/>
<set from-field="userLogin.partyId" field="takerMap.partyId"/>
<set value="REQ_TAKER" field="takerMap.roleTypeId"/>
@@ -74,7 +74,7 @@ under the License.
There is now the fromPartyId field in the CustRequest entity for this. -->
<!--
<field-to-field field-name="custRequestId" map-name="newEntity" to-map-name="requesterMap"/>
<if-not-empty field-name="requestPartyId" map-name="parameters">
<if-not-empty field="parameters.requestPartyId">
<field-to-field field-name="requestPartyId" map-name="parameters" to-map-name="requesterMap" to-field-name="partyId"/>
<else>
<field-to-field field-name="partyId" map-name="userLogin" to-map-name="requesterMap"/>
@@ -87,7 +87,7 @@ under the License.
<simple-method method-name="updateCustRequest" short-description="Update Customer Request">
<set from-field="parameters.custRequestId" field="lookupPKMap.custRequestId"/>
<find-by-primary-key entity-name="CustRequest" map-name="lookupPKMap" value-name="custRequest"/>
<if-compare-field field-name="custRequest.statusId" operator="not-equals" to-field-name="parameters.statusId">
<if-compare-field field="custRequest.statusId" to-field="parameters.statusId" operator="not-equals">
<!-- save the changed status in the history -->
<set field="custRequest.statusId" from-field="parameters.statusId"/>
<set-service-fields to-map-name="statusMap" service-name="createCustRequestStatus" map-name="custRequest"/>
@@ -118,10 +118,10 @@ under the License.
<make-value value-name="newEntity" entity-name="CustRequestItem"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="custRequestItemSeqId" map-name="parameters">
<if-empty field="parameters.custRequestItemSeqId">
<make-next-seq-id value-name="newEntity" seq-field-name="custRequestItemSeqId"/>
</if-empty>
<if-empty field-name="statusId" map-name="parameters">
<if-empty field="parameters.statusId">
<set value="CRQ_SUBMITTED" field="newEntity.statusId"/>
</if-empty>
<create-value value-name="newEntity"/>
@@ -140,7 +140,7 @@ under the License.
<set from-field="parameters.partyId" field="lookupPKMap.partyId"/>
<set from-field="parameters.roleTypeId" field="lookupPKMap.roleTypeId"/>
<find-by-primary-key entity-name="PartyRole" map-name="lookupPKMap" value-name="partyRole"/>
<if-empty map-name="partyRole" field-name="partyId">
<if-empty field="partyRole.partyId">
<make-value value-name="partyRole" entity-name="PartyRole"/>
<set-pk-fields map-name="lookupPKMap" value-name="partyRole"/>
<create-value value-name="partyRole"/>
@@ -212,12 +212,12 @@ under the License.
<!-- a new request item is created -->
<clear-field field-name="createCustRequestItemInMap"/>
<call-object-method obj-field-name="item" method-name="getConfigWrapper" ret-field-name="configWrapper"/>
<if-not-empty field-name="configWrapper">
<if-not-empty field="configWrapper">
<call-object-method obj-field-name="configWrapper" method-name="getConfigId" ret-field-name="configId"/>
<set from-field="configId" field="createCustRequestItemInMap.configId"/>
</if-not-empty>
<call-object-method obj-field-name="item" method-name="getIsPromo" ret-field-name="isPromo"/>
<if-compare field-name="isPromo" value="false" operator="equals" type="Boolean">
<if-compare field="isPromo" value="false" operator="equals" type="Boolean">
<set from-field="custRequest.custRequestId" field="createCustRequestItemInMap.custRequestId"/>
<call-object-method obj-field-name="item" method-name="getProductId" ret-field-name="createCustRequestItemInMap.productId"/>
<call-object-method obj-field-name="item" method-name="getQuantity" ret-field-name="createCustRequestItemInMap.quantity"/>
@@ -261,8 +261,8 @@ under the License.
<set-service-fields service-name="createCustRequestItem" to-map-name="createCustRequestItemInMap" map-name="custRequestItem"/>
<set field="createCustRequestItemInMap.custRequestId" from-field="parameters.custRequestIdTo"/>
<set field="createCustRequestItemInMap.custRequestItemSeqId" from-field="parameters.custRequestItemSeqId"/>
<if-empty field-name="parameters.custRequestIdTo">
<if-empty field-name="parameters.custRequestItemSeqIdTo">
<if-empty field="parameters.custRequestIdTo">
<if-empty field="parameters.custRequestItemSeqIdTo">
<clear-field field-name="createCustRequestItemInMap.custRequestItemSeqId"/>
</if-empty>
</if-empty>
@@ -274,7 +274,7 @@ under the License.
<check-errors/>
<if-compare field-name="parameters.copyLinkedQuotes" value="Y" operator="equals">
<if-compare field="parameters.copyLinkedQuotes" value="Y" operator="equals">
<get-related value-name="custRequestItem" relation-name="QuoteItem" list-name="quoteItems"/>
<iterate list-name="quoteItems" entry-name="quoteItem">
<clear-field field-name="createQuoteItemInMap"/>
@@ -293,7 +293,7 @@ under the License.
<make-value value-name="newEntity" entity-name="CustRequestStatus"/>
<make-next-seq-id value-name="newEntity" seq-field-name="custRequestStatusId"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.statusDatetime">
<if-empty field="newEntity.statusDatetime">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.statusDatetime"/>
</if-empty>
@@ -26,7 +26,7 @@ under the License.
<to-string field-name="requirementId"/>
<set from-field="requirementId" field="newEntity.requirementId"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="statusId" map-name="parameters">
<if-empty field="parameters.statusId">
<set value="REQ_CREATED" field="newEntity.statusId"/>
</if-empty>
<now-timestamp-to-env env-name="nowTimestamp"/>
@@ -68,8 +68,8 @@ under the License.
<simple-method method-name="autoAssignRequirementToSupplier" short-description="If the requirement is a product requirement (purchasing) try to assign it to the primary supplier">
<entity-one entity-name="Requirement" value-name="requirement" auto-field-map="true"/>
<check-errors/>
<if-compare field-name="requirement.requirementTypeId" operator="equals" value="PRODUCT_REQUIREMENT">
<if-not-empty field-name="requirement.productId">
<if-compare field="requirement.requirementTypeId" operator="equals" value="PRODUCT_REQUIREMENT">
<if-not-empty field="requirement.productId">
<entity-condition entity-name="SupplierProduct" list-name="supplierProducts">
<condition-list>
<condition-expr field-name="productId" env-name="requirement.productId"/>
@@ -80,7 +80,7 @@ under the License.
</entity-condition>
<filter-list-by-date list-name="supplierProducts" valid-date-name="requirement.requiredByDate" from-field-name="availableFromDate" thru-field-name="availableThruDate"/>
<first-from-list list-name="supplierProducts" entry-name="supplierProduct"/>
<if-not-empty field-name="supplierProduct.partyId">
<if-not-empty field="supplierProduct.partyId">
<make-value value-name="requirementSupplier" entity-name="RequirementRole"/>
<set field="requirementSupplier.requirementId" from-field="requirement.requirementId"/>
<set field="requirementSupplier.partyId" from-field="supplierProduct.partyId"/>
@@ -101,7 +101,7 @@ under the License.
<set from-field="parameters.partyId" field="lookupPKMap.partyId"/>
<set from-field="parameters.roleTypeId" field="lookupPKMap.roleTypeId"/>
<find-by-primary-key entity-name="PartyRole" map-name="lookupPKMap" value-name="partyRole"/>
<if-empty map-name="partyRole" field-name="partyId">
<if-empty field="partyRole.partyId">
<make-value value-name="partyRole" entity-name="PartyRole"/>
<set-pk-fields map-name="lookupPKMap" value-name="partyRole"/>
<create-value value-name="partyRole"/>
@@ -110,7 +110,7 @@ under the License.
<make-value value-name="newEntity" entity-name="RequirementRole"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
<create-value value-name="newEntity"/>
@@ -158,7 +158,7 @@ under the License.
<result-to-field field-name="quantityNotTransferred" result-name="quantityNotTransferred"/>
</call-service>
<check-errors/>
<if-compare field-name="quantityNotTransferred" value="0.0" operator="greater" type="Double">
<if-compare field="quantityNotTransferred" value="0.0" operator="greater" type="Double">
<!-- we create a new requirement for the quantity not trasferred (because not available) -->
<clear-field field-name="inputMap"/>
<set-service-fields service-name="createRequirement" map-name="requirement" to-map-name="inputMap"/>
@@ -24,8 +24,8 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="partyId" map-name="parameters"/></not>
<not><if-compare-field field-name="partyId" map-name="parameters" operator="equals" to-map-name="userLogin"/></not>
<not><if-empty field="parameters.partyId"/></not>
<not><if-compare-field to-field="userLogin." field="parameters.partyId" operator="equals"/></not>
<not><if-has-permission permission="PARTYMGR" action="_CREATE"/></not>
</and>
</condition>
@@ -38,25 +38,25 @@ under the License.
<make-value value-name="newEntity" entity-name="ShoppingList"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.partyId">
<if-empty field="newEntity.partyId">
<set from-field="userLogin.partyId" field="newEntity.partyId"/>
</if-empty>
<if-empty field-name="newEntity.shoppingListTypeId">
<if-empty field="newEntity.shoppingListTypeId">
<set value="SLT_WISH_LIST" field="newEntity.shoppingListTypeId"/>
</if-empty>
<if-empty field-name="listName" map-name="newEntity">
<if-empty field="newEntity.listName">
<property-to-field field-name="newEntity.listName"
resource="OrderUiLabels" property="OrderNewShoppingList" default="New Shopping List"/>
</if-empty>
<if-empty field-name="isPublic" map-name="newEntity">
<if-empty field="newEntity.isPublic">
<set value="N" field="newEntity.isPublic"/>
</if-empty>
<if-empty field-name="isActive" map-name="newEntity">
<if-compare field-name="newEntity.shoppingListTypeId" operator="equals" value="SLT_AUTO_REODR">
<if-empty field="newEntity.isActive">
<if-compare field="newEntity.shoppingListTypeId" operator="equals" value="SLT_AUTO_REODR">
<set value="N" field="newEntity.isActive"/>
<else>
<set value="Y" field="newEntity.isActive"/>
@@ -83,12 +83,12 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="shoppingList.shoppingListTypeId" operator="equals" value="SLT_AUTO_REODR"/>
<if-compare field="shoppingList.shoppingListTypeId" operator="equals" value="SLT_AUTO_REODR"/>
<or>
<if-empty field-name="shoppingList.recurrenceInfoId"/>
<if-empty field-name="shoppingList.paymentMethodId"/>
<if-empty field-name="shoppingList.contactMechId"/>
<if-empty field-name="shoppingList.shipmentMethodTypeId"/>
<if-empty field="shoppingList.recurrenceInfoId"/>
<if-empty field="shoppingList.paymentMethodId"/>
<if-empty field="shoppingList.contactMechId"/>
<if-empty field="shoppingList.shipmentMethodTypeId"/>
</or>
</and>
</condition>
@@ -119,7 +119,7 @@ under the License.
<entity-one entity-name="ShoppingList" value-name="shoppingList"/>
<entity-one entity-name="Product" value-name="product"/>
<if-empty field-name="product">
<if-empty field="product">
<add-error> <fail-property property="ProductErrorProductNotFound" resource="OrderUiLabels"/> </add-error>
<check-errors/>
</if-empty>
@@ -132,7 +132,7 @@ under the License.
<field-to-result field-name="newEntity.shoppingListId" result-name="shoppingListId"/>
<create-value value-name="newEntity"/>
<if-compare-field field-name="shoppingList.partyId" operator="not-equals" to-field-name="userLogin.partyId">
<if-compare-field field="shoppingList.partyId" to-field="userLogin.partyId" operator="not-equals">
<now-timestamp-to-env env-name="shoppingList.lastAdminModified"/>
<store-value value-name="shoppingList"/>
</if-compare-field>
@@ -147,7 +147,7 @@ under the License.
<entity-one entity-name="ShoppingList" value-name="shoppingList"/>
<entity-one entity-name="ShoppingListItem" value-name="shoppingListItem"/>
<if-compare field-name="parameters.quantity" operator="equals" value="0" type="Double">
<if-compare field="parameters.quantity" operator="equals" value="0" type="Double">
<!-- if we're setting quantity to 0.0 then remove the item -->
<set-service-fields service-name="removeShoppingListItem" map-name="parameters" to-map-name="removeParams"/>
<call-service service-name="removeShoppingListItem" in-map-name="removeParams"/>
@@ -158,7 +158,7 @@ under the License.
</else>
</if-compare>
<if-compare-field field-name="shoppingList.partyId" operator="not-equals" to-field-name="userLogin.partyId">
<if-compare-field field="shoppingList.partyId" to-field="userLogin.partyId" operator="not-equals">
<now-timestamp-to-env env-name="shoppingList.lastAdminModified"/>
<store-value value-name="shoppingList"/>
</if-compare-field>
@@ -174,7 +174,7 @@ under the License.
<entity-one entity-name="ShoppingListItem" value-name="shoppingListItem"/>
<remove-value value-name="shoppingListItem"/>
<if-compare-field field-name="shoppingList.partyId" operator="not-equals" to-field-name="userLogin.partyId">
<if-compare-field field="shoppingList.partyId" to-field="userLogin.partyId" operator="not-equals">
<now-timestamp-to-env env-name="shoppingList.lastAdminModified"/>
<store-value value-name="shoppingList"/>
</if-compare-field>
@@ -187,7 +187,7 @@ under the License.
</entity-condition>
<iterate list-name="shoppingListItemList" entry-name="shoppingListItem">
<if-compare-field field-name="parameters.productId" operator="equals" to-field-name="shoppingListItem.productId">
<if-compare-field field="parameters.productId" to-field="shoppingListItem.productId" operator="equals">
<field-to-result field-name="shoppingListItem.shoppingListItemSeqId" result-name="shoppingListItemSeqId" />
<return />
</if-compare-field>
@@ -261,7 +261,7 @@ under the License.
<if>
<condition>
<and>
<not><if-compare-field field-name="partyId" map-name="userLogin" operator="equals" to-map-name="shoppingList"/></not>
<not><if-compare-field to-field="shoppingList." field="userLogin.partyId" operator="equals"/></not>
<not><if-has-permission permission="PARTYMGR" action="_${permissionAction}"/></not>
</and>
</condition>
@@ -275,7 +275,7 @@ under the License.
<if>
<condition>
<and>
<not><if-compare-field field-name="userLogin.partyId" operator="equals" to-field-name="shoppingList.partyId"/></not>
<not><if-compare-field field="userLogin.partyId" to-field="shoppingList.partyId" operator="equals"/></not>
<not><if-has-permission permission="PARTYMGR" action="_${permissionAction}"/></not>
</and>
</condition>
@@ -287,12 +287,12 @@ under the License.
<simple-method method-name="addSuggestionsToShoppingList" short-description="Add suggestions to a shopping list">
<!-- first check the ProductStore.enableAutoSuggestionList indicator -->
<entity-one entity-name="OrderHeader" value-name="orderHeader"/>
<if-empty field-name="orderHeader.productStoreId"><return/></if-empty>
<if-empty field="orderHeader.productStoreId"><return/></if-empty>
<entity-one entity-name="ProductStore" value-name="productStore" auto-field-map="false">
<field-map field-name="productStoreId" env-name="orderHeader.productStoreId"/>
</entity-one>
<if-compare field-name="productStore.enableAutoSuggestionList" operator="not-equals" value="Y"><return/></if-compare>
<if-compare field="productStore.enableAutoSuggestionList" operator="not-equals" value="Y"><return/></if-compare>
<entity-condition entity-name="OrderRole" list-name="orderRoleList">
<condition-list combine="and">
@@ -309,7 +309,7 @@ under the License.
</condition-list>
</entity-condition>
<first-from-list list-name="shoppingListList" entry-name="shoppingList" />
<if-empty field-name="shoppingList">
<if-empty field="shoppingList">
<set field="createShoppingListInMap.partyId" from-field="orderRole.partyId" />
<set field="createShoppingListInMap.listName" value="Auto Suggestions" />
<set field="createShoppingListInMap.shoppingListTypeId" value="SLT_WISH_LIST" />
@@ -326,7 +326,7 @@ under the License.
<order-by field-name="orderItemSeqId" />
</entity-condition>
<iterate list-name="orderItemList" entry-name="orderItem">
<if-not-empty field-name="orderItem.productId">
<if-not-empty field="orderItem.productId">
<entity-condition entity-name="ProductAssoc" list-name="compProductAssocList" filter-by-date="true">
<condition-list combine="and">
<condition-expr field-name="productId" env-name="orderItem.productId" />
@@ -343,7 +343,7 @@ under the License.
<entity-one entity-name="Product" value-name="product" auto-field-map="false" >
<field-map field-name="productId" env-name="orderItem.productId" />
</entity-one>
<if-compare field-name="product.isVariant" operator="equals" value="Y">
<if-compare field="product.isVariant" operator="equals" value="Y">
<entity-condition entity-name="ProductAssoc" list-name="virtualProductAssocList" filter-by-date="true">
<condition-list combine="and">
<condition-expr field-name="productIdTo" env-name="orderItem.productId" />
@@ -351,7 +351,7 @@ under the License.
</condition-list>
</entity-condition>
<first-from-list list-name="virtualProductAssocList" entry-name="virtualProductAssoc" />
<if-not-empty field-name="virtualProductAssoc">
<if-not-empty field="virtualProductAssoc">
<entity-condition entity-name="ProductAssoc" list-name="compProductAssocList" filter-by-date="true">
<condition-list combine="and">
<condition-expr field-name="productId" env-name="virtualProductAssoc.productId" />
@@ -22,14 +22,14 @@ under the License.
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="createCommunicationEvent" short-description="Create a CommunicationEvent">
<if-empty field-name="parameters.statusId">
<if-empty field="parameters.statusId">
<set value="COM_ENTERED" field="parameters.statusId"/>
</if-empty>
<make-value value-name="newEntity" entity-name="CommunicationEvent"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="parameters.communicationEventId">
<if-empty field="parameters.communicationEventId">
<sequenced-id-to-env sequence-name="CommunicationEvent" env-name="newEntity.communicationEventId"/>
<else>
<set field="newEntity.communicationEventId" from-field="parameters.communicationEventId"/>
@@ -41,13 +41,13 @@ under the License.
<create-value value-name="newEntity"/>
<if-not-empty field-name="parameters.productId">
<if-not-empty field="parameters.productId">
<make-value value-name="eventProduct" entity-name="CommunicationEventProduct"/>
<set from-field="parameters.productId" field="eventProduct.productId"/>
<set from-field="newEntity.communicationEventId" field="eventProduct.communicationEventId"/>
<create-value value-name="eventProduct"/>
</if-not-empty>
<if-not-empty field-name="parameters.orderId">
<if-not-empty field="parameters.orderId">
<make-value value-name="eventOrder" entity-name="CommunicationEventOrder"/>
<set from-field="parameters.orderId" field="eventOrder.orderId"/>
<set from-field="newEntity.communicationEventId" field="eventOrder.communicationEventId"/>
@@ -65,24 +65,24 @@ under the License.
<entity-one entity-name="CommunicationEvent" value-name="event"/>
<!-- remove related links to content -->
<get-related value-name="event" relation-name="CommEventContentAssoc" list-name="contentAssocs"/>
<if-not-empty field-name="contentAssocs">
<if-not-empty field="contentAssocs">
<iterate entry-name="contentAssoc" list-name="contentAssocs">
<remove-value value-name="contentAssoc"/>
<!-- delete content and dataresource too if requested -->
<if-compare field-name="parameters.delContentDataResource" value="Y" operator="equals">
<if-compare field="parameters.delContentDataResource" value="Y" operator="equals">
<get-related value-name="contentAssoc" relation-name="FromContent" list-name="contents"/>
<if-not-empty field-name="contents">
<if-not-empty field="contents">
<iterate entry-name="content" list-name="contents">
<remove-related value-name="content" relation-name="ContentRole"/>
<remove-value value-name="content"/>
<get-related-one value-name="content" relation-name="DataResource" to-value-name="dataResource"/>
<if-not-empty field-name="dataResource">
<if-not-empty field="dataResource">
<get-related-one value-name="dataResource" relation-name="ImageDataResource" to-value-name="imageDataResource"/>
<if-not-empty field-name="imageDataResource">
<if-not-empty field="imageDataResource">
<remove-value value-name="imageDataResource"/>
</if-not-empty>
<get-related-one value-name="dataResource" relation-name="ElectronicText" to-value-name="electronicText"/>
<if-not-empty field-name="electronicText">
<if-not-empty field="electronicText">
<remove-value value-name="electronicText"/>
</if-not-empty>
<remove-related value-name="dataResource" relation-name="DataResourceRole"/>
@@ -102,12 +102,12 @@ under the License.
<entity-one entity-name="CommunicationEvent" value-name="event"/>
<!-- remove related workeffort when this is the only communicationevent connected to it -->
<get-related value-name="event" relation-name="CommunicationEventWorkEff" list-name="workEffortComs"/>
<if-not-empty field-name="workEffortComs">
<if-not-empty field="workEffortComs">
<iterate entry-name="workEffortCom" list-name="workEffortComs">
<remove-value value-name="workEffortCom"/>
<get-related-one value-name="workEffortCom" relation-name="WorkEffort" to-value-name="workEffort"/>
<get-related value-name="workEffort" relation-name="CommunicationEventWorkEff" list-name="otherComs"/>
<if-empty field-name="otherComs">
<if-empty field="otherComs">
<log level="info" message="remove workeffort ${workEffort.workEffortId} and related parties and status"/>
<remove-related value-name="workEffort" relation-name="WorkEffortPartyAssignment"/>
<remove-related value-name="workEffort" relation-name="WorkEffortPartyAssignment"/>
@@ -148,7 +148,7 @@ under the License.
</simple-method>
<simple-method method-name="markEventRead" short-description="Marks a Communication Event as Read">
<if-empty field-name="parameters.communicationEventId">
<if-empty field="parameters.communicationEventId">
<set from-field="parameters.messageId" field="parameters.communicationEventId"/>
</if-empty>
<entity-one entity-name="CommunicationEvent" value-name="event"/>
@@ -156,7 +156,7 @@ under the License.
<if>
<condition>
<or>
<if-compare-field field-name="partyIdTo" map-name="event" to-map-name="userLogin" to-field-name="partyId" operator="equals"/>
<if-compare-field field="event.partyIdTo" to-field="userLogin.partyId" operator="equals"/>
<if-has-permission permission="PARTYMGR" action="_CME_UPDATE"/>
</or>
</condition>
@@ -164,8 +164,8 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="statusId" map-name="event" operator="equals" value="COM_ENTERED"/>
<if-compare field-name="statusId" map-name="event" operator="equals" value="COM_PENDING"/>
<if-compare field="event.statusId" operator="equals" value="COM_ENTERED"/>
<if-compare field="event.statusId" operator="equals" value="COM_PENDING"/>
</or>
</condition>
<then>
@@ -22,7 +22,7 @@ under the License.
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="createContactMech" short-description="Create Contact Mechanism">
<make-value value-name="newValue" entity-name="ContactMech"/>
<if-empty field-name="parameters.contactMechId">
<if-empty field="parameters.contactMechId">
<sequenced-id-to-env sequence-name="ContactMech" env-name="newValue.contactMechId"/>
<else>
<set field="newValue.contactMechId" from-field="parameters.contactMechId"/>
@@ -36,35 +36,35 @@ under the License.
</simple-method>
<simple-method method-name="updateContactMech" short-description="Update Contact Mechanism">
<if-compare field-name="contactMechTypeId" operator="equals" value="POSTAL_ADDRESS">
<if-compare field="contactMechTypeId" operator="equals" value="POSTAL_ADDRESS">
<add-error><fail-property resource="PartyUiLabels" property="PartyServiceNotForPostalAddress"/></add-error>
</if-compare>
<if-compare field-name="contactMechTypeId" operator="equals" value="TELECOM_NUMBER">
<if-compare field="contactMechTypeId" operator="equals" value="TELECOM_NUMBER">
<add-error><fail-property resource="PartyUiLabels" property="PartyServiceNotForTelecomNumber"/></add-error>
</if-compare>
<check-errors/>
<set field="successMessageProperty" value="PartyContactMechanismSuccessfullyUpdated"/>
<if-compare map-name="context" field-name="contactMechTypeId" operator="equals" value="EMAIL_ADDRESS">
<if-compare field="context.contactMechTypeId" operator="equals" value="EMAIL_ADDRESS">
<set field="successMessageProperty" value="PartyEmailAddressSuccessfullyUpdated"/>
</if-compare>
<if-compare map-name="context" field-name="contactMechTypeId" operator="equals" value="WEB_ADDRESS">
<if-compare field="context.contactMechTypeId" operator="equals" value="WEB_ADDRESS">
<set field="successMessageProperty" value="PartyWebAddressSuccessfullyUpdated"/>
</if-compare>
<if-compare map-name="context" field-name="contactMechTypeId" operator="equals" value="IP_ADDRESS">
<if-compare field="context.contactMechTypeId" operator="equals" value="IP_ADDRESS">
<set field="successMessageProperty" value="PartyIpAddressSuccessfullyUpdated"/>
</if-compare>
<if-compare map-name="context" field-name="contactMechTypeId" operator="equals" value="ELECTRONIC_ADDRESS">
<if-compare field="context.contactMechTypeId" operator="equals" value="ELECTRONIC_ADDRESS">
<set field="successMessageProperty" value="PartyElectronicAddressSuccessfullyUpdated"/>
</if-compare>
<if-compare map-name="context" field-name="contactMechTypeId" operator="equals" value="DOMAIN_NAME">
<if-compare field="context.contactMechTypeId" operator="equals" value="DOMAIN_NAME">
<set field="successMessageProperty" value="PartyDomainNameSuccessfullyUpdated"/>
</if-compare>
<make-value entity-name="ContactMech" value-name="ContactMechMap"/>
<set-pk-fields value-name="ContactMechMap" map-name="parameters"/>
<find-by-primary-key entity-name="ContactMech" map-name="ContactMechMap" value-name="oldValue" />
<if-compare-field map-name="parameters" field-name="infoString" to-map-name="oldValue" operator="not-equals">
<if-compare-field to-field="oldValue." field="parameters.infoString" operator="not-equals">
<log level="info" message="Contact mech need updating"/>
<clone-value value-name="oldValue" new-value-name="newValue"/>
<set-nonpk-fields map-name="parameters" value-name="newValue" set-if-null="false"/>
@@ -85,15 +85,15 @@ under the License.
</simple-method>
<simple-method method-name="createPostalAddress" short-description="Create Contact Mechanism with PostalAddress">
<if-compare value="USA" operator="equals" field-name="countryGeoId" map-name="parameters">
<if-empty field-name="stateProvinceGeoId" map-name="parameters">
<if-compare value="USA" operator="equals" field="parameters.countryGeoId">
<if-empty field="parameters.stateProvinceGeoId">
<add-error>
<fail-property resource="PartyUiLabels" property="PartyStateInUsMissing"/>
</add-error>
</if-empty>
</if-compare>
<if-compare value="CAN" operator="equals" field-name="countryGeoId" map-name="parameters">
<if-empty field-name="stateProvinceGeoId" map-name="parameters">
<if-compare value="CAN" operator="equals" field="parameters.countryGeoId">
<if-empty field="parameters.stateProvinceGeoId">
<add-error>
<fail-property resource="PartyUiLabels" property="PartyProveinceInCanadaMissing"/>
</add-error>
@@ -113,15 +113,15 @@ under the License.
</simple-method>
<simple-method method-name="updatePostalAddress" short-description="Update Contact Mechanism with PostalAddress">
<if-compare value="USA" operator="equals" field-name="countryGeoId" map-name="parameters">
<if-empty field-name="stateProvinceGeoId" map-name="parameters">
<if-compare value="USA" operator="equals" field="parameters.countryGeoId">
<if-empty field="parameters.stateProvinceGeoId">
<add-error>
<fail-property resource="PartyUiLabels" property="PartyStateInUsMissing"/>
</add-error>
</if-empty>
</if-compare>
<if-compare value="CAN" operator="equals" field-name="countryGeoId" map-name="parameters">
<if-empty field-name="stateProvinceGeoId" map-name="parameters">
<if-compare value="CAN" operator="equals" field="parameters.countryGeoId">
<if-empty field="parameters.stateProvinceGeoId">
<add-error>
<fail-property resource="PartyUiLabels" property="PartyProveinceInCanadaMissing"/>
</add-error>
@@ -135,7 +135,7 @@ under the License.
<set field="context.contactMechTypeId" value="POSTAL_ADDRESS"/>
<if-compare-field field-name="oldValue" to-field-name="newValue" operator="not-equals" type="Object">
<if-compare-field field="oldValue" to-field="newValue" operator="not-equals" type="Object">
<log level="info" message="Postal address need updating"/>
<call-service service-name="createContactMech" in-map-name="context">
<default-message resource="PartyUiLabels" property="PartyPostalAddressSuccessfullyUpdated"/>
@@ -148,7 +148,7 @@ under the License.
<default-message resource="PartyUiLabels" property="PartyPostalAddressSuccessfullyUpdated"/>
<result-to-field result-name="contactMechId" map-name="newValue"/>
</call-service>
<if-compare-field map-name="oldValue" to-map-name="newValue" field-name="contactMechId" operator="not-equals">
<if-compare-field to-field="newValue." field="oldValue.contactMechId" operator="not-equals">
<log level="info" message="Postal address need updating, contact mech changed"/>
<create-value value-name="newValue"/>
<else>
@@ -182,7 +182,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newValue"/>
<set field="context.contactMechTypeId" value="TELECOM_NUMBER"/>
<if-compare-field field-name="oldValue" to-field-name="newValue" operator="not-equals" type="Object">
<if-compare-field field="oldValue" to-field="newValue" operator="not-equals" type="Object">
<log level="info" message="Telecom number needs updating"/>
<call-service service-name="createContactMech" in-map-name="context">
<default-message resource="PartyUiLabels" property="PartyTelecomNumberSuccessfullyUpdated"/>
@@ -195,7 +195,7 @@ under the License.
<default-message resource="PartyUiLabels" property="PartyTelecomNumberSuccessfullyUpdated"/>
<result-to-field result-name="contactMechId" map-name="newValue"/>
</call-service>
<if-compare-field map-name="oldValue" to-map-name="newValue" field-name="contactMechId" operator="not-equals">
<if-compare-field to-field="newValue." field="oldValue.contactMechId" operator="not-equals">
<log level="info" message="Telecom Number need updating, contact mech changed"/>
<create-value value-name="newValue"/>
<else>
@@ -274,7 +274,7 @@ under the License.
<find-by-primary-key value-name="emailAddressVerification" entity-name="EmailAddressVerification" map-name="lookupHash"/>
<set field="bodyParameters.verifyHash" from-field="emailAddressVerification.verifyHash"/>
<first-from-list entry-name="storeEmail" list-name="productStoreEmailSettings"/>
<if-not-empty field-name="bodyScreenLocation" map-name="storeEmail">
<if-not-empty field="storeEmail.bodyScreenLocation">
<set field="emailParams.sendTo" from-field="parameters.emailAddress"/>
<set field="emailParams.subject" from-field="storeEmail.subject"/>
<set field="emailParams.sendFrom" from-field="storeEmail.fromAddress"/>
@@ -293,9 +293,9 @@ under the License.
</entity-and>
<first-from-list list-name="emailAddressVerifications" entry-name="emailAddressVerification"/>
<if-not-empty field-name="emailAddressVerification">
<if-not-empty field="emailAddressVerification">
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-compare-field field-name="emailAddressVerification.expireDate" operator="less" to-field-name="nowTimestamp">
<if-compare-field field="emailAddressVerification.expireDate" to-field="nowTimestamp" operator="less">
<add-error><fail-property resource="PartyUiLabels" property="PartyEmailAddressVerificationExpired"/></add-error>
</if-compare-field>
<else>
@@ -23,11 +23,11 @@ under the License.
<simple-method method-name="createPartyContactMech" short-description="Create a PartyContactMech">
<make-value entity-name="PartyContactMech" value-name="newValue"/>
<make-value entity-name="PartyContactMech" value-name="newPartyContactMech"/><!-- DEJ20061016: is this really needed? doesn't seem to be used... -->
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
<if-empty map-name="parameters" field-name="contactMechId">
<if-empty field="parameters.contactMechId">
<set-service-fields service-name="createContactMech" map-name="parameters" to-map-name="createContactMechMap"/>
<call-service service-name="createContactMech" in-map-name="createContactMechMap">
<result-to-field result-name="contactMechId" map-name="newValue"/>
@@ -48,7 +48,7 @@ under the License.
<simple-method method-name="updatePartyContactMech" short-description="Update a PartyContactMech">
<make-value entity-name="PartyContactMech" value-name="newPartyContactMech"/>
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
@@ -58,7 +58,7 @@ under the License.
<find-by-and entity-name="PartyContactMech" list-name="partyContactMechs" map-name="partyContactMechMap"/>
<filter-list-by-date list-name="partyContactMechs" to-list-name="validPartyContactMechs"/>
<first-from-list entry-name="partyContactMech" list-name="validPartyContactMechs"/>
<if-empty field-name="partyContactMech">
<if-empty field="partyContactMech">
<add-error><fail-property resource="PartyUiLabels" property="PartyCannotUpdateContactBecauseNotWithSpecifiedParty"/></add-error>
</if-empty>
@@ -67,7 +67,7 @@ under the License.
<clone-value value-name="partyContactMech" new-value-name="newPartyContactMech"/>
<!-- If we already have a new contactMechId don't update ContactMech -->
<if-empty map-name="parameters" field-name="newContactMechId">
<if-empty field="parameters.newContactMechId">
<set-service-fields service-name="updateContactMech" map-name="parameters" to-map-name="updateContactMechMap"/>
<call-service service-name="updateContactMech" in-map-name="updateContactMechMap">
<default-message resource="PartyUiLabels" property="PartyContactMechanismSuccessfullyUpdated"/>
@@ -86,7 +86,7 @@ under the License.
<store-value value-name="partyContactMech"/>
<create-value value-name="newPartyContactMech"/>
<if-compare-field field-name="contactMechId" map-name="parameters" to-map-name="newPartyContactMech" operator="not-equals">
<if-compare-field to-field="newPartyContactMech." field="parameters.contactMechId" operator="not-equals">
<get-related value-name="partyContactMech" relation-name="PartyContactMechPurpose" list-name="partyContactMechPurposes"/>
<iterate entry-name="partyContactMechPurposeOld" list-name="partyContactMechPurposes">
<clone-value value-name="partyContactMechPurposeOld" new-value-name="partyContactMechPurpose"/>
@@ -99,7 +99,7 @@ under the License.
<set field="purposeMap.contactMechId" from-field="partyContactMechPurpose.contactMechId"/>
<find-by-and entity-name="PartyContactMechPurpose" list-name="purposeResult" map-name="purposeMap"/>
<if-empty field-name="purposeResult">
<if-empty field="purposeResult">
<create-value value-name="partyContactMechPurpose"/>
</if-empty>
</iterate>
@@ -112,7 +112,7 @@ under the License.
<simple-method method-name="deletePartyContactMech" short-description="Delete a PartyContactMech">
<make-value entity-name="PartyContactMech" value-name="newPartyContactMech"/>
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
@@ -121,7 +121,7 @@ under the License.
<find-by-and entity-name="PartyContactMech" list-name="partyContactMechs" map-name="partyContactMechMap"/>
<filter-list-by-date list-name="partyContactMechs" to-list-name="validPartyContactMechs"/>
<first-from-list entry-name="partyContactMech" list-name="validPartyContactMechs"/>
<if-empty field-name="partyContactMech">
<if-empty field="partyContactMech">
<add-error>
<fail-property resource="PartyUiLabels" property="PartyContactMechNotFoundCannotDelete"/>
</add-error>
@@ -132,7 +132,7 @@ under the License.
</simple-method>
<simple-method method-name="createPartyPostalAddress" short-description="Create a PostalAddress for party">
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
@@ -156,7 +156,7 @@ under the License.
<simple-method method-name="updatePartyPostalAddress" short-description="Update a PostalAddress for party">
<make-value entity-name="PartyContactMech" value-name="newPartyContactMech"/>
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
@@ -178,7 +178,7 @@ under the License.
</simple-method>
<simple-method method-name="createPartyTelecomNumber" short-description="Create a TelecomNumber for party">
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
@@ -203,7 +203,7 @@ under the License.
<simple-method method-name="updatePartyTelecomNumber" short-description="Update a TelecomNumber for party">
<make-value entity-name="PartyContactMech" value-name="newPartyContactMech"/>
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
@@ -227,7 +227,7 @@ under the License.
</simple-method>
<simple-method method-name="createPartyEmailAddress" short-description="Create an email address for party">
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
@@ -247,7 +247,7 @@ under the License.
</simple-method>
<simple-method method-name="updatePartyEmailAddress" short-description="Update an email address for party">
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
@@ -272,7 +272,7 @@ under the License.
<set field="input.filterByDate" value="Y"/>
<set field="input.inputFields.infoString" from-field="parameters.address"/>
<if-empty field-name="parameters.fromDate">
<if-empty field="parameters.fromDate">
<now-timestamp-to-env env-name="input.filterByDateValue"/>
<else>
<set field="input.filterByDateValue" from-field="parameters.fromDate"/>
@@ -283,7 +283,7 @@ under the License.
<results-to-map map-name="results"/>
</call-service>
<if-not-empty field-name="results.item">
<if-not-empty field="results.item">
<field-to-result field-name="results.item.partyId" result-name="partyId"/>
<field-to-result field-name="results.item.contactMechId" result-name="contactMechId"/>
</if-not-empty>
@@ -26,7 +26,7 @@ under the License.
<set-pk-fields value-name="partyContent" map-name="parameters"/>
<set-nonpk-fields value-name="partyContent" map-name="parameters"/>
<if-empty field-name="fromDate" map-name="partyContent">
<if-empty field="partyContent.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="partyContent.fromDate" from-field="nowTimestamp"/>
</if-empty>
@@ -51,4 +51,4 @@ under the License.
<remove-value value-name="partyContent"/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -32,17 +32,17 @@ under the License.
<now-timestamp-to-env env-name="nowStamp"/>
<set field="parameters.roleTypeId" value="CUSTOMER" />
<if-compare field-name="create_allow_password" operator="not-equals" value="true">
<if-compare field="create_allow_password" operator="not-equals" value="true">
<set field="parameters.PASSWORD" from-field="default_customer_password" />
<set field="parameters.CONFIRM_PASSWORD" from-field="default_customer_password" />
<set field="parameters.PASSWORD_HINT" value="No hint set, accout not yet enabled" />
</if-compare>
<!-- if username and/or password should be lowercased, do that now -->
<if-compare field-name="username_lowercase" operator="equals" value="true">
<if-compare field="username_lowercase" operator="equals" value="true">
<call-object-method obj-field-name="USERNAME" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="USERNAME" ret-map-name="parameters"/>
</if-compare>
<if-compare field-name="password_lowercase" operator="equals" value="true">
<if-compare field="password_lowercase" operator="equals" value="true">
<call-object-method obj-field-name="PASSWORD" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="PASSWORD" ret-map-name="parameters"/>
<call-object-method obj-field-name="CONFIRM_PASSWORD" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="CONFIRM_PASSWORD" ret-map-name="parameters"/>
</if-compare>
@@ -60,10 +60,10 @@ under the License.
<process field="PASSWORD_HINT"><copy to-field="passwordHint"/></process>
</simple-map-processor>
</call-map-processor>
<if-not-empty field-name="userLoginId" map-name="userLoginContext">
<if-not-empty field="userLoginContext.userLoginId">
<set field="userLoginExistsMap.userLoginId" from-field="userLoginContext.userLoginId" />
<find-by-primary-key entity-name="UserLogin" map-name="userLoginExistsMap" value-name="existingUserLogin"/>
<if-not-empty field-name="existingUserLogin">
<if-not-empty field="existingUserLogin">
<set field="tempErrorMessage" value="Username in use, please choose another." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-not-empty>
@@ -99,7 +99,7 @@ under the License.
<set field="partyRoleContext.roleTypeId" from-field="parameters.roleTypeId" />
<!-- Create the Postal Address -->
<if-compare field-name="USE_ADDRESS" map-name="parameters" operator="equals" value="false">
<if-compare field="parameters.USE_ADDRESS" operator="equals" value="false">
<!-- address not used, do nothing -->
<else>
<call-map-processor in-map-name="parameters" out-map-name="addressContext">
@@ -120,14 +120,14 @@ under the License.
<process field="CUSTOMER_ADDRESS_ALLOW_SOL"><copy to-field="allowSolicitation"/></process>
</simple-map-processor>
</call-map-processor>
<if-compare value="USA" operator="equals" field-name="CUSTOMER_COUNTRY" map-name="parameters">
<if-empty field-name="CUSTOMER_STATE" map-name="parameters">
<if-compare value="USA" operator="equals" field="parameters.CUSTOMER_COUNTRY">
<if-empty field="parameters.CUSTOMER_STATE">
<set field="tempErrorMessage" value="State is missing, and is required for an address in the United States." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-empty>
</if-compare>
<if-compare value="CAN" operator="equals" field-name="CUSTOMER_COUNTRY" map-name="parameters">
<if-empty field-name="CUSTOMER_STATE" map-name="parameters">
<if-compare value="CAN" operator="equals" field="parameters.CUSTOMER_COUNTRY">
<if-empty field="parameters.CUSTOMER_STATE">
<set field="tempErrorMessage" value="State is missing, and is required for an address in Canada." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-empty>
@@ -136,7 +136,7 @@ under the License.
</if-compare>
<!-- Create the Home Phone -->
<if-not-empty field-name="CUSTOMER_HOME_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_HOME_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="homePhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -150,7 +150,7 @@ under the License.
</if-not-empty>
<!-- Create the Work Phone -->
<if-not-empty field-name="CUSTOMER_WORK_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_WORK_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="workPhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -164,7 +164,7 @@ under the License.
</if-not-empty>
<!-- Create the Fax Phone -->
<if-not-empty field-name="CUSTOMER_FAX_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_FAX_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="faxPhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -178,7 +178,7 @@ under the License.
</if-not-empty>
<!-- Create the Mobile Phone -->
<if-not-empty field-name="CUSTOMER_MOBILE_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_MOBILE_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="mobilePhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -192,10 +192,10 @@ under the License.
</if-not-empty>
<!-- Check for required Phone -->
<if-compare field-name="require_phone" operator="equals" value="true">
<if-empty field-name="CUSTOMER_HOME_CONTACT" map-name="parameters">
<if-empty field-name="CUSTOMER_WORK_CONTACT" map-name="parameters">
<if-empty field-name="CUSTOMER_MOBILE_CONTACT" map-name="parameters">
<if-compare field="require_phone" operator="equals" value="true">
<if-empty field="parameters.CUSTOMER_HOME_CONTACT">
<if-empty field="parameters.CUSTOMER_WORK_CONTACT">
<if-empty field="parameters.CUSTOMER_MOBILE_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="dummymap">
<simple-map-processor name="checkRequiredPhone">
<process field="REQUIRED_PHONE">
@@ -218,8 +218,8 @@ under the License.
</call-map-processor>
<!-- Check for required E-Mail -->
<if-compare field-name="require_email" operator="equals" value="true">
<if-empty field-name="emailAddress" map-name="emailContext">
<if-compare field="require_email" operator="equals" value="true">
<if-empty field="emailContext.emailAddress">
<call-map-processor in-map-name="emailContext" out-map-name="dummymap">
<simple-map-processor name="checkRequiredEmail">
<process field="emailAddress">
@@ -228,7 +228,7 @@ under the License.
</simple-map-processor>
</call-map-processor>
</if-empty>
<if-not-empty field-name="emailAddress" map-name="emailContext">
<if-not-empty field="emailContext.emailAddress">
<call-map-processor in-map-name="emailContext" out-map-name="dummymap">
<simple-map-processor name="checkRequiredEmailFormat">
<process field="emailAddress">
@@ -280,7 +280,7 @@ under the License.
<call-service service-name="createPartyRole" in-map-name="partyRoleContext"/>
<!-- shipping address -->
<if-compare field-name="USE_ADDRESS" map-name="parameters" operator="equals" value="false">
<if-compare field="parameters.USE_ADDRESS" operator="equals" value="false">
<!-- address not used, do nothing -->
<else>
<call-service service-name="createPartyPostalAddress" in-map-name="addressContext">
@@ -297,7 +297,7 @@ under the License.
</if-compare>
<!-- home phone -->
<if-not-empty field-name="CUSTOMER_HOME_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_HOME_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="homePhoneContext">
<result-to-field result-name="contactMechId" map-name="homePhonePurposeContext"/>
</call-service>
@@ -307,7 +307,7 @@ under the License.
</if-not-empty>
<!-- work phone -->
<if-not-empty field-name="CUSTOMER_WORK_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_WORK_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="workPhoneContext">
<result-to-field result-name="contactMechId" map-name="workPhonePurposeContext"/>
</call-service>
@@ -317,7 +317,7 @@ under the License.
</if-not-empty>
<!-- fax phone -->
<if-not-empty field-name="CUSTOMER_FAX_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_FAX_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="faxPhoneContext">
<result-to-field result-name="contactMechId" map-name="faxPhonePurposeContext"/>
</call-service>
@@ -327,7 +327,7 @@ under the License.
</if-not-empty>
<!-- mobile phone -->
<if-not-empty field-name="CUSTOMER_MOBILE_CONTACT" map-name="parameters">
<if-not-empty field="parameters.CUSTOMER_MOBILE_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="mobilePhoneContext">
<result-to-field result-name="contactMechId" map-name="mobilePhonePurposeContext"/>
</call-service>
@@ -26,7 +26,7 @@ under the License.
<make-value entity-name="PartyInvitation" value-name="newEntity"/>
<sequenced-id-to-env sequence-name="PartyInvitation" env-name="newEntity.partyInvitationId"/>
<field-to-result field-name="newEntity.partyInvitationId" result-name="partyInvitationId"/>
<if-not-empty field-name="parameters.partyId">
<if-not-empty field="parameters.partyId">
<entity-one entity-name="Person" value-name="person" auto-field-map="false">
<field-map field-name="partyId" env-name="parameters.partyId"/>
</entity-one>
@@ -39,7 +39,7 @@ under the License.
</simple-method>
<simple-method method-name="updatePartyInvitation" short-description="Update a PartyInvitation">
<entity-one entity-name="PartyInvitation" value-name="lookedUpValue"/>
<if-not-empty field-name="parameters.partyId">
<if-not-empty field="parameters.partyId">
<entity-one entity-name="Person" value-name="person" auto-field-map="false">
<field-map field-name="partyId" env-name="parameters.partyId"/>
</entity-one>
@@ -74,7 +74,7 @@ under the License.
<entity-and entity-name="PartyInvitationGroupAssoc" list-name="partyInvitationGroupAssocs">
<field-map field-name="partyInvitationId" env-name="parameters.partyInvitationId"/>
</entity-and>
<if-not-empty field-name="partyInvitationGroupAssocs">
<if-not-empty field="partyInvitationGroupAssocs">
<set field="createPartyRelationshipCtx.partyIdTo" from-field="parameters.partyId"/>
<set field="createPartyRelationshipCtx.partyRelationshipTypeId" value="GROUP_ROLLUP"/>
<iterate list-name="partyInvitationGroupAssocs" entry-name="partyInvitationGroupAssoc">
@@ -85,7 +85,7 @@ under the License.
<entity-and entity-name="PartyInvitationRoleAssoc" list-name="partyInvitationRoleAssocs">
<field-map field-name="partyInvitationId" env-name="parameters.partyInvitationId"/>
</entity-and>
<if-not-empty field-name="partyInvitationRoleAssocs">
<if-not-empty field="partyInvitationRoleAssocs">
<set field="createPartyRoleCtx.partyId" from-field="parameters.partyId"/>
<iterate list-name="partyInvitationRoleAssocs" entry-name="partyInvitationRoleAssoc">
<set field="createPartyRoleCtx.roleTypeId" from-field="partyInvitationRoleAssoc.roleTypeId"/>
@@ -31,15 +31,15 @@ under the License.
<!-- Returns hasPermission=true if userLogin partyId equals partyId parameter -->
<simple-method method-name="partyIdPermissionCheck" short-description="Party ID Permission Check">
<if-empty field-name="partyId">
<if-empty field="partyId">
<set field="partyId" from-field="parameters.partyId"/>
</if-empty>
<if>
<condition>
<and>
<not><if-empty field-name="partyId"/></not>
<not><if-empty field-name="userLogin.partyId"/></not>
<if-compare-field field-name="partyId" operator="equals" to-field-name="userLogin.partyId"/>
<not><if-empty field="partyId"/></not>
<not><if-empty field="userLogin.partyId"/></not>
<if-compare-field field="partyId" to-field="userLogin.partyId" operator="equals"/>
</and>
</condition>
<then>
@@ -47,7 +47,7 @@ under the License.
</then>
<else>
<set field="resourceDescription" from-field="parameters.resourceDescription"/>
<if-empty field-name="resourceDescription">
<if-empty field="resourceDescription">
<property-to-field resource="CommonUiLabels" property="CommonPermissionThisOperation" field-name="resourceDescription"/>
</if-empty>
<property-to-field resource="PartyUiLabels" property="PartyPermissionErrorPartyId" field-name="failMessage"/>
@@ -62,7 +62,7 @@ under the License.
user has one of the base PARTYMGR CRUD+ADMIN permissions -->
<simple-method method-name="basePlusPartyIdPermissionCheck" short-description="Base Permission Plus Party ID Permission Check">
<call-simple-method method-name="basePermissionCheck"/>
<if-compare field-name="hasPermission" operator="not-equals" value="true">
<if-compare field="hasPermission" operator="not-equals" value="true">
<call-simple-method method-name="partyIdPermissionCheck"/>
</if-compare>
</simple-method>
@@ -73,13 +73,13 @@ under the License.
user has one of the base PARTYMGR or PARTYMGR_STS CRUD+ADMIN permissions -->
<simple-method method-name="partyStatusPermissionCheck" short-description="Party status permission logic">
<set field="hasPermission" type="Boolean" value="false"/>
<if-not-empty field-name="parameters.partyId">
<if-compare-field field-name="parameters.partyId" operator="equals" to-field-name="userLogin.partyId">
<if-not-empty field="parameters.partyId">
<if-compare-field field="parameters.partyId" to-field="userLogin.partyId" operator="equals">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
</if-compare-field>
</if-not-empty>
<if-compare field-name="hasPermission" operator="not-equals" value="true">
<if-compare field="hasPermission" operator="not-equals" value="true">
<set field="altPermission" value="PARTYMGR_STS"/>
<call-simple-method method-name="basePermissionCheck"/>
</if-compare>
@@ -106,7 +106,7 @@ under the License.
<!-- Returns hasPermission=true if user has one of the base PARTYMGR or PARTYMGR_REL CRUD+ADMIN permissions -->
<simple-method method-name="partyRelationshipPermissionCheck" short-description="Party relationship permission logic">
<if-empty field-name="parameters.partyIdFrom">
<if-empty field="parameters.partyIdFrom">
<set field="parameters.partyIdFrom" from-field="userLogin.partyId"/>
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
@@ -120,10 +120,10 @@ under the License.
<!-- Returns hasPermission=true if userLogin partyId equals partyId parameter OR
user has one of the base PARTYMGR or PARTYMGR_PCM CRUD+ADMIN permissions -->
<simple-method method-name="partyContactMechPermissionCheck" short-description="Party contact mech permission logic">
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
<if-compare-field field-name="partyId" map-name="parameters" to-map-name="userLogin" operator="equals">
<if-compare-field to-field="userLogin." field="parameters.partyId" operator="equals">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
@@ -141,10 +141,10 @@ under the License.
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
</if-has-permission>
<if-compare field-name="hasPermission" operator="not-equals" value="true">
<if-compare field="hasPermission" operator="not-equals" value="true">
<entity-one entity-name="PartyInvitation" value-name="partyInvitation"/>
<if-empty field-name="partyInvitation.partyId">
<if-empty field-name="partyInvitation.emailAddress">
<if-empty field="partyInvitation.partyId">
<if-empty field="partyInvitation.emailAddress">
<add-error>
<fail-property property="PartyInvitationNotValidError" resource="PartyUiLabels"/>
</add-error>
@@ -153,8 +153,8 @@ under the License.
<call-service service-name="findPartyFromEmailAddress" in-map-name="findPartyCtx">
<result-to-field result-name="partyId" field-name="partyId"/>
</call-service>
<if-not-empty field-name="partyId">
<if-compare-field field-name="partyId" operator="equals" to-field-name="userLogin.partyId">
<if-not-empty field="partyId">
<if-compare-field field="partyId" to-field="userLogin.partyId" operator="equals">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
</if-compare-field>
@@ -167,7 +167,7 @@ under the License.
</else>
</if-empty>
<else>
<if-compare-field field-name="partyInvitation.partyId" operator="equals" to-field-name="userLogin.partyId">
<if-compare-field field="partyInvitation.partyId" to-field="userLogin.partyId" operator="equals">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
</if-compare-field>
@@ -175,7 +175,7 @@ under the License.
</if-empty>
<check-errors/>
</if-compare>
<if-compare field-name="hasPermission" operator="not-equals" value="true">
<if-compare field="hasPermission" operator="not-equals" value="true">
<property-to-field property="PartyInvitationAccAndDecPermissionError" field-name="failMessage" resource="PartyUiLabels"/>
<field-to-result field-name="hasPermission"/>
<field-to-result field-name="failMessage"/>
@@ -187,17 +187,17 @@ under the License.
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
</if-has-permission>
<if-compare field-name="hasPermission" operator="not-equals" value="true">
<if-compare field="hasPermission" operator="not-equals" value="true">
<entity-one entity-name="PartyInvitation" value-name="partyInvitation"/>
<if-not-empty field-name="partyInvitation.partyIdFrom">
<if-compare-field field-name="partyInvitation.partyIdFrom" operator="equals" to-field-name="userLogin.partyId">
<if-not-empty field="partyInvitation.partyIdFrom">
<if-compare-field field="partyInvitation.partyIdFrom" to-field="userLogin.partyId" operator="equals">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
</if-compare-field>
</if-not-empty>
<if-compare field-name="hasPermission" operator="not-equals" value="true">
<if-empty field-name="partyInvitation.partyId">
<if-empty field-name="partyInvitation.emailAddress">
<if-compare field="hasPermission" operator="not-equals" value="true">
<if-empty field="partyInvitation.partyId">
<if-empty field="partyInvitation.emailAddress">
<add-error>
<fail-property property="PartyInvitationNotValidError" resource="PartyUiLabels"/>
</add-error>
@@ -206,8 +206,8 @@ under the License.
<call-service service-name="findPartyFromEmailAddress" in-map-name="findPartyCtx">
<result-to-field result-name="partyId" field-name="partyId"/>
</call-service>
<if-not-empty field-name="partyId">
<if-compare-field field-name="partyId" operator="equals" to-field-name="userLogin.partyId">
<if-not-empty field="partyId">
<if-compare-field field="partyId" to-field="userLogin.partyId" operator="equals">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
</if-compare-field>
@@ -220,7 +220,7 @@ under the License.
</else>
</if-empty>
<else>
<if-compare-field field-name="partyInvitation.partyId" operator="equals" to-field-name="userLogin.partyId">
<if-compare-field field="partyInvitation.partyId" to-field="userLogin.partyId" operator="equals">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
</if-compare-field>
@@ -229,7 +229,7 @@ under the License.
<check-errors/>
</if-compare>
</if-compare>
<if-compare field-name="hasPermission" operator="not-equals" value="true">
<if-compare field="hasPermission" operator="not-equals" value="true">
<property-to-field property="PartyInvitationCancelPermissionError" field-name="failMessage" resource="PartyUiLabels"/>
<field-to-result field-name="hasPermission"/>
<field-to-result field-name="failMessage"/>
@@ -242,8 +242,8 @@ under the License.
<if>
<condition>
<and>
<if-compare-field field-name="parameters.partyIdFrom" operator="not-equals" to-field-name="userLogin.partyId"/>
<if-compare-field field-name="parameters.partyIdTo" operator="not-equals" to-field-name="userLogin.partyId"/>
<if-compare-field field="parameters.partyIdFrom" to-field="userLogin.partyId" operator="not-equals"/>
<if-compare-field field="parameters.partyIdTo" to-field="userLogin.partyId" operator="not-equals"/>
</and>
</condition>
<then>
@@ -27,7 +27,7 @@ under the License.
<make-value value-name="partyRolePK" entity-name="PartyRole"/>
<set-pk-fields value-name="partyRolePK" map-name="parameters"/>
<find-by-primary-key entity-name="PartyRole" map-name="partyRolePK" value-name="partyRole"/>
<if-empty field-name="partyRole">
<if-empty field="partyRole">
<make-value entity-name="PartyRole" map-name="partyRolePK" value-name="partyRole"/>
<create-value value-name="partyRole"/>
</if-empty>
@@ -42,7 +42,7 @@ under the License.
<simple-method method-name="savePartyNameChange" short-description="Save Party Name Change">
<!-- for special case in ecommerce, if no partyId is passed in use userLogin.partyId -->
<if-empty field-name="parameters.partyId">
<if-empty field="parameters.partyId">
<set field="parameters.partyId" from-field="userLogin.partyId"/>
</if-empty>
@@ -51,11 +51,11 @@ under the License.
<now-timestamp-to-env env-name="partyNameHistory.changeDate"/>
<if>
<condition><not><if-empty field-name="parameters.groupName"/></not></condition>
<condition><not><if-empty field="parameters.groupName"/></not></condition>
<then>
<entity-one entity-name="PartyGroup" value-name="partyGroup"/>
<if>
<condition><if-compare-field field-name="partyGroup.groupName" operator="not-equals" to-field-name="parameters.groupName"/></condition>
<condition><if-compare-field field="partyGroup.groupName" to-field="parameters.groupName" operator="not-equals"/></condition>
<then>
<set-nonpk-fields value-name="partyNameHistory" map-name="partyGroup"/>
<create-value value-name="partyNameHistory"/>
@@ -65,11 +65,11 @@ under the License.
<else-if>
<condition>
<or>
<not><if-empty field-name="parameters.firstName"></if-empty></not>
<not><if-empty field-name="parameters.middleName"></if-empty></not>
<not><if-empty field-name="parameters.lastName"></if-empty></not>
<not><if-empty field-name="parameters.personalTitle"></if-empty></not>
<not><if-empty field-name="parameters.suffix"></if-empty></not>
<not><if-empty field="parameters.firstName"></if-empty></not>
<not><if-empty field="parameters.middleName"></if-empty></not>
<not><if-empty field="parameters.lastName"></if-empty></not>
<not><if-empty field="parameters.personalTitle"></if-empty></not>
<not><if-empty field="parameters.suffix"></if-empty></not>
</or>
</condition>
<then>
@@ -77,11 +77,11 @@ under the License.
<if>
<condition>
<or>
<if-compare-field field-name="person.firstName" operator="not-equals" to-field-name="parameters.firstName"/>
<if-compare-field field-name="person.middleName" operator="not-equals" to-field-name="parameters.middleName"/>
<if-compare-field field-name="person.lastName" operator="not-equals" to-field-name="parameters.lastName"/>
<if-compare-field field-name="person.personalTitle" operator="not-equals" to-field-name="parameters.personalTitle"/>
<if-compare-field field-name="person.suffix" operator="not-equals" to-field-name="parameters.suffix"/>
<if-compare-field field="person.firstName" to-field="parameters.firstName" operator="not-equals"/>
<if-compare-field field="person.middleName" to-field="parameters.middleName" operator="not-equals"/>
<if-compare-field field="person.lastName" to-field="parameters.lastName" operator="not-equals"/>
<if-compare-field field="person.personalTitle" to-field="parameters.personalTitle" operator="not-equals"/>
<if-compare-field field="person.suffix" to-field="parameters.suffix" operator="not-equals"/>
</or>
</condition>
<then>
@@ -101,33 +101,33 @@ under the License.
</entity-and>
<entity-one entity-name="Person" value-name="person"/>
<entity-one entity-name="PartyGroup" value-name="partyGroup"/>
<if-empty field-name="parameters.compareDate">
<if-empty field="parameters.compareDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="parameters.compareDate" from-field="nowTimestamp"/>
</if-empty>
<!-- go through the list which is sorted by most recent first and find the oldest (last) one with the changeDate greater than the compareDate -->
<iterate entry-name="partyNameHistory" list-name="partyNameHistoryList">
<if-compare-field field-name="partyNameHistory.changeDate" operator="greater" to-field-name="parameters.compareDate">
<if-compare-field field="partyNameHistory.changeDate" to-field="parameters.compareDate" operator="greater">
<set field="partyNameHistoryCurrent" from-field="partyNameHistory"/>
</if-compare-field>
</iterate>
<if-empty field-name="partyNameHistoryCurrent">
<if-not-empty field-name="person">
<if-empty field="partyNameHistoryCurrent">
<if-not-empty field="person">
<field-to-result field-name="person.firstName" result-name="firstName"/>
<if-not-empty field-name="person.middleName">
<if-not-empty field="person.middleName">
<field-to-result field-name="person.middleName" result-name="middleName"/>
</if-not-empty>
<field-to-result field-name="person.lastName" result-name="lastName"/>
<if-not-empty field-name="person.personalTitle">
<if-not-empty field="person.personalTitle">
<field-to-result field-name="person.personalTitle" result-name="personalTitle"/>
</if-not-empty>
<if-not-empty field-name="person.suffix">
<if-not-empty field="person.suffix">
<field-to-result field-name="person.suffix" result-name="suffix"/>
</if-not-empty>
<if-compare field-name="parameters.lastNameFirst" operator="equals" value="Y">
<if-compare field="parameters.lastNameFirst" operator="equals" value="Y">
<set field="fullName" value="${person.personalTitle} ${person.lastName}, ${person.firstName} ${person.middleName} ${person.suffix}"/>
<else>
<set field="fullName" value="${person.personalTitle} ${person.firstName} ${person.middleName} ${person.lastName} ${person.suffix}"/>
@@ -136,7 +136,7 @@ under the License.
<field-to-result field-name="fullName"/>
<else>
<if-not-empty field-name="partyGroup">
<if-not-empty field="partyGroup">
<field-to-result field-name="partyGroup.groupName" result-name="groupName"/>
<field-to-result field-name="partyGroup.groupName" result-name="fullName"/>
</if-not-empty>
@@ -144,21 +144,21 @@ under the License.
</if-not-empty>
<else>
<!-- partyNameHistoryCurrent has a value -->
<if-not-empty field-name="person">
<if-not-empty field="person">
<field-to-result field-name="partyNameHistoryCurrent.firstName" result-name="firstName"/>
<if-not-empty field-name="partyNameHistoryCurrent.middleName">
<if-not-empty field="partyNameHistoryCurrent.middleName">
<field-to-result field-name="partyNameHistoryCurrent.middleName" result-name="middleName"/>
</if-not-empty>
<field-to-result field-name="partyNameHistoryCurrent.lastName" result-name="lastName"/>
<if-not-empty field-name="partyNameHistoryCurrent.personalTitle">
<if-not-empty field="partyNameHistoryCurrent.personalTitle">
<field-to-result field-name="partyNameHistoryCurrent.personalTitle" result-name="personalTitle"/>
</if-not-empty>
<if-not-empty field-name="partyNameHistoryCurrent.suffix">
<if-not-empty field="partyNameHistoryCurrent.suffix">
<field-to-result field-name="partyNameHistoryCurrent.suffix" result-name="suffix"/>
</if-not-empty>
<if-compare field-name="parameters.lastNameFirst" operator="equals" value="Y">
<if-compare field="parameters.lastNameFirst" operator="equals" value="Y">
<set field="fullName" value="${partyNameHistoryCurrent.personalTitle} ${partyNameHistoryCurrent.lastName}, ${partyNameHistoryCurrent.firstName} ${partyNameHistoryCurrent.middleName} ${partyNameHistoryCurrent.suffix}"/>
<else>
<set field="fullName" value="${partyNameHistoryCurrent.personalTitle} ${partyNameHistoryCurrent.firstName} ${partyNameHistoryCurrent.middleName} ${partyNameHistoryCurrent.lastName} ${partyNameHistoryCurrent.suffix}"/>
@@ -167,7 +167,7 @@ under the License.
<field-to-result field-name="fullName"/>
<else>
<if-not-empty field-name="partyGroup">
<if-not-empty field="partyGroup">
<field-to-result field-name="partyNameHistoryCurrent.groupName" result-name="groupName"/>
<field-to-result field-name="partyNameHistoryCurrent.groupName" result-name="fullName"/>
</if-not-empty>
@@ -203,7 +203,7 @@ under the License.
<make-value entity-name="PartyClassification" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<create-value value-name="newEntity"/>
</simple-method>
<simple-method method-name="updatePartyClassification" short-description="update a PartyClassification">
@@ -271,13 +271,13 @@ under the License.
<!-- party profile default -->
<simple-method method-name="setPartyProfileDefaults" short-description="Sets Party Profile Defaults">
<if-empty map-name="parameters" field-name="partyId">
<if-empty field="parameters.partyId">
<set from-field="userLogin.partyId" field="parameters.partyId"/>
</if-empty>
<!-- lookup existing value -->
<entity-one entity-name="PartyProfileDefault" value-name="partyProfileDefault"/>
<if-empty field-name="partyProfileDefault">
<if-empty field="partyProfileDefault">
<make-value value-name="partyProfileDefault" entity-name="PartyProfileDefault"/>
<set-pk-fields value-name="partyProfileDefault" map-name="parameters"/>
<create-value value-name="partyProfileDefault"/>
@@ -292,25 +292,25 @@ under the License.
<!-- TODO: this method will be deleted in favor of new content methods and the PartyContentServices.xml -->
<simple-method method-name="createPartyContent" short-description="Creates Party Associated Content" login-required="false">
<!-- make sure we are logged in when passing a partyId -->
<if-not-empty field-name="partyId" map-name="parameters">
<if-empty field-name="userLogin" map-name="parameters">
<if-not-empty field="parameters.partyId">
<if-empty field="parameters.userLogin">
<add-error><fail-property resource="PartyUiLabels" property="PartyPermissionErrorForThisParty"/></add-error>
<check-errors/>
</if-empty>
</if-not-empty>
<!-- check permission when creating content on behalf of another party -->
<if-empty field-name="partyId" map-name="parameters">
<if-not-empty field-name="userLogin" map-name="parameters">
<if-empty field="parameters.partyId">
<if-not-empty field="parameters.userLogin">
<set from-field="userLogin.partyId" field="parameters.partyId"/>
<if-compare-field field-name="partyId" map-name="parameters" to-map-name="userLogin" operator="not-equals">
<if-compare-field to-field="userLogin." field="parameters.partyId" operator="not-equals">
<check-permission permission="PARTYMGR" action="_UPDATE">
<fail-property resource="PartyUiLabels" property="PartyPermissionErrorForThisParty"/>
</check-permission>
</if-compare-field>
</if-not-empty>
</if-empty>
<if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">
<if-not-empty field="parameters._uploadedFile_fileName">
<call-class-method class-name="org.ofbiz.content.data.DataResourceWorker" method-name="getDataResourceContentUploadPath" ret-field-name="uploadPath"/>
<log level="always" message="[createPartyContent] - Found Subdir : ${uploadPath}"/>
<!-- locate the file extension to use based on mime-type -->
@@ -334,14 +334,14 @@ under the License.
</if-not-empty>
<set-service-fields service-name="createContent" map-name="parameters" to-map-name="createContentMap"/>
<if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">
<if-not-empty field="parameters._uploadedFile_fileName">
<set from-field="dataResourceId" field="createContentMap.dataResourceId"/>
</if-not-empty>
<call-service service-name="createContent" in-map-name="createContentMap" break-on-error="false">
<result-to-field result-name="contentId" field-name="contentId"/>
</call-service>
<!-- create the content role -->
<if-not-empty field-name="partyId" map-name="parameters">
<if-not-empty field="parameters.partyId">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set-service-fields service-name="createContentRole" map-name="parameters" to-map-name="contentRole"/>
<set from-field="contentId" field="contentRole.contentId"/>
@@ -353,12 +353,12 @@ under the License.
<make-value value-name="partyRole" entity-name="PartyRole"/>
<set-pk-fields value-name="partyRole" map-name="contentRole"/>
<find-by-and entity-name="PartyRole" map-name="partyRole" list-name="pRoles"/>
<if-empty field-name="pRoles">
<if-empty field="pRoles">
<set-service-fields service-name="createPartyRole" map-name="contentRole" to-map-name="partyRole"/>
<call-service service-name="createPartyRole" in-map-name="partyRole" break-on-error="false" />
</if-empty>
</if-not-empty>
<if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">
<if-not-empty field="parameters._uploadedFile_fileName">
<!-- store the file -->
<set-service-fields service-name="createAnonFile" map-name="dataResourceMap" to-map-name="fileCtx"/>
<set from-field="parameters.uploadedFile" field="fileCtx.binData"/>
@@ -372,18 +372,18 @@ under the License.
<!-- TODO: this method will be deleted in favor of new content methods and the PartyContentServices.xml -->
<simple-method method-name="updatePartyContent" short-description="Creates Party Associated Content" login-required="false">
<!-- make sure we are logged in when passing a partyId -->
<if-not-empty field-name="partyId" map-name="parameters">
<if-empty field-name="userLogin" map-name="parameters">
<if-not-empty field="parameters.partyId">
<if-empty field="parameters.userLogin">
<add-error><fail-property resource="PartyUiLabels" property="PartyPermissionErrorForThisParty"/></add-error>
<check-errors/>
</if-empty>
</if-not-empty>
<!-- check permission when creating content on behalf of another party -->
<if-empty field-name="partyId" map-name="parameters">
<if-not-empty field-name="userLogin" map-name="parameters">
<if-empty field="parameters.partyId">
<if-not-empty field="parameters.userLogin">
<set from-field="userLogin.partyId" field="parameters.partyId"/>
<if-compare-field field-name="partyId" map-name="parameters" to-map-name="userLogin" operator="not-equals">
<if-compare-field to-field="userLogin." field="parameters.partyId" operator="not-equals">
<check-permission permission="PARTYMGR" action="_UPDATE">
<fail-property resource="PartyUiLabels" property="PartyPermissionErrorForThisParty"/>
</check-permission>
@@ -391,10 +391,10 @@ under the License.
</if-not-empty>
</if-empty>
<if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">
<if-not-empty field="parameters._uploadedFile_fileName">
<set from-field="parameters.contentId" field="lookupParam.contentId"/>
<find-by-primary-key use-cache="true" entity-name="Content" value-name="content" map-name="lookupParam"/>
<if-not-empty field-name="dataResourceId" map-name="content">
<if-not-empty field="content.dataResourceId">
<set-service-fields service-name="updateDataResource" map-name="parameters" to-map-name="dataResource"/>
<set from-field="content.dataResourceId" field="dataResource.dataResourceId"/>
<call-service service-name="updateDataResource" in-map-name="dataResource" break-on-error="false" />
@@ -417,7 +417,7 @@ under the License.
<result-to-field result-name="dataResourceId" field-name="dataResourceId"/>
</call-service>
<set value="${uploadPath}/${dataResourceId}" field="dataResource.objectInfo"/>
<if-not-empty field-name="extension">
<if-not-empty field="extension">
<set value="${uploadPath}/${dataResourceId}.${extension.fileExtensionId}" field="dataResource.objectInfo"/>
</if-not-empty>
<set-service-fields service-name="updateDataResource" map-name="dataResource" to-map-name="dataResource"/>
@@ -429,11 +429,11 @@ under the License.
</if-not-empty>
</if-not-empty>
<set-service-fields service-name="updateContent" map-name="parameters" to-map-name="updateContentMap"/>
<if-not-empty field-name="dataResourceId">
<if-not-empty field="dataResourceId">
<set from-field="dataResourceId" field="updateContentMap.dataResourceId" />
</if-not-empty>
<call-service service-name="updateContent" in-map-name="updateContentMap" break-on-error="false" />
<if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">
<if-not-empty field="parameters._uploadedFile_fileName">
<set-service-fields service-name="createAnonFile" map-name="dataResourceMap" to-map-name="fileCtx"/>
<set from-field="parameters.uploadedFile" field="fileCtx.binData"/>
<set from-field="dataResourceMap" field="fileCtx.dataResource"/>
@@ -458,7 +458,7 @@ under the License.
<get-related-one value-name="partyRelationship" relation-name="ToParty" to-value-name="party"/>
<field-to-list field-name="party" list-name="parties"/>
</iterate>
<if-not-empty field-name="parties">
<if-not-empty field="parties">
<field-to-result field-name="parties"/>
</if-not-empty>
</simple-method>
@@ -466,7 +466,7 @@ under the License.
<simple-method method-name="getParentOrganizations" short-description="Gets Parent Organizations for an Organization Party">
<set from-field="parameters.organizationPartyId" field="relatedPartyIdList[]"/>
<set from-field="parameters.getParentsOfParents" field="recurse"/>
<if-empty field-name="recurse"><set value="Y" field="recurse"/></if-empty>
<if-empty field="recurse"><set value="Y" field="recurse"/></if-empty>
<set value="GROUP_ROLLUP" field="partyRelationshipTypeId"/>
<set value="ORGANIZATION_UNIT" field="roleTypeIdFrom"/>
@@ -510,19 +510,19 @@ under the License.
- useCache (should be "true" or "false")
-->
<if-empty field-name="nowTimestamp"><now-timestamp-to-env env-name="nowTimestamp"/></if-empty>
<if-empty field="nowTimestamp"><now-timestamp-to-env env-name="nowTimestamp"/></if-empty>
<!-- only create these if they don't already exist, more efficient and avoids potential problems in recursed calls -->
<if-empty field-name="_inline_roleTypeIdFromList">
<if-empty field="_inline_roleTypeIdFromList">
<field-to-list field-name="roleTypeIdFrom" list-name="_inline_roleTypeIdFromList"/>
<if-compare field-name="roleTypeIdFromInclueAllChildTypes" operator="equals" value="Y">
<if-compare field="roleTypeIdFromInclueAllChildTypes" operator="equals" value="Y">
<set value="_inline_roleTypeIdFromList" field="roleTypeIdListName"/>
<call-simple-method method-name="getChildRoleTypesInline"/>
</if-compare>
</if-empty>
<if-empty field-name="_inline_roleTypeIdToList">
<if-empty field="_inline_roleTypeIdToList">
<field-to-list field-name="roleTypeIdTo" list-name="_inline_roleTypeIdToList"/>
<if-compare field-name="roleTypeIdToInclueAllChildTypes" operator="equals" value="Y">
<if-compare field="roleTypeIdToInclueAllChildTypes" operator="equals" value="Y">
<set value="_inline_roleTypeIdToList" field="roleTypeIdListName"/>
<call-simple-method method-name="getChildRoleTypesInline"/>
</if-compare>
@@ -535,7 +535,7 @@ under the License.
<iterate entry-name="relatedPartyId" list-name="relatedPartyIdList">
<if>
<condition><not><if-compare-field field-name="_inline_relatedPartyIdAlreadySearchedList" operator="contains" to-field-name="relatedPartyId"/></not></condition>
<condition><not><if-compare-field field="_inline_relatedPartyIdAlreadySearchedList" to-field="relatedPartyId" operator="contains"/></not></condition>
<then>
<field-to-list field-name="relatedPartyId" list-name="_inline_relatedPartyIdAlreadySearchedList"/>
@@ -561,8 +561,8 @@ under the License.
<if>
<condition>
<and>
<not><if-compare-field field-name="relatedPartyIdList" operator="contains" to-field-name="_inline_PartyRelationship.partyIdTo"/></not>
<not><if-compare-field field-name="_inline_NewRelatedPartyIdList" operator="contains" to-field-name="_inline_PartyRelationship.partyIdTo"/></not>
<not><if-compare-field field="relatedPartyIdList" to-field="_inline_PartyRelationship.partyIdTo" operator="contains"/></not>
<not><if-compare-field field="_inline_NewRelatedPartyIdList" to-field="_inline_PartyRelationship.partyIdTo" operator="contains"/></not>
</and>
</condition>
<then>
@@ -571,7 +571,7 @@ under the License.
</if>
</iterate>
<if-compare field-name="includeFromToSwitched" operator="equals" value="Y">
<if-compare field="includeFromToSwitched" operator="equals" value="Y">
<clear-field field-name="_inline_PartyRelationshipList"/>
<entity-condition entity-name="PartyRelationship" list-name="_inline_PartyRelationshipList" use-cache="${useCache}">
<condition-list combine="and">
@@ -594,8 +594,8 @@ under the License.
<if>
<condition>
<and>
<not><if-compare-field field-name="relatedPartyIdList" operator="contains" to-field-name="_inline_PartyRelationship.partyIdFrom"/></not>
<not><if-compare-field field-name="_inline_NewRelatedPartyIdList" operator="contains" to-field-name="_inline_PartyRelationship.partyIdFrom"/></not>
<not><if-compare-field field="relatedPartyIdList" to-field="_inline_PartyRelationship.partyIdFrom" operator="contains"/></not>
<not><if-compare-field field="_inline_NewRelatedPartyIdList" to-field="_inline_PartyRelationship.partyIdFrom" operator="contains"/></not>
</and>
</condition>
<then>
@@ -609,9 +609,9 @@ under the License.
</iterate>
<!-- if we found new ones, add them to the master list and if recurse=Y then recurse -->
<if-not-empty field-name="_inline_NewRelatedPartyIdList">
<if-not-empty field="_inline_NewRelatedPartyIdList">
<list-to-list list-name="_inline_NewRelatedPartyIdList" to-list-name="relatedPartyIdList"/>
<if-compare field-name="recurse" operator="equals" value="Y">
<if-compare field="recurse" operator="equals" value="Y">
<log level="verbose" message="Recursively calling followPartyRelationshipsInlineRecurse _inline_NewRelatedPartyIdList=${_inline_NewRelatedPartyIdList}"/>
<call-simple-method method-name="followPartyRelationshipsInlineRecurse"/>
</if-compare>
@@ -629,7 +629,7 @@ under the License.
<iterate entry-name="roleTypeId" list-name="${roleTypeIdListName}">
<if>
<condition><not><if-compare-field field-name="_inline_roleTypeIdAlreadySearchedList" operator="contains" to-field-name="roleTypeId"/></not></condition>
<condition><not><if-compare-field field="_inline_roleTypeIdAlreadySearchedList" to-field="roleTypeId" operator="contains"/></not></condition>
<then>
<field-to-list field-name="roleTypeId" list-name="_inline_roleTypeIdAlreadySearchedList"/>
@@ -641,8 +641,8 @@ under the License.
<if>
<condition>
<and>
<not><if-compare-field field-name="${roleTypeIdListName}" operator="contains" to-field-name="newRoleType.roleTypeId"/></not>
<not><if-compare-field field-name="_inline_NewRoleTypeIdList" operator="contains" to-field-name="newRoleType.roleTypeId"/></not>
<not><if-compare-field field="${roleTypeIdListName}" to-field="newRoleType.roleTypeId" operator="contains"/></not>
<not><if-compare-field field="_inline_NewRoleTypeIdList" to-field="newRoleType.roleTypeId" operator="contains"/></not>
</and>
</condition>
<then>
@@ -655,7 +655,7 @@ under the License.
</iterate>
<!-- if we found some new types, add them to the main list -->
<if-not-empty field-name="_inline_NewRoleTypeIdList">
<if-not-empty field="_inline_NewRoleTypeIdList">
<list-to-list list-name="_inline_NewRoleTypeIdList" to-list-name="${roleTypeIdListName}"/>
<log level="verbose" message="Recursively calling getChildRoleTypesInline roleTypeIdListName=${roleTypeIdListName}, _inline_NewRoleTypeIdList=${_inline_NewRoleTypeIdList}"/>
<call-simple-method method-name="getChildRoleTypesInline"/>
@@ -666,7 +666,7 @@ under the License.
<set field="findMap.partyId" from-field="parameters.partyId"/>
<set field="findMap.contactMechTypeId" value="EMAIL_ADDRESS"/>
<find-by-and entity-name="PartyAndContactMech" map-name="findMap" list-name="emailAddressesAll"/>
<if-empty field-name="emailAddressesAll">
<if-empty field="emailAddressesAll">
<set field="findMap.contactMechTypeId" value="ELECTRONIC_ADDRESS"/>
<find-by-and entity-name="PartyAndContactMech" map-name="findMap" list-name="emailAddressesAll"/>
</if-empty>
@@ -678,7 +678,7 @@ under the License.
<simple-method method-name="getPartyTelephone" short-description="Get the telephone number of the party">
<set field="findMap.partyId" from-field="parameters.partyId"/>
<if-empty field-name="parameters.contactMechPurposeTypeId">
<if-empty field="parameters.contactMechPurposeTypeId">
<!-- search in this order if not provided-->
<set field="type" value="PRIMARY_PHONE"/><field-to-list field-name="type" list-name="types"/>
<set field="type" value="PHONE_MOBILE"/><field-to-list field-name="type" list-name="types"/>
@@ -696,22 +696,22 @@ under the License.
<find-by-and entity-name="PartyContactDetailByPurpose" map-name="findMap" list-name="telephoneAll1"></find-by-and>
<filter-list-by-date list-name="telephoneAll1" to-list-name="telephoneAll2" from-field-name="purposeFromDate" thru-field-name="purposeThruDate"/>
<filter-list-by-date list-name="telephoneAll2" to-list-name="telephoneAll3"/>
<if-not-empty field-name="telephoneAll3">
<if-not-empty field="telephoneAll3">
<iterate entry-name="type" list-name="types">
<iterate entry-name="telephone" list-name="telephoneAll3">
<if-empty field-name="found">
<if-compare-field field-name="telephone.contactMechPurposeTypeId" to-field-name="type" operator="equals">
<if-empty field="found">
<if-compare-field field="telephone.contactMechPurposeTypeId" to-field="type" operator="equals">
<set field="found" value="notImportant"/>
<if-not-empty field-name="telephone.countryCode">
<if-not-empty field="telephone.countryCode">
<field-to-result map-name="telephone" field-name="countryCode"/>
</if-not-empty>
<if-not-empty field-name="telephone.areaCode">
<if-not-empty field="telephone.areaCode">
<field-to-result map-name="telephone" field-name="areaCode"/>
</if-not-empty>
<if-not-empty field-name="telephone.contactNumber">
<if-not-empty field="telephone.contactNumber">
<field-to-result map-name="telephone" field-name="contactNumber"/>
</if-not-empty>
<if-not-empty field-name="telephone.extension">
<if-not-empty field="telephone.extension">
<field-to-result map-name="telephone" field-name="extension"/>
</if-not-empty>
<field-to-result map-name="telephone" field-name="contactMechPurposeTypeId"/>
@@ -723,16 +723,16 @@ under the License.
<find-by-and entity-name="PartyAndContactMech" map-name="findMap" list-name="telephoneAll1"/>
<filter-list-by-date list-name="telephoneAll1" to-list-name="telephoneAll2"/>
<first-from-list entry-name="telephone" list-name="telephoneAll2"/>
<if-not-empty field-name="telephone.tnCountryCode">
<if-not-empty field="telephone.tnCountryCode">
<field-to-result map-name="telephone" field-name="tnCountryCode" result-name="countryCode"/>
</if-not-empty>
<if-not-empty field-name="telephone.tnAreaCode">
<if-not-empty field="telephone.tnAreaCode">
<field-to-result map-name="telephone" field-name="tnAreaCode" result-name="areaCode"/>
</if-not-empty>
<if-not-empty field-name="telephone.tnContactNumber">
<if-not-empty field="telephone.tnContactNumber">
<field-to-result map-name="telephone" field-name="tnContactNumber" result-name="contactNumber"/>
</if-not-empty>
<if-not-empty field-name="telephone.extension">
<if-not-empty field="telephone.extension">
<field-to-result map-name="telephone" field-name="extension"/>
</if-not-empty>
</else>
@@ -764,11 +764,11 @@ under the License.
<!-- PartyRelationship services -->
<simple-method method-name="createPartyRelationship" short-description="createPartyRelationship">
<if-empty field-name="parameters.roleTypeIdFrom"><set field="parameters.roleTypeIdFrom" value="_NA_"/></if-empty>
<if-empty field-name="parameters.roleTypeIdTo"><set field="parameters.roleTypeIdTo" value="_NA_"/></if-empty>
<if-empty field-name="parameters.partyIdFrom"><set field="parameters.partyIdFrom" from-field="userLogin.partyId"/></if-empty>
<if-empty field="parameters.roleTypeIdFrom"><set field="parameters.roleTypeIdFrom" value="_NA_"/></if-empty>
<if-empty field="parameters.roleTypeIdTo"><set field="parameters.roleTypeIdTo" value="_NA_"/></if-empty>
<if-empty field="parameters.partyIdFrom"><set field="parameters.partyIdFrom" from-field="userLogin.partyId"/></if-empty>
<if-empty field-name="parameters.fromDate"><now-timestamp-to-env env-name="parameters.fromDate"/></if-empty>
<if-empty field="parameters.fromDate"><now-timestamp-to-env env-name="parameters.fromDate"/></if-empty>
<!-- check if not already exist -->
<entity-and entity-name="PartyRelationship" list-name="partyRels" filter-by-date="true">
@@ -778,7 +778,7 @@ under the License.
<field-map field-name="roleTypeIdTo" env-name="parameters.roleTypeIdTo"/>
</entity-and>
<if-empty field-name="partyRels">
<if-empty field="partyRels">
<make-value value-name="newEntity" entity-name="PartyRelationship"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -786,16 +786,16 @@ under the License.
</if-empty>
</simple-method>
<simple-method method-name="updatePartyRelationship" short-description="updatePartyRelationship">
<if-empty field-name="parameters.roleTypeIdFrom"><set field="parameters.roleTypeIdFrom" value="_NA_"/></if-empty>
<if-empty field-name="parameters.roleTypeIdTo"><set field="parameters.roleTypeIdTo" value="_NA_"/></if-empty>
<if-empty field="parameters.roleTypeIdFrom"><set field="parameters.roleTypeIdFrom" value="_NA_"/></if-empty>
<if-empty field="parameters.roleTypeIdTo"><set field="parameters.roleTypeIdTo" value="_NA_"/></if-empty>
<entity-one entity-name="PartyRelationship" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
</simple-method>
<simple-method method-name="deletePartyRelationship" short-description="deletePartyRelationship">
<if-empty field-name="parameters.roleTypeIdFrom"><set field="parameters.roleTypeIdFrom" value="_NA_"/></if-empty>
<if-empty field-name="parameters.roleTypeIdTo"><set field="parameters.roleTypeIdTo" value="_NA_"/></if-empty>
<if-empty field="parameters.roleTypeIdFrom"><set field="parameters.roleTypeIdFrom" value="_NA_"/></if-empty>
<if-empty field="parameters.roleTypeIdTo"><set field="parameters.roleTypeIdTo" value="_NA_"/></if-empty>
<entity-one entity-name="PartyRelationship" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
@@ -805,7 +805,7 @@ under the License.
<make-value entity-name="PartyCarrierAccount" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
@@ -827,7 +827,7 @@ under the License.
</condition-list>
</entity-condition>
<first-from-list entry-name="storeEmail" list-name="productStoreEmailSettings"/>
<if-not-empty field-name="bodyScreenLocation" map-name="storeEmail">
<if-not-empty field="storeEmail.bodyScreenLocation">
<entity-one entity-name="Person" value-name="person"/>
<set field="bodyParameters.person" from-field="person"/>
<set field="emailParams.bodyParameters" from-field="bodyParameters"/>
@@ -852,8 +852,8 @@ under the License.
</condition-list>
</entity-condition>
<first-from-list entry-name="storeEmail" list-name="productStoreEmailSettings"/>
<if-not-empty field-name="bodyScreenLocation" map-name="storeEmail">
<if-not-empty field-name="parameters.updatedUserLogin.partyId">
<if-not-empty field="storeEmail.bodyScreenLocation">
<if-not-empty field="parameters.updatedUserLogin.partyId">
<set field="partyId" from-field="parameters.updatedUserLogin.partyId"/>
<else>
<set field="partyId" from-field="parameters.partyId"/>
@@ -880,7 +880,7 @@ under the License.
<set field="emailParams.bodyParameters" from-field="bodyParameters"/>
<set field="emailParams.bodyScreenUri" from-field="storeEmail.bodyScreenLocation"/>
<if-not-empty field-name="emailParams.sendTo">
<if-not-empty field="emailParams.sendTo">
<call-service service-name="sendMailFromScreen" in-map-name="emailParams"/>
<else>
<log level="warning" message="Tried to send Update Personal Info Notifcation with no to address; partyId is [${partyId}], subject is: ${emailParams.subject}"/>
@@ -24,11 +24,11 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="PartyIcsAvsOverride"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="PartyIcsAvsOverride" map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-not-empty map-name="lookedUpValue" field-name="partyId">
<if-not-empty field="lookedUpValue.partyId">
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
</if-not-empty>
<if-empty map-name="lookedUpValue" field-name="partyId">
<if-empty field="lookedUpValue.partyId">
<set-nonpk-fields map-name="parameters" value-name="lookupPKMap"/>
<create-value value-name="lookupPKMap"/>
</if-empty>
@@ -38,20 +38,20 @@ under the License.
<make-value value-name="lookupPKMap" entity-name="PartyIcsAvsOverride"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="PartyIcsAvsOverride" map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-not-empty map-name="lookedUpValue" field-name="partyId">
<if-not-empty field="lookedUpValue.partyId">
<remove-value value-name="lookedUpValue"/>
</if-not-empty>
</simple-method>
<simple-method method-name="ensureNaPartyRole" short-description="Ensure Party is in _NA_ or the specified Role" login-required="false">
<!-- must have a partyId, partyIdFrom, or partyIdTo in the parameters map, should be called through different service defs for each one -->
<if-not-empty field-name="parameters.partyId">
<if-not-empty field="parameters.partyId">
<set field="lookupPKMap.partyId" from-field="parameters.partyId"/>
<else>
<if-not-empty field-name="parameters.partyIdFrom">
<if-not-empty field="parameters.partyIdFrom">
<set field="lookupPKMap.partyId" from-field="parameters.partyIdFrom"/>
<else>
<if-not-empty field-name="parameters.partyIdTo">
<if-not-empty field="parameters.partyIdTo">
<set field="lookupPKMap.partyId" from-field="parameters.partyIdTo"/>
</if-not-empty>
</else>
@@ -59,14 +59,14 @@ under the License.
</else>
</if-not-empty>
<if-empty field-name="parameters.roleTypeId">
<if-empty field="parameters.roleTypeId">
<set field="lookupPKMap.roleTypeId" value="_NA_"/>
<else>
<set from-field="parameters.roleTypeId" field="lookupPKMap.roleTypeId"/>
</else>
</if-empty>
<find-by-primary-key entity-name="PartyRole" map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-empty field-name="lookedUpValue">
<if-empty field="lookedUpValue">
<make-value value-name="newValue" entity-name="PartyRole" map-name="lookupPKMap"/>
<create-value value-name="newValue"/>
</if-empty>
@@ -100,12 +100,12 @@ under the License.
<call-map-processor processor-name="postalAddress" in-map-name="parameters" out-map-name="postalAddressContext"
xml-resource="org/ofbiz/party/contact/PartyContactMechMapProcs.xml"/>
<if-not-empty field-name="parameters.contactNumber">
<if-not-empty field="parameters.contactNumber">
<call-map-processor processor-name="telecomNumber" in-map-name="parameters" out-map-name="telecomNumberContext"
xml-resource="org/ofbiz/party/contact/PartyContactMechMapProcs.xml"/>
</if-not-empty>
<if-not-empty field-name="parameters.emailAddress">
<if-not-empty field="parameters.emailAddress">
<call-map-processor in-map-name="parameters" out-map-name="emailAddressContext">
<simple-map-processor name="emailAddress">
<process field="emailAddress">
@@ -121,7 +121,7 @@ under the License.
<result-to-field result-name="partyId" field-name="partyId"/>
</call-service>
<if-not-empty field-name="parameters.roleTypeId">
<if-not-empty field="parameters.roleTypeId">
<set field="createPartyRoleCtx.partyId" from-field="partyId"/>
<set field="createPartyRoleCtx.roleTypeId" from-field="parameters.roleTypeId"/>
<call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/>
@@ -143,12 +143,12 @@ under the License.
<call-map-processor processor-name="postalAddress" in-map-name="parameters" out-map-name="postalAddressContext"
xml-resource="org/ofbiz/party/contact/PartyContactMechMapProcs.xml"/>
<if-not-empty field-name="parameters.contactNumber">
<if-not-empty field="parameters.contactNumber">
<call-map-processor processor-name="telecomNumber" in-map-name="parameters" out-map-name="telecomNumberContext"
xml-resource="org/ofbiz/party/contact/PartyContactMechMapProcs.xml"/>
</if-not-empty>
<if-not-empty field-name="parameters.emailAddress">
<if-not-empty field="parameters.emailAddress">
<call-map-processor in-map-name="parameters" out-map-name="emailAddressContext">
<simple-map-processor name="emailAddress">
<process field="emailAddress">
@@ -165,7 +165,7 @@ under the License.
<result-to-field result-name="partyId" field-name="partyId"/>
</call-service>
<if-not-empty field-name="parameters.roleTypeId">
<if-not-empty field="parameters.roleTypeId">
<set field="createPartyRoleCtx.partyId" from-field="partyId"/>
<set field="createPartyRoleCtx.roleTypeId" from-field="parameters.roleTypeId"/>
<call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/>
@@ -189,27 +189,27 @@ under the License.
<result-to-field result-name="contactMechId" map-name="postalAddressContext"/>
</call-service>
<if-not-empty field-name="postalAddContactMechPurpTypeId">
<if-not-empty field="postalAddContactMechPurpTypeId">
<set-service-fields service-name="createPartyContactMechPurpose" map-name="postalAddressContext" to-map-name="serviceCtx"/>
<set field="serviceCtx.contactMechPurposeTypeId" from-field="postalAddContactMechPurpTypeId"/>
<call-service service-name="createPartyContactMechPurpose" in-map-name="serviceCtx"/>
</if-not-empty>
<!-- phone number -->
<if-not-empty field-name="contactNumber">
<if-not-empty field="contactNumber">
<set field="telecomNumberContext.partyId" from-field="partyId"/>
<set field="telecomNumberContext.contactMechPurposeTypeId" value="PRIMARY_PHONE"/>
<if-not-empty field-name="phoneContactMechPurpTypeId"> <!-- override with purpose present in parameters, if any (This field is not used now, just here for future implementations) -->
<if-not-empty field="phoneContactMechPurpTypeId"> <!-- override with purpose present in parameters, if any (This field is not used now, just here for future implementations) -->
<set field="telecomNumberContext.contactMechPurposeTypeId" from-field="phoneContactMechPurpTypeId"/>
</if-not-empty>
<call-service service-name="createPartyTelecomNumber" in-map-name="telecomNumberContext"/>
</if-not-empty>
<!-- email address -->
<if-not-empty field-name="emailAddress">
<if-not-empty field="emailAddress">
<set field="emailAddressContext.partyId" from-field="partyId"/>
<set field="emailAddressContext.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
<if-not-empty field-name="emailContactMechPurpTypeId"> <!-- override with purpose present in parameters, if any (This field is not used now, just here for future implementations) -->
<if-not-empty field="emailContactMechPurpTypeId"> <!-- override with purpose present in parameters, if any (This field is not used now, just here for future implementations) -->
<set field="emailAddressContext.contactMechPurposeTypeId" from-field="emailContactMechPurpTypeId"/>
</if-not-empty>
<call-service service-name="createPartyEmailAddress" in-map-name="emailAddressContext"/>
@@ -41,10 +41,10 @@ under the License.
</call-service>
<find-by-primary-key entity-name="PartyRoleDetailAndPartyDetail" map-name="searchParams" value-name="partyRoleDetailAndPartyDetail"/>
<if-not-empty field-name="partyRoleDetailAndPartyDetail">
<assert><not><if-empty field-name="partyList"/></not></assert>
<if-not-empty field="partyRoleDetailAndPartyDetail">
<assert><not><if-empty field="partyList"/></not></assert>
<else>
<assert><if-empty field-name="partyList"/></assert>
<assert><if-empty field="partyList"/></assert>
</else>
</if-not-empty>
<check-errors/>
@@ -66,7 +66,7 @@ under the License.
<result-to-field result-name="partyList"/>
</call-service>
<!-- At least one party will always exists in the system in any case -->
<assert><not><if-empty field-name="partyList"/></not></assert>
<assert><not><if-empty field="partyList"/></not></assert>
<check-errors/>
</simple-method>
@@ -105,9 +105,9 @@ under the License.
<log level="info" message="====== contactMechId [${contactMechId}] ======"/>
<entity-one entity-name="ContactMech" value-name="contactMech"/>
<assert>
<not><if-empty field-name="contactMech"/></not>
<if-compare-field field-name="contactMechId" operator="equals" to-field-name="serviceCtx.contactMechId"/>
<if-compare-field field-name="contactMech.infoString" operator="equals" to-field-name="serviceCtx.emailAddress"/>
<not><if-empty field="contactMech"/></not>
<if-compare-field field="contactMechId" to-field="serviceCtx.contactMechId" operator="equals"/>
<if-compare-field field="contactMech.infoString" to-field="serviceCtx.emailAddress" operator="equals"/>
</assert>
<check-errors/>
@@ -122,9 +122,9 @@ under the License.
<field-map field-name="contactMechId" env-name="newContactMechId"/>
</entity-one>
<assert>
<not><if-empty field-name="contactMech"/></not>
<if-compare-field field-name="newContactMechId" operator="not-equals" to-field-name="serviceCtx.contactMechId"/>
<if-compare-field field-name="contactMech.infoString" operator="equals" to-field-name="serviceCtx.emailAddress"/>
<not><if-empty field="contactMech"/></not>
<if-compare-field field="newContactMechId" to-field="serviceCtx.contactMechId" operator="not-equals"/>
<if-compare-field field="contactMech.infoString" to-field="serviceCtx.emailAddress" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
@@ -162,15 +162,15 @@ under the License.
<log level="info" message="====== contactMechId [${contactMechId}] ======"/>
<entity-one entity-name="ContactMech" value-name="contactMech"/>
<assert>
<not><if-empty field-name="contactMech"/></not>
<if-compare-field field-name="contactMechId" operator="equals" to-field-name="serviceCtx.contactMechId"/>
<not><if-empty field="contactMech"/></not>
<if-compare-field field="contactMechId" to-field="serviceCtx.contactMechId" operator="equals"/>
</assert>
<clear-field field-name="telecomNumber"/>
<get-related-one value-name="contactMech" relation-name="TelecomNumber" to-value-name="telecomNumber"/>
<assert>
<not><if-empty field-name="telecomNumber"/></not>
<if-compare-field field-name="telecomNumber.areaCode" operator="equals" to-field-name="serviceCtx.areaCode"/>
<if-compare-field field-name="telecomNumber.contactNumber" operator="equals" to-field-name="serviceCtx.contactNumber"/>
<not><if-empty field="telecomNumber"/></not>
<if-compare-field field="telecomNumber.areaCode" to-field="serviceCtx.areaCode" operator="equals"/>
<if-compare-field field="telecomNumber.contactNumber" to-field="serviceCtx.contactNumber" operator="equals"/>
</assert>
<check-errors/>
@@ -187,13 +187,13 @@ under the License.
<field-map field-name="contactMechId" env-name="newContactMechId"/>
</entity-one>
<assert>
<not><if-empty field-name="contactMech"/></not>
<if-compare-field field-name="newContactMechId" operator="not-equals" to-field-name="serviceCtx.contactMechId"/>
<not><if-empty field="contactMech"/></not>
<if-compare-field field="newContactMechId" to-field="serviceCtx.contactMechId" operator="not-equals"/>
</assert>
<get-related-one value-name="contactMech" relation-name="TelecomNumber" to-value-name="telecomNumber"/>
<assert>
<not><if-empty field-name="telecomNumber"/></not>
<if-compare-field field-name="telecomNumber.contactNumber" operator="equals" to-field-name="serviceCtx.contactNumber"/>
<not><if-empty field="telecomNumber"/></not>
<if-compare-field field="telecomNumber.contactNumber" to-field="serviceCtx.contactNumber" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
@@ -231,16 +231,16 @@ under the License.
<log level="info" message="====== contactMechId [${contactMechId}] ======"/>
<entity-one entity-name="ContactMech" value-name="contactMech"/>
<assert>
<not><if-empty field-name="contactMech"/></not>
<if-compare-field field-name="contactMechId" operator="equals" to-field-name="serviceCtx.contactMechId"/>
<not><if-empty field="contactMech"/></not>
<if-compare-field field="contactMechId" to-field="serviceCtx.contactMechId" operator="equals"/>
</assert>
<clear-field field-name="postalAddress"/>
<get-related-one value-name="contactMech" relation-name="PostalAddress" to-value-name="postalAddress"/>
<assert>
<not><if-empty field-name="postalAddress"/></not>
<if-compare-field field-name="postalAddress.address1" operator="equals" to-field-name="serviceCtx.address1"/>
<if-compare-field field-name="postalAddress.stateProvinceGeoId" operator="equals" to-field-name="serviceCtx.stateProvinceGeoId"/>
<if-compare-field field-name="postalAddress.postalCode" operator="equals" to-field-name="serviceCtx.postalCode"/>
<not><if-empty field="postalAddress"/></not>
<if-compare-field field="postalAddress.address1" to-field="serviceCtx.address1" operator="equals"/>
<if-compare-field field="postalAddress.stateProvinceGeoId" to-field="serviceCtx.stateProvinceGeoId" operator="equals"/>
<if-compare-field field="postalAddress.postalCode" to-field="serviceCtx.postalCode" operator="equals"/>
</assert>
<check-errors/>
@@ -258,14 +258,14 @@ under the License.
<field-map field-name="contactMechId" env-name="newContactMechId"/>
</entity-one>
<assert>
<not><if-empty field-name="contactMech"/></not>
<if-compare-field field-name="newContactMechId" operator="not-equals" to-field-name="serviceCtx.contactMechId"/>
<not><if-empty field="contactMech"/></not>
<if-compare-field field="newContactMechId" to-field="serviceCtx.contactMechId" operator="not-equals"/>
</assert>
<get-related-one value-name="contactMech" relation-name="PostalAddress" to-value-name="postalAddress"/>
<assert>
<not><if-empty field-name="postalAddress"/></not>
<if-compare-field field-name="postalAddress.stateProvinceGeoId" operator="equals" to-field-name="serviceCtx.stateProvinceGeoId"/>
<if-compare-field field-name="postalAddress.postalCode" operator="equals" to-field-name="serviceCtx.postalCode"/>
<not><if-empty field="postalAddress"/></not>
<if-compare-field field="postalAddress.stateProvinceGeoId" to-field="serviceCtx.stateProvinceGeoId" operator="equals"/>
<if-compare-field field="postalAddress.postalCode" to-field="serviceCtx.postalCode" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
@@ -303,10 +303,10 @@ under the License.
<clear-field field-name="paymentMethodAndCreditCard"/>
<entity-one entity-name="PaymentMethodAndCreditCard" value-name="paymentMethodAndCreditCard"/>
<assert>
<not><if-empty field-name="paymentMethodAndCreditCard"/></not>
<if-compare-field field-name="paymentMethodId" operator="equals" to-field-name="oldPaymentMethodId"/>
<if-compare-field field-name="paymentMethodAndCreditCard.cardType" operator="equals" to-field-name="serviceCtx.cardType"/>
<if-compare-field field-name="paymentMethodAndCreditCard.cardNumber" operator="equals" to-field-name="serviceCtx.cardNumber"/>
<not><if-empty field="paymentMethodAndCreditCard"/></not>
<if-compare-field field="paymentMethodId" to-field="oldPaymentMethodId" operator="equals"/>
<if-compare-field field="paymentMethodAndCreditCard.cardType" to-field="serviceCtx.cardType" operator="equals"/>
<if-compare-field field="paymentMethodAndCreditCard.cardNumber" to-field="serviceCtx.cardNumber" operator="equals"/>
</assert>
<check-errors/>
@@ -324,10 +324,10 @@ under the License.
<log level="info" message="====== New paymentMethodId [${paymentMethodId}] created for party [${serviceCtx.partyId}] ======"/>
<entity-one entity-name="PaymentMethodAndCreditCard" value-name="paymentMethodAndCreditCard"/>
<assert>
<not><if-empty field-name="paymentMethodAndCreditCard"/></not>
<if-compare-field field-name="paymentMethodId" operator="not-equals" to-field-name="oldPaymentMethodId"/>
<if-compare-field field-name="paymentMethodAndCreditCard.cardType" operator="equals" to-field-name="serviceCtx.cardType"/>
<if-compare-field field-name="paymentMethodAndCreditCard.cardNumber" operator="equals" to-field-name="serviceCtx.cardNumber"/>
<not><if-empty field="paymentMethodAndCreditCard"/></not>
<if-compare-field field="paymentMethodId" to-field="oldPaymentMethodId" operator="not-equals"/>
<if-compare-field field="paymentMethodAndCreditCard.cardType" to-field="serviceCtx.cardType" operator="equals"/>
<if-compare-field field="paymentMethodAndCreditCard.cardNumber" to-field="serviceCtx.cardNumber" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
@@ -376,10 +376,10 @@ under the License.
<field field-name="hashType" type="java.lang.String"/>
</call-class-method>
<assert>
<not><if-empty field-name="partyAndUserLogin"/></not>
<if-compare-field field-name="partyAndUserLogin.currentPassword" operator="equals" to-field-name="newPasswordHash"/>
<if-compare-field field-name="partyAndUserLogin.userLoginId" operator="equals" to-field-name="userLoginId"/>
<not><if-empty field="partyAndUserLogin"/></not>
<if-compare-field field="partyAndUserLogin.currentPassword" to-field="newPasswordHash" operator="equals"/>
<if-compare-field field="partyAndUserLogin.userLoginId" to-field="userLoginId" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -63,23 +63,23 @@ under the License.
<set field="default_user_password" value="ungssblepsswd" />
<now-timestamp-to-env env-name="nowStamp"/>
<if-compare field-name="create_allow_password" operator="not-equals" value="true">
<if-compare field="create_allow_password" operator="not-equals" value="true">
<set field="parameters.PASSWORD" from-field="default_user_password" />
<set field="parameters.CONFIRM_PASSWORD" from-field="default_user_password" />
<set field="parameters.PASSWORD_HINT" value="No hint set, accout not yet enabled" />
</if-compare>
<!-- if username and/or password should be lowercased, do that now -->
<if-compare field-name="username_lowercase" operator="equals" value="true">
<if-compare field="username_lowercase" operator="equals" value="true">
<call-object-method obj-field-name="USERNAME" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="USERNAME" ret-map-name="parameters"/>
</if-compare>
<if-compare field-name="password_lowercase" operator="equals" value="true">
<if-compare field="password_lowercase" operator="equals" value="true">
<call-object-method obj-field-name="PASSWORD" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="PASSWORD" ret-map-name="parameters"/>
<call-object-method obj-field-name="CONFIRM_PASSWORD" obj-map-name="parameters" method-name="toLowerCase" ret-field-name="CONFIRM_PASSWORD" ret-map-name="parameters"/>
</if-compare>
<!-- Create the UserLogin Record -->
<if-not-empty field-name="USERNAME" map-name="parameters">
<if-not-empty field="parameters.USERNAME">
<call-map-processor in-map-name="parameters" out-map-name="userLoginContext">
<simple-map-processor name="newUserLogin">
<process field="USERNAME"><copy to-field="userLoginId"/><not-empty><fail-property resource="PartyUiLabels" property="PartyUserNameMissing"/></not-empty></process>
@@ -92,10 +92,10 @@ under the License.
<process field="PASSWORD_HINT"><copy to-field="passwordHint"/></process>
</simple-map-processor>
</call-map-processor>
<if-not-empty field-name="userLoginId" map-name="userLoginContext">
<if-not-empty field="userLoginContext.userLoginId">
<set field="userLoginExistsMap.userLoginId" from-field="userLoginContext.userLoginId" />
<find-by-primary-key entity-name="UserLogin" map-name="userLoginExistsMap" value-name="existingUserLogin"/>
<if-not-empty field-name="existingUserLogin">
<if-not-empty field="existingUserLogin">
<set field="tempErrorMessage" value="Username in use, please choose another." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-not-empty>
@@ -114,7 +114,7 @@ under the License.
org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale);
]]></call-bsh>
<else>
<if-compare field-name="require_login" operator="equals" value="true">
<if-compare field="require_login" operator="equals" value="true">
<add-error><fail-property resource="PartyUiLabels" property="PartyUserNameMissing"/></add-error>
<check-errors/>
</if-compare>
@@ -138,7 +138,7 @@ under the License.
<set field="partyRoleContext.roleTypeId" from-field="parameters.roleTypeId" />
<!-- Create the Postal Address -->
<if-compare field-name="USE_ADDRESS" map-name="parameters" operator="equals" value="false">
<if-compare field="parameters.USE_ADDRESS" operator="equals" value="false">
<!-- address not used, do nothing -->
<else>
<call-map-processor in-map-name="parameters" out-map-name="addressContext">
@@ -159,14 +159,14 @@ under the License.
<process field="USER_ADDRESS_ALLOW_SOL"><copy to-field="allowSolicitation"/></process>
</simple-map-processor>
</call-map-processor>
<if-compare value="USA" operator="equals" field-name="USER_COUNTRY" map-name="parameters">
<if-empty field-name="USER_STATE" map-name="parameters">
<if-compare value="USA" operator="equals" field="parameters.USER_COUNTRY">
<if-empty field="parameters.USER_STATE">
<set field="tempErrorMessage" value="State is missing, and is required for an address in the United States." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-empty>
</if-compare>
<if-compare value="CAN" operator="equals" field-name="USER_COUNTRY" map-name="parameters">
<if-empty field-name="USER_STATE" map-name="parameters">
<if-compare value="CAN" operator="equals" field="parameters.USER_COUNTRY">
<if-empty field="parameters.USER_STATE">
<set field="tempErrorMessage" value="State is missing, and is required for an address in Canada." />
<field-to-list field-name="tempErrorMessage" list-name="error_list"/>
</if-empty>
@@ -175,7 +175,7 @@ under the License.
</if-compare>
<!-- Create the Home Phone -->
<if-not-empty field-name="USER_HOME_CONTACT" map-name="parameters">
<if-not-empty field="parameters.USER_HOME_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="homePhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -189,7 +189,7 @@ under the License.
</if-not-empty>
<!-- Create the Work Phone -->
<if-not-empty field-name="USER_WORK_CONTACT" map-name="parameters">
<if-not-empty field="parameters.USER_WORK_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="workPhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -203,7 +203,7 @@ under the License.
</if-not-empty>
<!-- Create the Fax Phone -->
<if-not-empty field-name="USER_FAX_CONTACT" map-name="parameters">
<if-not-empty field="parameters.USER_FAX_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="faxPhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -217,7 +217,7 @@ under the License.
</if-not-empty>
<!-- Create the Mobile Phone -->
<if-not-empty field-name="USER_MOBILE_CONTACT" map-name="parameters">
<if-not-empty field="parameters.USER_MOBILE_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="mobilePhoneContext">
<simple-map-processor name="newTelecomNumber">
<process field="roleTypeId"><copy/></process>
@@ -231,10 +231,10 @@ under the License.
</if-not-empty>
<!-- Check for required Phone -->
<if-compare field-name="require_phone" operator="equals" value="true">
<if-empty field-name="USER_HOME_CONTACT" map-name="parameters">
<if-empty field-name="USER_WORK_CONTACT" map-name="parameters">
<if-empty field-name="USER_MOBILE_CONTACT" map-name="parameters">
<if-compare field="require_phone" operator="equals" value="true">
<if-empty field="parameters.USER_HOME_CONTACT">
<if-empty field="parameters.USER_WORK_CONTACT">
<if-empty field="parameters.USER_MOBILE_CONTACT">
<call-map-processor in-map-name="parameters" out-map-name="dummymap">
<simple-map-processor name="checkRequiredPhone">
<process field="REQUIRED_PHONE">
@@ -257,8 +257,8 @@ under the License.
</call-map-processor>
<!-- Check for required E-Mail -->
<if-compare field-name="require_email" operator="equals" value="true">
<if-empty field-name="emailAddress" map-name="emailContext">
<if-compare field="require_email" operator="equals" value="true">
<if-empty field="emailContext.emailAddress">
<call-map-processor in-map-name="emailContext" out-map-name="dummymap">
<simple-map-processor name="checkRequiredEmail">
<process field="emailAddress">
@@ -267,7 +267,7 @@ under the License.
</simple-map-processor>
</call-map-processor>
</if-empty>
<if-not-empty field-name="emailAddress" map-name="emailContext">
<if-not-empty field="emailContext.emailAddress">
<call-map-processor in-map-name="emailContext" out-map-name="dummymap">
<simple-map-processor name="checkRequiredEmailFormat">
<process field="emailAddress">
@@ -308,7 +308,7 @@ under the License.
<set field="mobilePhoneContext.partyId" from-field="tempMap.partyId" />
<set field="emailContext.partyId" from-field="tempMap.partyId" />
<if-not-empty field-name="newUserLogin">
<if-not-empty field="newUserLogin">
<!-- If password encryption is enabled, encrpyt it now -->
<call-bsh><![CDATA[
boolean useEncryption = "true".equals(org.ofbiz.base.util.UtilProperties.getPropertyValue("security", "password.encrypt"));
@@ -325,7 +325,7 @@ under the License.
<call-service service-name="createPartyRole" in-map-name="partyRoleContext"/>
<!-- shipping address -->
<if-compare field-name="USE_ADDRESS" map-name="parameters" operator="equals" value="false">
<if-compare field="parameters.USE_ADDRESS" operator="equals" value="false">
<!-- address not used, do nothing -->
<else>
<call-service service-name="createPartyPostalAddress" in-map-name="addressContext">
@@ -342,7 +342,7 @@ under the License.
</if-compare>
<!-- home phone -->
<if-not-empty field-name="USER_HOME_CONTACT" map-name="parameters">
<if-not-empty field="parameters.USER_HOME_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="homePhoneContext">
<result-to-field result-name="contactMechId" map-name="homePhonePurposeContext"/>
</call-service>
@@ -352,7 +352,7 @@ under the License.
</if-not-empty>
<!-- work phone -->
<if-not-empty field-name="USER_WORK_CONTACT" map-name="parameters">
<if-not-empty field="parameters.USER_WORK_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="workPhoneContext">
<result-to-field result-name="contactMechId" map-name="workPhonePurposeContext"/>
</call-service>
@@ -362,7 +362,7 @@ under the License.
</if-not-empty>
<!-- fax phone -->
<if-not-empty field-name="USER_FAX_CONTACT" map-name="parameters">
<if-not-empty field="parameters.USER_FAX_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="faxPhoneContext">
<result-to-field result-name="contactMechId" map-name="faxPhonePurposeContext"/>
</call-service>
@@ -372,7 +372,7 @@ under the License.
</if-not-empty>
<!-- mobile phone -->
<if-not-empty field-name="USER_MOBILE_CONTACT" map-name="parameters">
<if-not-empty field="parameters.USER_MOBILE_CONTACT">
<call-service service-name="createPartyTelecomNumber" in-map-name="mobilePhoneContext">
<result-to-field result-name="contactMechId" map-name="mobilePhonePurposeContext"/>
</call-service>
@@ -382,7 +382,7 @@ under the License.
</if-not-empty>
<!-- email address -->
<if-not-empty field-name="USER_EMAIL" map-name="parameters">
<if-not-empty field="parameters.USER_EMAIL">
<call-service service-name="createPartyEmailAddress" in-map-name="emailContext">
<result-to-field result-name="contactMechId" map-name="emailPurposeContext"/>
</call-service>
@@ -24,7 +24,7 @@ under the License.
<make-value value-name="newEntity" entity-name="ProdCatalog"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="parameters.prodCatalogId">
<if-empty field="parameters.prodCatalogId">
<sequenced-id-to-env sequence-name="ProdCatalog" env-name="newEntity.prodCatalogId"/>
<else>
<set field="newEntity.prodCatalogId" from-field="parameters.prodCatalogId"/>
@@ -49,7 +49,7 @@ under the License.
<simple-method method-name="addProductCategoryToProdCatalog" short-description="Add Category To ProdCatalog">
<!-- Check that the ProductCategory exists -->
<entity-one entity-name="ProductCategory" value-name="productCategory"/>
<if-empty field-name="productCategory">
<if-empty field="productCategory">
<add-error><fail-property resource="ProductUiLabels" property="ProductCategoryNotFoundforCategoryID"/></add-error>
</if-empty>
<check-errors/>
@@ -58,7 +58,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -87,7 +87,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -108,7 +108,7 @@ under the License.
</simple-method>
<simple-method method-name="getAllCategories" short-description="get All categories" login-required="false">
<if-not-empty field-name="parameters.topCategory">
<if-not-empty field="parameters.topCategory">
<set field="defaultTopCategoryId" from-field="parameters.topCategory"/>
<else>
<property-to-field property="top.category.default" field-name="defaultTopCategoryId" resource="catalog"/>
@@ -133,28 +133,28 @@ under the License.
<set field="productCategoryRollUpContext.parentProductCategoryId" from-field="parameters.parentProductCategoryId" />
<!--set field="categories" from-field="parameters.categories" / -->
<find-by-and entity-name="ProductCategoryRollup" list-name="rollups" map-name="productCategoryRollUpContext" order-by-list-name="orderByStringList"/>
<if-not-empty field-name="parameters.categories">
<if-not-empty field="parameters.categories">
<list-to-list list-name="parameters.categories" to-list-name="categories"/>
</if-not-empty>
<if-not-empty field-name="rollups">
<if-not-empty field="rollups">
<iterate list-name="rollups" entry-name="parent">
<get-related-one relation-name="CurrentProductCategory" value-name="parent" to-value-name="currentProductCategory"/>
<field-to-list list-name="subCategories" field-name="currentProductCategory"/>
</iterate>
<if-not-empty field-name="subCategories">
<if-not-empty field="subCategories">
<set field="relatedCategoryContext.categories" from-field="subCategories"/>
<iterate list-name="subCategories" entry-name="subCategory">
<set field="relatedCategoryContext.parentProductCategoryId" from-field="subCategory.productCategoryId"/>
<call-service service-name="getRelatedCategories" in-map-name="relatedCategoryContext">
<result-to-field result-name="categories" field-name="relCategories"/>
</call-service>
<if-not-empty field-name="relCategories">
<if-not-empty field-name="categories">
<if-not-empty field="relCategories">
<if-not-empty field="categories">
<iterate list-name="relCategories" entry-name="relCategory">
<call-object-method obj-field-name="categories" method-name="contains" ret-field-name="addInCategories" >
<field field-name="relCategory" type="java.lang.Object"/>
</call-object-method>
<if-compare value="false" field-name="addInCategories" operator="equals" type="Boolean">
<if-compare value="false" field="addInCategories" operator="equals" type="Boolean">
<field-to-list list-name="categories" field-name="relCategory"/>
</if-compare>
</iterate>
@@ -189,7 +189,7 @@ under the License.
<result-to-field result-name="categories" field-name="categories"/>
</call-service>
<!-- Get the category from categories-->
<if-not-empty field-name="categories">
<if-not-empty field="categories">
<iterate list-name="categories" entry-name="category">
<set field="checkImageUrlForCategoryContext.categoryId" from-field="category.productCategoryId"/>
<call-service service-name="checkImageUrlForCategoryAndProduct" in-map-name="checkImageUrlForCategoryContext">
@@ -211,31 +211,31 @@ under the License.
<result-to-field result-name="category" field-name="category"/>
</call-service>
<!-- Get category images and check it exists or not -->
<if-not-empty field-name="category">
<if-not-empty field="category">
<set field="checkImageUrlForCategoryContext.categoryId" from-field="category.productCategoryId"/>
<call-service service-name="checkImageUrlForCategory" in-map-name="checkImageUrlForCategoryContext">
<result-to-field result-name="filesImageMap" field-name="filesImageMap"/>
</call-service>
<if-not-empty field-name="categoryImageUrl" map-name="filesImageMap.categoryImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.categoryImageUrlMap.isExists" operator="equals">
<if-not-empty field="filesImageMap.categoryImageUrlMap.categoryImageUrl">
<if-compare value="Y" field="filesImageMap.categoryImageUrlMap.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="categoryImageUrl" map-name="filesImageMap.categoryImageUrlMap"/>
<else>
<field-to-list list-name="fileNotExists" field-name="categoryImageUrl" map-name="filesImageMap.categoryImageUrlMap"/>
</else>
</if-compare>
</if-not-empty>
<if-not-empty field-name="linkOneImageUrl" map-name="filesImageMap.linkOneImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.linkOneImageUrlMap.isExists" operator="equals">
<if-not-empty field="filesImageMap.linkOneImageUrlMap.linkOneImageUrl">
<if-compare value="Y" field="filesImageMap.linkOneImageUrlMap.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="linkOneImageUrl" map-name="filesImageMap.linkOneImageUrlMap"/>
<else>
<field-to-list list-name="fileNotExists" field-name="linkOneImageUrl" map-name="filesImageMap.linkOneImageUrlMap"/>
</else>
</if-compare>
</if-not-empty>
<if-not-empty field-name="linkTwoImageUrl" map-name="filesImageMap.linkTwoImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.linkTwoImageUrlMap.isExists" operator="equals">
<if-not-empty field="filesImageMap.linkTwoImageUrlMap.linkTwoImageUrl">
<if-compare value="Y" field="filesImageMap.linkTwoImageUrlMap.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="linkTwoImageUrl" map-name="filesImageMap.linkTwoImageUrlMap"/>
<else>
<field-to-list list-name="fileNotExists" field-name="linkTwoImageUrl" map-name="filesImageMap.linkTwoImageUrlMap"/>
@@ -244,39 +244,39 @@ under the License.
</if-not-empty>
</if-not-empty>
<if-not-empty field-name="categoryMembers">
<if-not-empty field="categoryMembers">
<iterate list-name="categoryMembers" entry-name="productCategoryMember">
<set field="checkImageUrlForProductContext.productId" from-field="productCategoryMember.productId"/>
<call-service service-name="checkImageUrlForProduct" in-map-name="checkImageUrlForProductContext">
<result-to-field result-name="filesImageMap" field-name="filesImageMap"/>
</call-service>
<if-not-empty field-name="filesImageMap">
<if-not-empty field-name="smallImageUrl" map-name="filesImageMap.smallImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.smallImageUrlMap.isExists" operator="equals">
<if-not-empty field="filesImageMap">
<if-not-empty field="filesImageMap.smallImageUrlMap.smallImageUrl">
<if-compare value="Y" field="filesImageMap.smallImageUrlMap.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="smallImageUrl" map-name="filesImageMap.smallImageUrlMap"/>
<else>
<field-to-list list-name="fileNotExists" field-name="smallImageUrl" map-name="filesImageMap.smallImageUrlMap"/>
</else>
</if-compare>
</if-not-empty>
<if-not-empty field-name="mediumImageUrl" map-name="filesImageMap.mediumImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.mediumImageUrlMap.isExists" operator="equals">
<if-not-empty field="filesImageMap.mediumImageUrlMap.mediumImageUrl">
<if-compare value="Y" field="filesImageMap.mediumImageUrlMap.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="mediumImageUrl" map-name="filesImageMap.mediumImageUrlMap"/>
<else>
<field-to-list list-name="fileNotExists" field-name="mediumImageUrl" map-name="filesImageMap.mediumImageUrlMap"/>
</else>
</if-compare>
</if-not-empty>
<if-not-empty field-name="largeImageUrl" map-name="filesImageMap.largeImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.largeImageUrlMap.isExists" operator="equals">
<if-not-empty field="filesImageMap.largeImageUrlMap.largeImageUrl">
<if-compare value="Y" field="filesImageMap.largeImageUrlMap.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="largeImageUrl" map-name="filesImageMap.largeImageUrlMap"/>
<else>
<field-to-list list-name="fileNotExists" field-name="largeImageUrl" map-name="filesImageMap.largeImageUrlMap"/>
</else>
</if-compare>
</if-not-empty>
<if-not-empty field-name="detailImageUrl" map-name="filesImageMap.detailImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.detailImageUrl.isExists" operator="equals">
<if-not-empty field="filesImageMap.detailImageUrlMap.detailImageUrl">
<if-compare value="Y" field="filesImageMap.detailImageUrl.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="detailImageUrl" map-name="filesImageMap.detailImageUrl"/>
<else>
<field-to-list list-name="fileNotExists" field-name="detailImageUrl" map-name="filesImageMap.detailImageUrl"/>
@@ -287,22 +287,22 @@ under the License.
<!-- Case For virtual Product -->
<!-- get related assoc product -->
<get-related-one relation-name="Product" value-name="productCategoryMember" to-value-name="product"/>
<if-compare operator="equals" field-name="isVirtual" value="Y" map-name="product">
<if-compare operator="equals" field="product.isVirtual" value="Y">
<!-- log level="info" message = "Virtual product =====${productCategoryMember.productId}"/ -->
<set field="virtualProductContext.productId" from-field="product.productId"/>
<set field="virtualProductContext.productAssocTypeId" value="PRODUCT_VARIANT"/>
<find-by-and entity-name="ProductAssoc" map-name="virtualProductContext" list-name="variantProducts"/>
<filter-list-by-date list-name="variantProducts"/>
<if-not-empty field-name="variantProducts">
<if-not-empty field="variantProducts">
<iterate entry-name="variantProduct" list-name="variantProducts">
<!-- log level="info" message = "Variant product =====${variantProduct.productIdTo}"/ -->
<set field="variantProductContext.productId" from-field="variantProduct.productIdTo"/>
<call-service service-name="checkImageUrlForProduct" in-map-name="variantProductContext">
<result-to-field result-name="filesImageMap" field-name="filesImageMap"/>
</call-service>
<if-not-empty field-name="filesImageMap">
<if-not-empty field-name="smallImageUrl" map-name="filesImageMap.smallImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.smallImageUrlMap.isExists" operator="equals">
<if-not-empty field="filesImageMap">
<if-not-empty field="filesImageMap.smallImageUrlMap.smallImageUrl">
<if-compare value="Y" field="filesImageMap.smallImageUrlMap.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="smallImageUrl" map-name="filesImageMap.smallImageUrlMap"/>
<else>
<field-to-list list-name="fileNotExists" field-name="smallImageUrl" map-name="filesImageMap.smallImageUrlMap"/>
@@ -310,8 +310,8 @@ under the License.
</if-compare>
</if-not-empty>
<if-not-empty field-name="mediumImageUrl" map-name="filesImageMap.mediumImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.mediumImageUrlMap.isExists" operator="equals">
<if-not-empty field="filesImageMap.mediumImageUrlMap.mediumImageUrl">
<if-compare value="Y" field="filesImageMap.mediumImageUrlMap.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="mediumImageUrl" map-name="filesImageMap.mediumImageUrlMap"/>
<else>
<field-to-list list-name="fileNotExists" field-name="mediumImageUrl" map-name="filesImageMap.mediumImageUrlMap"/>
@@ -319,8 +319,8 @@ under the License.
</if-compare>
</if-not-empty>
<if-not-empty field-name="largeImageUrl" map-name="filesImageMap.largeImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.largeImageUrlMap.isExists" operator="equals">
<if-not-empty field="filesImageMap.largeImageUrlMap.largeImageUrl">
<if-compare value="Y" field="filesImageMap.largeImageUrlMap.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="largeImageUrl" map-name="filesImageMap.largeImageUrlMap"/>
<else>
<field-to-list list-name="fileNotExists" field-name="largeImageUrl" map-name="filesImageMap.largeImageUrlMap"/>
@@ -328,8 +328,8 @@ under the License.
</if-compare>
</if-not-empty>
<if-not-empty field-name="detailImageUrl" map-name="filesImageMap.detailImageUrlMap">
<if-compare value="Y" field-name="filesImageMap.detailImageUrl.isExists" operator="equals">
<if-not-empty field="filesImageMap.detailImageUrlMap.detailImageUrl">
<if-compare value="Y" field="filesImageMap.detailImageUrl.isExists" operator="equals">
<field-to-list list-name="fileExists" field-name="detailImageUrl" map-name="filesImageMap.detailImageUrl"/>
<else>
<field-to-list list-name="fileNotExists" field-name="detailImageUrl" map-name="filesImageMap.detailImageUrl"/>
@@ -350,11 +350,11 @@ under the License.
<!-- This service get the category id and check all the images of category exists or not -->
<simple-method method-name="checkImageUrlForCategory" short-description="Check for image url exists or not for product" login-required="false">
<if-not-empty field-name="parameters.categoryId">
<if-not-empty field="parameters.categoryId">
<set field="productCategoryFindContext.productCategoryId" from-field="parameters.categoryId"/>
<find-by-primary-key entity-name="ProductCategory" value-name="category" map-name="productCategoryFindContext"/>
<!-- check for category image url -->
<if-not-empty field-name="category.categoryImageUrl">
<if-not-empty field="category.categoryImageUrl">
<set field="checkImageUrlContext.imageUrl" from-field="category.categoryImageUrl"/>
<call-service service-name="checkImageUrl" in-map-name="checkImageUrlContext">
<result-to-field result-name="isExists" field-name="isExists"/>
@@ -362,12 +362,12 @@ under the License.
<set field="categoryImageUrlMap.categoryImageUrl" from-field="category.categoryImageUrl"/>
<set field="categoryImageUrlMap.isExists" from-field="isExists"/>
<set field="filesImageMap.categoryImageUrlMap" from-field="categoryImageUrlMap" />
<if-compare value="N" field-name="isExists" operator="equals">
<if-compare value="N" field="isExists" operator="equals">
<clear-field field-name="categoryImageUrl" map-name="category"></clear-field>
</if-compare>
</if-not-empty>
<!-- check for link image url -->
<if-not-empty field-name="category.linkOneImageUrl">
<if-not-empty field="category.linkOneImageUrl">
<clear-field field-name="checkImageUrlContext.imageUrl"/>
<set field="checkImageUrlContext.imageUrl" from-field="category.linkOneImageUrl"/>
<call-service service-name="checkImageUrl" in-map-name="checkImageUrlContext">
@@ -376,12 +376,12 @@ under the License.
<set field="linkOneImageUrlMap.linkOneImageUrl" from-field="category.linkOneImageUrl"/>
<set field="linkOneImageUrlMap.isExists" from-field="isExists"/>
<set field="filesImageMap.linkOneImageUrlMap" from-field="linkOneImageUrlMap" />
<if-compare value="N" field-name="isExists" operator="equals">
<if-compare value="N" field="isExists" operator="equals">
<clear-field field-name="linkOneImageUrl" map-name="category"></clear-field>
</if-compare>
</if-not-empty>
<!-- check for link two image url -->
<if-not-empty field-name="category.linkTwoImageUrl">
<if-not-empty field="category.linkTwoImageUrl">
<clear-field field-name="checkImageUrlContext.imageUrl"/>
<set field="checkImageUrlContext.imageUrl" from-field="category.linkTwoImageUrl"/>
<call-service service-name="checkImageUrl" in-map-name="checkImageUrlContext">
@@ -390,7 +390,7 @@ under the License.
<set field="linkTwoImageUrlMap.largeImageUrl" from-field="category.linkTwoImageUrl"/>
<set field="linkTwoImageUrlMap.isExists" from-field="isExists"/>
<set field="filesImageMap.linkTwoImageUrlMap" from-field="linkTwoImageUrlMap" />
<if-compare value="N" field-name="isExists" operator="equals">
<if-compare value="N" field="isExists" operator="equals">
<clear-field field-name="linkTwoImageUrl" map-name="category"></clear-field>
</if-compare>
</if-not-empty>
@@ -401,11 +401,11 @@ under the License.
</if-not-empty>
</simple-method>
<simple-method method-name="checkImageUrlForProduct" short-description="Check for image url exists or not for product" login-required="false">
<if-not-empty field-name="parameters.productId">
<if-not-empty field="parameters.productId">
<set field="productFindContext.productId" from-field="parameters.productId"/>
<find-by-primary-key entity-name="Product" value-name="product" map-name="productFindContext"/>
<!-- check for small image url -->
<if-not-empty field-name="product.smallImageUrl">
<if-not-empty field="product.smallImageUrl">
<set field="checkImageUrlContext.imageUrl" from-field="product.smallImageUrl"/>
<call-service service-name="checkImageUrl" in-map-name="checkImageUrlContext">
<result-to-field result-name="isExists" field-name="isExists"/>
@@ -413,13 +413,13 @@ under the License.
<set field="smallImageUrlMap.smallImageUrl" from-field="product.smallImageUrl"/>
<set field="smallImageUrlMap.isExists" from-field="isExists"/>
<set field="filesImageMap.smallImageUrlMap" from-field="smallImageUrlMap" />
<if-compare value="N" field-name="isExists" operator="equals">
<if-compare value="N" field="isExists" operator="equals">
<log level="info" message="Update SmallImage for product Id ${parameters.productId}" />
<clear-field field-name="smallImageUrl" map-name="product"></clear-field>
</if-compare>
</if-not-empty>
<!-- check for medium image url -->
<if-not-empty field-name="product.mediumImageUrl">
<if-not-empty field="product.mediumImageUrl">
<clear-field field-name="checkImageUrlContext.imageUrl"/>
<set field="checkImageUrlContext.imageUrl" from-field="product.mediumImageUrl"/>
<call-service service-name="checkImageUrl" in-map-name="checkImageUrlContext">
@@ -428,12 +428,12 @@ under the License.
<set field="mediumImageUrlMap.mediumImageUrl" from-field="product.mediumImageUrl"/>
<set field="mediumImageUrlMap.isExists" from-field="isExists"/>
<set field="filesImageMap.mediumImageUrlMap" from-field="mediumImageUrlMap" />
<if-compare value="N" field-name="isExists" operator="equals">
<if-compare value="N" field="isExists" operator="equals">
<clear-field field-name="mediumImageUrl" map-name="product"></clear-field>
</if-compare>
</if-not-empty>
<!-- check for large image url -->
<if-not-empty field-name="product.largeImageUrl">
<if-not-empty field="product.largeImageUrl">
<clear-field field-name="checkImageUrlContext.imageUrl"/>
<set field="checkImageUrlContext.imageUrl" from-field="product.largeImageUrl"/>
<call-service service-name="checkImageUrl" in-map-name="checkImageUrlContext">
@@ -442,12 +442,12 @@ under the License.
<set field="largeImageUrlMap.largeImageUrl" from-field="product.largeImageUrl"/>
<set field="largeImageUrlMap.isExists" from-field="isExists"/>
<set field="filesImageMap.largeImageUrlMap" from-field="largeImageUrlMap" />
<if-compare value="N" field-name="isExists" operator="equals">
<if-compare value="N" field="isExists" operator="equals">
<clear-field field-name="largeImageUrl" map-name="product"></clear-field>
</if-compare>
</if-not-empty>
<!-- check for detail image url -->
<if-not-empty field-name="product.detailImageUrl">
<if-not-empty field="product.detailImageUrl">
<clear-field field-name="checkImageUrlContext.imageUrl"/>
<set field="checkImageUrlContext.imageUrl" from-field="product.detailImageUrl"/>
<call-service service-name="checkImageUrl" in-map-name="checkImageUrlContext">
@@ -456,7 +456,7 @@ under the License.
<set field="detailImageUrlMap.detailImageUrl" from-field="product.detailImageUrl"/>
<set field="detailImageUrlMap.isExists" from-field="isExists"/>
<set field="filesImageMap.detailImageUrlMap" from-field="detailImageUrlMap" />
<if-compare value="N" field-name="isExists" operator="equals">
<if-compare value="N" field="isExists" operator="equals">
<clear-field field-name="detailImageUrl" map-name="product"></clear-field>
</if-compare>
</if-not-empty>
@@ -483,9 +483,9 @@ under the License.
<if>
<condition>
<or>
<if-compare value="true" field-name="httpFlag" operator="equals" type="Boolean"/>
<if-compare value="true" field-name="httpsFlag" operator="equals" type="Boolean"/>
<if-compare value="true" field-name="ftpFlag" operator="equals" type="Boolean"/>
<if-compare value="true" field="httpFlag" operator="equals" type="Boolean"/>
<if-compare value="true" field="httpsFlag" operator="equals" type="Boolean"/>
<if-compare value="true" field="ftpFlag" operator="equals" type="Boolean"/>
</or>
</condition>
<then>
@@ -500,7 +500,7 @@ under the License.
</call-class-method>
</else>
</if>
<if-not-empty field-name="url" >
<if-not-empty field="url">
<set field="isExists" value="Y"/>
<else>
<set field="isExists" value="N"/>
@@ -26,7 +26,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp" />
</if-empty>
@@ -36,7 +36,7 @@ under the License.
<make-value value-name="newEntity" entity-name="ProductCategory"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="parameters.productCategoryId">
<if-empty field="parameters.productCategoryId">
<sequenced-id-to-env sequence-name="ProductCategory" env-name="newEntity.productCategoryId"/>
<else>
<set field="newEntity.productCategoryId" from-field="parameters.productCategoryId"/>
@@ -50,7 +50,7 @@ under the License.
<!-- if setting the primaryParentCategoryId, create a rollup entity too -->
<!-- NOTE: this is commented out to disable because it is dangerous to add category rollups on a live site without being able to specify a fromDate
<if-not-empty field-name="primaryParentCategoryId" map-name="newEntity">
<if-not-empty field="newEntity.primaryParentCategoryId">
<make-value entity-name="ProductCategoryRollup" value-name="newRollup"/>
<field-to-field field-name="productCategoryId" map-name="newEntity" to-field-name="productCategoryId" to-map-name="newRollup"/>
<field-to-field field-name="primaryParentCategoryId" map-name="newEntity" to-field-name="parentProductCategoryId" to-map-name="newRollup"/>
@@ -89,8 +89,8 @@ under the License.
<!-- if setting the primaryParentCategoryId, create a rollup entity too -->
<!-- NOTE: this is commented out to disable because it is dangerous to add category rollups on a live site without being able to specify a fromDate
<if-not-empty field-name="primaryParentCategoryId" map-name="lookedUpValue">
<if-compare-field field-name="primaryParentCategoryId" map-name="lookedUpValue" operator="not-equals" to-map-name="saveIdMap">
<if-not-empty field="lookedUpValue.primaryParentCategoryId">
<if-compare-field to-field="saveIdMap." field="lookedUpValue.primaryParentCategoryId" operator="not-equals">
<make-value entity-name="ProductCategoryRollup" value-name="newRollup"/>
<field-to-field field-name="productCategoryId" map-name="lookedUpValue" to-field-name="productCategoryId" to-map-name="newRollup"/>
<field-to-field field-name="primaryParentCategoryId" map-name="lookedUpValue" to-field-name="parentProductCategoryId" to-map-name="newRollup"/>
@@ -119,7 +119,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -144,7 +144,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -164,7 +164,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -201,7 +201,7 @@ under the License.
<!-- If the associated category was the primary category for the product, clear that field -->
<entity-one entity-name="Product" value-name="product" auto-field-map="true"/>
<if-compare-field field-name="product.primaryProductCategoryId" operator="equals" to-field-name="parameters.productCategoryId">
<if-compare-field field="product.primaryProductCategoryId" to-field="parameters.productCategoryId" operator="equals">
<clear-field field-name="product.primaryProductCategoryId"/>
<store-value value-name="product"/>
</if-compare-field>
@@ -226,7 +226,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -272,7 +272,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -293,7 +293,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -312,7 +312,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -365,7 +365,7 @@ under the License.
</entity-and>
<set field="validDate" from-field="parameters.validDate"/>
<if-not-empty field-name="validDate">
<if-not-empty field="validDate">
<filter-list-by-date list-name="productCategoryMembers" valid-date-name="validDate"/>
</if-not-empty>
@@ -377,12 +377,12 @@ under the License.
</iterate>
<store-list list-name="pcmsToStore"/>
<if-compare field-name="recurse" map-name="parameters" operator="equals" value="Y">
<if-compare field="parameters.recurse" operator="equals" value="Y">
<!-- call this service for each sub-category in the rollup with the same productCategoryIdTo -->
<set field="lookupChildrenMap.parentProductCategoryId" from-field="parameters.productCategoryId"/>
<find-by-and entity-name="ProductCategoryRollup" map-name="lookupChildrenMap" list-name="productCategoryRollups"/>
<if-not-empty field-name="validDate">
<if-not-empty field="validDate">
<filter-list-by-date list-name="productCategoryRollups" valid-date-name="validDate"/>
</if-not-empty>
@@ -417,7 +417,7 @@ under the License.
<field-map field-name="productCategoryId" env-name="productCategoryId"/>
</entity-and>
<if-not-empty field-name="validDate">
<if-not-empty field="validDate">
<filter-list-by-date list-name="categoryEntities" valid-date-name="validDate"/>
</if-not-empty>
@@ -436,7 +436,7 @@ under the License.
<call-simple-method method-name="checkCategoryRelatedPermission"/>
<check-errors/>
<if-not-empty field-name="parameters.thruDate">
<if-not-empty field="parameters.thruDate">
<set field="expireTimestamp" from-field="parameters.thruDate"/>
<else>
<now-timestamp-to-env env-name="expireTimestamp"/>
@@ -458,7 +458,7 @@ under the License.
<call-simple-method method-name="checkCategoryRelatedPermission"/>
<check-errors/>
<if-not-empty field-name="parameters.validDate">
<if-not-empty field="parameters.validDate">
<set field="expireTimestamp" from-field="parameters.validDate"/>
<else>
<now-timestamp-to-env env-name="expireTimestamp"/>
@@ -470,7 +470,7 @@ under the License.
</entity-and>
<iterate entry-name="productCategoryMember" list-name="productCategoryMembers">
<if-compare-field field-name="thruDate" map-name="productCategoryMember" operator="less" to-field-name="expireTimestamp" type="Timestamp">
<if-compare-field field="productCategoryMember.thruDate" to-field="expireTimestamp" operator="less" type="Timestamp">
<remove-value value-name="productCategoryMember"/>
</if-compare-field>
</iterate>
@@ -485,14 +485,14 @@ under the License.
<call-simple-method method-name="checkCategoryRelatedPermission"/>
<check-errors/>
<if-empty field-name="parameters.currencyUomId">
<if-empty field="parameters.currencyUomId">
<!-- default to USD for lack of a better alternative, for now anyway... -->
<set field="parameters.currencyUomId" value="USD"/>
</if-empty>
<!-- create Product -->
<set-service-fields service-name="createProduct" map-name="parameters" to-map-name="callCreateProductMap"/>
<if-empty field-name="callCreateProductMap.productTypeId">
<if-empty field="callCreateProductMap.productTypeId">
<set field="callCreateProductMap.productTypeId" value="FINISHED_GOOD"/>
</if-empty>
<call-service service-name="createProduct" in-map-name="callCreateProductMap">
@@ -506,7 +506,7 @@ under the License.
<call-service service-name="addProductToCategory" in-map-name="callCreateProductCategoryMemberMap"/>
<!-- create defaultPrice and averageCost ProductPrice -->
<if-not-empty field-name="parameters.defaultPrice">
<if-not-empty field="parameters.defaultPrice">
<set field="createDefaultPriceMap.productId" from-field="productId"/>
<set field="createDefaultPriceMap.currencyUomId" from-field="parameters.currencyUomId"/>
<set field="createDefaultPriceMap.price" from-field="parameters.defaultPrice"/>
@@ -516,7 +516,7 @@ under the License.
<call-service service-name="createProductPrice" in-map-name="createDefaultPriceMap"/>
</if-not-empty>
<if-not-empty field-name="parameters.averageCost">
<if-not-empty field="parameters.averageCost">
<set field="createAverageCostMap.productId" from-field="productId"/>
<set field="createAverageCostMap.currencyUomId" from-field="parameters.currencyUomId"/>
<set field="createAverageCostMap.price" from-field="parameters.averageCost"/>
@@ -532,7 +532,7 @@ under the License.
<log level="info" message="Applying feature [${productFeatureId}] of type [${productFeatureTypeId}] to product [${productId}]"/>
<set field="createPfaMap.productId" from-field="productId"/>
<set field="createPfaMap.productFeatureId" from-field="productFeatureId"/>
<if-compare field-name="${productFeatureTypeId}" map-name="parameters.productFeatureSelectableByType" operator="equals" value="Y">
<if-compare field="parameters.productFeatureSelectableByType.${productFeatureTypeId}" operator="equals" value="Y">
<set field="createPfaMap.productFeatureApplTypeId" value="SELECTABLE_FEATURE"/>
<set field="hasSelectableFeatures" value="Y"/>
<else>
@@ -544,7 +544,7 @@ under the License.
</iterate-map>
<!-- set isVirtual based on hasSelectableFeatures -->
<if-compare field-name="hasSelectableFeatures" operator="equals" value="Y">
<if-compare field="hasSelectableFeatures" operator="equals" value="Y">
<entity-one entity-name="Product" value-name="newProduct"/>
<set field="newProduct.isVirtual" value="Y"/>
<store-value value-name="newProduct"/>
@@ -572,27 +572,27 @@ under the License.
<set field="productCategoryIdTo" from-field="parameters.productCategoryId"/>
<!-- if requested, duplicate related data as well -->
<if-not-empty field-name="duplicateMembers" map-name="parameters">
<if-not-empty field="parameters.duplicateMembers">
<set field="entityName" value="ProductCategoryMember"/>
<call-simple-method method-name="copyCategoryEntities"/>
</if-not-empty>
<if-not-empty field-name="duplicateContent" map-name="parameters">
<if-not-empty field="parameters.duplicateContent">
<set field="entityName" value="ProductCategoryContent"/>
<call-simple-method method-name="copyCategoryEntities"/>
</if-not-empty>
<if-not-empty field-name="duplicateRoles" map-name="parameters">
<if-not-empty field="parameters.duplicateRoles">
<set field="entityName" value="ProductCategoryRole"/>
<call-simple-method method-name="copyCategoryEntities"/>
</if-not-empty>
<if-not-empty field-name="duplicateAttributes" map-name="parameters">
<if-not-empty field="parameters.duplicateAttributes">
<set field="entityName" value="ProductCategoryAttribute"/>
<call-simple-method method-name="copyCategoryEntities"/>
</if-not-empty>
<if-not-empty field-name="duplicateFeatures" map-name="parameters">
<if-not-empty field="parameters.duplicateFeatures">
<set field="entityName" value="ProductFeatureCategoryAppl"/>
<call-simple-method method-name="copyCategoryEntities"/>
</if-not-empty>
<if-not-empty field-name="duplicateCatalogs" map-name="parameters">
<if-not-empty field="parameters.duplicateCatalogs">
<set field="entityName" value="ProdCatalogCategory"/>
<call-simple-method method-name="copyCategoryEntities"/>
</if-not-empty>
@@ -600,7 +600,7 @@ under the License.
<!-- parent rollups are where oldProductCategoryId = ProductCategoryRollup.productCategoryId, but the
child roll up is where oldProductCategoryId = ProductCategoryRollup.parentProductCategoryId and hence
requires a new find-by map -->
<if-not-empty field-name="duplicateParentRollup" map-name="parameters">
<if-not-empty field="parameters.duplicateParentRollup">
<find-by-and entity-name="ProductCategoryRollup" map-name="categoryFindContext" list-name="foundValues"/>
<iterate entry-name="foundValue" list-name="foundValues">
<clone-value value-name="foundValue" new-value-name="newTempValue"/>
@@ -608,7 +608,7 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateChildRollup" map-name="parameters">
<if-not-empty field="parameters.duplicateChildRollup">
<entity-and entity-name="ProductCategoryRollup" list-name="foundValues">
<field-map field-name="parentProductCategoryId" env-name="parameters.oldProductCategoryId"/>
</entity-and>
@@ -670,14 +670,14 @@ under the License.
<set field="newEntity.productCategoryId" from-field="parameters.productCategoryId"/>
<!-- don't set the fromDate yet; let's get the seq ID first -->
<if-empty field-name="parameters.linkSeqId">
<if-empty field="parameters.linkSeqId">
<make-next-seq-id value-name="newEntity" seq-field-name="linkSeqId"/> <!-- this finds the next sub-sequence ID -->
<set from-field="linkSeqId" field="newEntity.linkSeqId"/>
</if-empty>
<!-- now set the rest of the PK fields (should just be fromDate now; unless linkSeqId is not empty -->
<set-pk-fields value-name="newEntity" map-name="parameters"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -703,16 +703,16 @@ under the License.
<!-- a methods to centralize product security code, meant to be called in-line with
call-simple-method, and the checkAction and callingMethodName attributes should be in the method context -->
<simple-method method-name="checkCategoryRelatedPermission" short-description="Check Product Category Related Permission">
<if-empty field-name="callingMethodName">
<if-empty field="callingMethodName">
<set field="callingMethodName" value="this operation"/>
</if-empty>
<if-empty field-name="checkAction">
<if-empty field="checkAction">
<set field="checkAction" value="UPDATE"/>
</if-empty>
<if-empty field-name="productCategoryIdName">
<if-empty field="productCategoryIdName">
<set field="productCategoryIdName" value="productCategoryId"/>
</if-empty>
<if-empty field-name="productCategoryIdToCheck">
<if-empty field="productCategoryIdToCheck">
<set field="productCategoryIdToCheck" from-field="parameters.${productCategoryIdName}"/>
</if-empty>
@@ -739,7 +739,7 @@ under the License.
<if-has-permission permission="CATALOG" action="_${checkAction}"/>
<and>
<if-has-permission permission="CATALOG_ROLE" action="_${checkAction}"/>
<not><if-empty field-name="roleCategories"/></not>
<not><if-empty field="roleCategories"/></not>
</and>
</or>
</not>
@@ -753,7 +753,7 @@ under the License.
</simple-method>
<simple-method method-name="productCategoryGenericPermission" short-description="Main permission logic">
<set field="mainAction" from-field="parameters.mainAction"/>
<if-empty field-name="mainAction">
<if-empty field="mainAction">
<add-error><fail-message message="In the permission-service element for the productGenericPermission service the main-action attribute was missing but is required"/></add-error>
<check-errors/>
</if-empty>
@@ -762,7 +762,7 @@ under the License.
<set field="checkAction" from-field="parameters.mainAction"/>
<call-simple-method method-name="checkCategoryRelatedPermission"/>
<if-empty field-name="error_list">
<if-empty field="error_list">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
@@ -781,7 +781,7 @@ under the License.
<call-service service-name="productCategoryGenericPermission" in-map-name="productCategoryGenericPermissionMap">
<results-to-map map-name="genericResult"/>
</call-service>
<if-compare field-name="genericResult.hasPermission" operator="equals" value="false" type="Boolean">
<if-compare field="genericResult.hasPermission" operator="equals" value="false" type="Boolean">
<field-to-result field-name="genericResult.hasPermission" result-name="hasPermission"/>
<field-to-result field-name="genericResult.failMessage" map-name="failMessage"/>
<return/>
@@ -811,7 +811,7 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="prodCatalog.viewAllowPermReqd" operator="equals" value="Y"/>
<if-compare field="prodCatalog.viewAllowPermReqd" operator="equals" value="Y"/>
<not><if-has-permission permission="CATALOG_VIEW_ALLOW"/></not>
</and>
</condition>
@@ -824,7 +824,7 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="prodCatalog.purchaseAllowPermReqd" operator="equals" value="Y"/>
<if-compare field="prodCatalog.purchaseAllowPermReqd" operator="equals" value="Y"/>
<not><if-has-permission permission="CATALOG_PURCHASE_ALLOW"/></not>
</and>
</condition>
@@ -34,7 +34,7 @@ under the License.
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<set field="newEntity.fromDate" from-field="nowTimestamp" />
</if-empty>
<field-to-result field-name="fromDate" map-name="newEntity"/>
@@ -26,7 +26,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp" />
</if-empty>
@@ -26,7 +26,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<sequenced-id-to-env sequence-name="CostComponent" env-name="newEntity.costComponentId"/>
<field-to-result field-name="costComponentId" map-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
<create-value value-name="newEntity"/>
@@ -67,7 +67,7 @@ under the License.
<make-value value-name="newEntity" entity-name="CostComponent"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<sequenced-id-to-env sequence-name="CostComponent" env-name="newEntity.costComponentId"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
<create-value value-name="newEntity"/>
@@ -108,14 +108,14 @@ under the License.
</calcop>
</calculate>
<!-- if the cost is zero, and the product is a variant, get the cost of the virtual -->
<if-compare field-name="productCost" operator="equals" value="0" type="Double">
<if-compare field="productCost" operator="equals" value="0" type="Double">
<entity-one entity-name="Product" value-name="product"/>
<set from-field="product.productId" field="assocAndMap.productIdTo"/>
<set value="PRODUCT_VARIANT" field="assocAndMap.productAssocTypeId"/>
<find-by-and entity-name="ProductAssoc" map-name="assocAndMap" list-name="virtualAssocs"/>
<filter-list-by-date list-name="virtualAssocs"/>
<first-from-list list-name="virtualAssocs" entry-name="virtualAssoc"/>
<if-not-empty field-name="virtualAssoc">
<if-not-empty field="virtualAssoc">
<set from-field="virtualAssoc.productId" field="inputMap.productId"/>
<set from-field="parameters.currencyUomId" field="inputMap.currencyUomId"/>
<set from-field="parameters.costComponentTypePrefix" field="inputMap.costComponentTypePrefix"/>
@@ -125,7 +125,7 @@ under the License.
</if-not-empty>
</if-compare>
<!-- if the cost is zero, get the purchase cost from the SupplierProduct -->
<if-compare field-name="productCost" operator="equals" value="0" type="Double">
<if-compare field="productCost" operator="equals" value="0" type="Double">
<set field="orderByList[]" value="+supplierPrefOrderId"/>
<set field="orderByList[]" value="+lastPrice"/>
<clear-field field-name="costsAndMap"/>
@@ -134,20 +134,20 @@ under the License.
<find-by-and entity-name="SupplierProduct" map-name="costsAndMap" list-name="priceCosts" order-by-list-name="orderByList"/>
<filter-list-by-date list-name="priceCosts" from-field-name="availableFromDate" thru-field-name="availableThruDate"/>
<first-from-list list-name="priceCosts" entry-name="priceCost"/>
<if-not-empty field-name="priceCost.lastPrice">
<if-not-empty field="priceCost.lastPrice">
<set from-field="priceCost.lastPrice" field="productCost"/>
</if-not-empty>
<!-- if the cost is zero, get the purchase cost from the SupplierProduct
in a different currency and try to convert
-->
<if-compare field-name="productCost" operator="equals" value="0" type="Double">
<if-compare field="productCost" operator="equals" value="0" type="Double">
<clear-field field-name="costsAndMap"/>
<set from-field="parameters.productId" field="costsAndMap.productId"/>
<set from-field="parameters.productPriceTypeId" field="costsAndMap.productPriceTypeId"/>
<find-by-and entity-name="SupplierProduct" map-name="costsAndMap" list-name="priceCosts" order-by-list-name="orderByList"/>
<filter-list-by-date list-name="priceCosts" from-field-name="availableFromDate" thru-field-name="availableThruDate"/>
<first-from-list list-name="priceCosts" entry-name="priceCost"/>
<if-not-empty field-name="priceCost.lastPrice">
<if-not-empty field="priceCost.lastPrice">
<!-- we try to convert the lastPrice to the desired currency -->
<clear-field field-name="inputMap"/>
<set from-field="priceCost.lastPrice" field="inputMap.originalValue"/>
@@ -160,7 +160,7 @@ under the License.
</if-compare>
</if-compare>
<!--
<if-compare field-name="productCost" operator="equals" value="0" type="Double">
<if-compare field="productCost" operator="equals" value="0" type="Double">
<clear-field field-name="costsAndMap"/>
<set from-field="parameters.productId" field="costsAndMap.productId"/>
<set from-field="parameters.currencyUomId" field="costsAndMap.currencyUomId"/>
@@ -168,7 +168,7 @@ under the License.
<find-by-and entity-name="ProductPrice" map-name="costsAndMap" list-name="priceCosts"/>
<filter-list-by-date list-name="priceCosts"/>
<first-from-list list-name="priceCosts" entry-name="priceCost"/>
<if-not-empty field-name="priceCost.price">
<if-not-empty field="priceCost.price">
<set from-field="priceCost.price" field="productCost"/>
</if-not-empty>
</if-compare>
@@ -191,7 +191,7 @@ under the License.
</calculate>
<entity-one entity-name="WorkEffort" value-name="task"/>
<if-not-empty field-name="task">
<if-not-empty field="task">
<get-related-one value-name="task" relation-name="FixedAsset" to-value-name="fixedAsset"/>
<set from-field="parameters.currencyUomId" field="costsAndMap.amountUomId"/>
<set value="SETUP_COST" field="costsAndMap.fixedAssetStdCostTypeId"/>
@@ -251,7 +251,7 @@ under the License.
<call-service service-name="getManufacturingComponents" in-map-name="callSvcMap">
<result-to-field result-name="componentsMap"/>
</call-service>
<if-not-empty field-name="componentsMap">
<if-not-empty field="componentsMap">
<iterate entry-name="componentMap" list-name="componentsMap">
<clear-field field-name="inputMap"/>
<set field="product" from-field="componentMap.product"/>
@@ -311,8 +311,8 @@ under the License.
</calculate>
<!-- The CostComponent records are created. -->
<if-not-empty field-name="totalTaskCost">
<if-compare field-name="totalTaskCost" operator="greater" value="0" type="Double">
<if-not-empty field="totalTaskCost">
<if-compare field="totalTaskCost" operator="greater" value="0" type="Double">
<clear-field field-name="callSvcMap"/>
<set value="${parameters.costComponentTypePrefix}_ROUTE_COST" field="callSvcMap.costComponentTypeId"/>
<set from-field="parameters.productId" field="callSvcMap.productId"/>
@@ -321,8 +321,8 @@ under the License.
<call-service service-name="recreateCostComponent" in-map-name="callSvcMap"/>
</if-compare>
</if-not-empty>
<if-not-empty field-name="totalProductsCost">
<if-compare field-name="totalProductsCost" operator="greater" value="0" type="Double">
<if-not-empty field="totalProductsCost">
<if-compare field="totalProductsCost" operator="greater" value="0" type="Double">
<clear-field field-name="callSvcMap"/>
<set value="${parameters.costComponentTypePrefix}_MAT_COST" field="callSvcMap.costComponentTypeId"/>
<set from-field="parameters.productId" field="callSvcMap.productId"/>
@@ -68,7 +68,7 @@ under the License.
<call-simple-method method-name="checkProductRelatedPermission" xml-resource="org/ofbiz/product/product/ProductServices.xml"/>
<check-errors/>
<if-empty field-name="parameters.fromDate">
<if-empty field="parameters.fromDate">
<now-timestamp-to-env env-name="parameters.fromDate"/>
</if-empty>
<make-value value-name="newEntity" entity-name="ProductFeatureAppl"/>
@@ -94,7 +94,7 @@ under the License.
<entity-one entity-name="ProductFeatureAppl" value-name="productFeatureAppl"/>
<!-- This is old code that just sets the thru date; the current codes actually removes the db row
<if-empty field-name="thruDate" map-name="parameters">
<if-empty field="parameters.thruDate">
<now-timestamp-to-env env-name="nowStamp"/>
<env-to-field env-name="nowStamp" field-name="thruDate" map-name="parameters"/>
</if-empty>
@@ -120,7 +120,7 @@ under the License.
<set-service-fields service-name="applyFeatureToProduct" map-name="parameters" to-map-name="applyFeatureContext"/>
<set field="applyFeatureContext.productFeatureId" from-field="productFeature.productFeatureId"/>
<if-empty field-name="applyFeatureContext.sequenceNum">
<if-empty field="applyFeatureContext.sequenceNum">
<set field="applyFeatureContext.sequenceNum" from-field="productFeature.defaultSequenceNum"/>
</if-empty>
@@ -137,7 +137,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -172,7 +172,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -227,7 +227,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -311,7 +311,7 @@ under the License.
<make-value value-name="newEntity" entity-name="ProductFeatureApplAttr"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<entity-condition entity-name="ProductFeatureAppl" list-name="productFeatureAppls" filter-by-date="true">
<condition-list combine="and">
<condition-expr field-name="productId" env-name="newEntity.productId"/>
@@ -354,7 +354,7 @@ under the License.
<!-- Feature Price Service -->
<simple-method method-name="createFeaturePrice" short-description="Create a Feature Price">
<make-value value-name="newEntity" entity-name="ProductFeaturePrice"/>
<if-empty field-name="parameters.productFeatureId">
<if-empty field="parameters.productFeatureId">
<sequenced-id-to-env sequence-name="ProductFeaturePrice" env-name="parameters.productFeatureId"/>
</if-empty>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -362,7 +362,7 @@ under the License.
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<set field="newEntity.fromDate" from-field="nowTimestamp" />
</if-empty>
<field-to-result field-name="fromDate" map-name="newEntity"/>
@@ -27,8 +27,8 @@ under the License.
<field-map field-name="productStoreId" env-name="orderHeader.productStoreId"/>
</entity-one>
<if-not-empty field-name="orderHeader">
<if-compare field-name="orderHeader.needsInventoryIssuance" operator="equals" value="Y">
<if-not-empty field="orderHeader">
<if-compare field="orderHeader.needsInventoryIssuance" operator="equals" value="Y">
<get-related list-name="orderItemList" relation-name="OrderItem" value-name="orderHeader"/>
<!-- before issuing inventory, check to see if there is inventory information in this database -->
@@ -38,9 +38,9 @@ under the License.
</entity-count>
<!-- now go through each order item and call a service to issue the inventory -->
<if-compare field-name="iiCount" operator="greater" value="0" type="Double">
<if-compare field="iiCount" operator="greater" value="0" type="Double">
<iterate list-name="orderItemList" entry-name="orderItem">
<if-not-empty field-name="orderItem.productId">
<if-not-empty field="orderItem.productId">
<clear-field field-name="callSvcMap"/>
<set-service-fields to-map-name="callSvcMap" service-name="issueImmediatelyFulfilledOrderItem" map-name="orderItem"/>
<set field="callSvcMap.orderHeader" from-field="orderHeader" />
@@ -61,7 +61,7 @@ under the License.
</if-not-empty>
</simple-method>
<simple-method method-name="issueImmediatelyFulfilledOrderItem" short-description="Issues the Inventory for an Order Item that was Immediately Fulfilled" login-required="false">
<if-empty field-name="parameters.orderItem">
<if-empty field="parameters.orderItem">
<entity-one entity-name="OrderItem" value-name="orderItem"/>
<else>
<set field="orderItem" from-field="parameters.orderItem" />
@@ -69,11 +69,11 @@ under the License.
</if-empty>
<!-- kind of like the inventory reservation routine (with a few variations...), find InventoryItems to issue from, but instead of doing the reservation just create an issuance and an inventory item detail for the change -->
<if-not-empty field-name="orderItem.productId">
<if-not-empty field="orderItem.productId">
<now-timestamp-to-env env-name="nowTimestamp"/>
<!-- NOTE: the inventory will be issued from the OrderHeader.originFacilityId -->
<if-empty field-name="parameters.orderHeader">
<if-empty field="parameters.orderHeader">
<entity-one entity-name="OrderHeader" value-name="orderHeader"/>
<else>
<set field="orderHeader" from-field="parameters.orderHeader" />
@@ -81,7 +81,7 @@ under the License.
</if-empty>
<!-- get the ProductStore to fund the reserveOrderEnumId -->
<if-empty field-name="parameters.productStore">
<if-empty field="parameters.productStore">
<entity-one entity-name="ProductStore" value-name="productStore">
<field-map field-name="productStoreId" env-name="orderHeader.productStoreId"/>
</entity-one>
@@ -91,13 +91,13 @@ under the License.
</if-empty>
<!-- before we do the find, put together the orderBy list based on which reserveOrderEnumId is specified -->
<if-compare value="INVRO_FIFO_EXP" operator="equals" field-name="productStore.reserveOrderEnumId">
<if-compare value="INVRO_FIFO_EXP" operator="equals" field="productStore.reserveOrderEnumId">
<set field="orderByString" value="+expireDate" />
<else>
<if-compare value="INVRO_LIFO_EXP" operator="equals" field-name="productStore.reserveOrderEnumId">
<if-compare value="INVRO_LIFO_EXP" operator="equals" field="productStore.reserveOrderEnumId">
<set field="orderByString" value="-expireDate" />
<else>
<if-compare value="INVRO_LIFO_REC" operator="equals" field-name="productStore.reserveOrderEnumId">
<if-compare value="INVRO_LIFO_REC" operator="equals" field="productStore.reserveOrderEnumId">
<set field="orderByString" value="+datetimeReceived" />
<else>
<!-- the default reserveOrderEnumId is INVRO_FIFO_REC, ie FIFO based on date received -->
@@ -121,8 +121,8 @@ under the License.
</iterate>
<!-- if quantityNotIssued is not 0, then pull it from the last non-serialized inventory item found, in the quantityNotIssued field -->
<if-compare field-name="parameters.quantityNotIssued" operator="not-equals" value="0" type="Double">
<if-not-empty field-name="lastNonSerInventoryItem">
<if-compare field="parameters.quantityNotIssued" operator="not-equals" value="0" type="Double">
<if-not-empty field="lastNonSerInventoryItem">
<!-- create ItemIssuance record -->
<set field="issuanceCreateMap.orderId" from-field="parameters.orderId" />
<set field="issuanceCreateMap.orderItemSeqId" from-field="parameters.orderItemSeqId" />
@@ -192,9 +192,9 @@ under the License.
</simple-method>
<simple-method method-name="issueImmediateForInventoryItemInline" short-description="Does a issuance for one InventoryItem, meant to be called in-line">
<!-- only do something with this inventoryItem if there is more inventory to issue -->
<if-compare field-name="parameters.quantityNotIssued" operator="greater" value="0" type="Double">
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field-name="inventoryItemTypeId" map-name="inventoryItem">
<if-compare value="INV_AVAILABLE" operator="equals" field-name="statusId" map-name="inventoryItem">
<if-compare field="parameters.quantityNotIssued" operator="greater" value="0" type="Double">
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId">
<if-compare value="INV_AVAILABLE" operator="equals" field="inventoryItem.statusId">
<!-- change status on inventoryItem -->
<set field="inventoryItem.statusId" value="INV_DELIVERED" />
<set-service-fields service-name="updateInventoryItem" map-name="inventoryItem" to-map-name="inventoryItemMap"/>
@@ -213,18 +213,18 @@ under the License.
</calculate>
</if-compare>
</if-compare>
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<!-- reduce atp on inventoryItem if availableToPromise greater than 0, if not the code at the end of this method will handle it -->
<if>
<condition>
<and>
<if-empty field-name="inventoryItem.statusId"/>
<not><if-empty field-name="inventoryItem.availableToPromiseTotal"/></not>
<if-compare field-name="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double"/>
<if-empty field="inventoryItem.statusId"/>
<not><if-empty field="inventoryItem.availableToPromiseTotal"/></not>
<if-compare field="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double"/>
</and>
</condition>
<then>
<if-compare-field field-name="parameters.quantityNotIssued" operator="greater" to-field-name="inventoryItem.availableToPromiseTotal" type="Double">
<if-compare-field field="parameters.quantityNotIssued" to-field="inventoryItem.availableToPromiseTotal" operator="greater" type="Double">
<set field="parameters.deductAmount" from-field="inventoryItem.availableToPromiseTotal" />
<else>
<set field="parameters.deductAmount" from-field="parameters.quantityNotIssued" />
@@ -40,7 +40,7 @@ under the License.
<entity-one entity-name="Product" value-name="product"/>
<entity-one entity-name="Facility" value-name="facility" use-cache="true"/>
<get-related-one value-name="product" relation-name="ProductType" to-value-name="productType"/>
<if-compare field-name="productType.isPhysical" operator="equals" value="N">
<if-compare field="productType.isPhysical" operator="equals" value="N">
<set field="parameters.quantityNotReserved" value="0" type="Double"/>
<else>
<entity-one entity-name="OrderHeader" value-name="orderHeader"/>
@@ -49,19 +49,19 @@ under the License.
<!-- FIFO=first in first out, so it should be order by ASCending receive or expire date
LIFO=last in first out, so it means order by DESCending receive or expire date
-->
<if-compare value="INVRO_GUNIT_COST" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_GUNIT_COST" operator="equals" field="parameters.reserveOrderEnumId">
<set value="-unitCost" field="orderByString"/>
<else>
<if-compare value="INVRO_LUNIT_COST" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_LUNIT_COST" operator="equals" field="parameters.reserveOrderEnumId">
<set value="+unitCost" field="orderByString"/>
<else>
<if-compare value="INVRO_FIFO_EXP" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_FIFO_EXP" operator="equals" field="parameters.reserveOrderEnumId">
<set value="+expireDate" field="orderByString"/>
<else>
<if-compare value="INVRO_LIFO_EXP" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_LIFO_EXP" operator="equals" field="parameters.reserveOrderEnumId">
<set value="-expireDate" field="orderByString"/>
<else>
<if-compare value="INVRO_LIFO_REC" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_LIFO_REC" operator="equals" field="parameters.reserveOrderEnumId">
<set value="-datetimeReceived" field="orderByString"/>
<else>
<!-- the default reserveOrderEnumId is INVRO_FIFO_REC, ie FIFO based on date received -->
@@ -92,7 +92,7 @@ under the License.
<order-by field-name="${orderByString}"/>
</entity-condition>
<iterate entry-name="inventoryItemAndLocation" list-name="inventoryItemAndLocations">
<if-compare field-name="inventoryItemAndLocation.locationTypeEnumId" operator="equals" value="FLT_PICKLOC">
<if-compare field="inventoryItemAndLocation.locationTypeEnumId" operator="equals" value="FLT_PICKLOC">
<!-- this is a little trick to get the InventoryItem value object without doing a query, possible since all fields on InventoryItem are also on InventoryItemAndLocation with the same names -->
<make-value entity-name="InventoryItem" map-name="inventoryItemAndLocation" value-name="inventoryItem"/>
<call-simple-method method-name="reserveForInventoryItemInline"/>
@@ -100,7 +100,7 @@ under the License.
</iterate>
<!-- still some left? try the FLT_BULK locations -->
<if-compare field-name="parameters.quantityNotReserved" operator="greater" value="0" type="Double">
<if-compare field="parameters.quantityNotReserved" operator="greater" value="0" type="Double">
<entity-condition entity-name="InventoryItemAndLocation" list-name="inventoryItemAndLocations">
<condition-list combine="and">
<condition-expr field-name="productId" env-name="parameters.productId"/>
@@ -112,7 +112,7 @@ under the License.
<order-by field-name="${orderByString}"/>
</entity-condition>
<iterate entry-name="inventoryItemAndLocation" list-name="inventoryItemAndLocations">
<if-compare field-name="inventoryItemAndLocation.locationTypeEnumId" operator="equals" value="FLT_BULK">
<if-compare field="inventoryItemAndLocation.locationTypeEnumId" operator="equals" value="FLT_BULK">
<!-- this is a little trick to get the InventoryItem value object without doing a query, possible since all fields on InventoryItem are also on InventoryItemAndLocation with the same names -->
<make-value entity-name="InventoryItem" map-name="inventoryItemAndLocation" value-name="inventoryItem"/>
<call-simple-method method-name="reserveForInventoryItemInline"/>
@@ -121,7 +121,7 @@ under the License.
</if-compare>
<!-- last of all try reserving in InventoryItems that have no locationSeqId, ie are not in any particular location -->
<if-compare field-name="parameters.quantityNotReserved" operator="greater" value="0" type="Double">
<if-compare field="parameters.quantityNotReserved" operator="greater" value="0" type="Double">
<entity-condition entity-name="InventoryItem" list-name="inventoryItems">
<condition-list combine="and">
<condition-expr field-name="productId" env-name="parameters.productId"/>
@@ -133,7 +133,7 @@ under the License.
<order-by field-name="${orderByString}"/>
</entity-condition>
<iterate entry-name="inventoryItem" list-name="inventoryItems">
<if-empty field-name="inventoryItem.locationSeqId">
<if-empty field="inventoryItem.locationSeqId">
<call-simple-method method-name="reserveForInventoryItemInline"/>
</if-empty>
</iterate>
@@ -144,11 +144,11 @@ under the License.
- subtract the remaining quantityNotReserved from the availableToPromise of the last non-serialized inventory item
- or if none was found create a non-ser InventoryItem with availableToPromise = -quantityNotReserved
-->
<if-compare field-name="parameters.quantityNotReserved" operator="not-equals" value="0" type="Double">
<if-compare field-name="parameters.requireInventory" operator="equals" value="Y">
<if-compare field="parameters.quantityNotReserved" operator="not-equals" value="0" type="Double">
<if-compare field="parameters.requireInventory" operator="equals" value="Y">
<!-- use this else pattern to accomplish the anything but Y logic, ie if not specified default to inventory NOT required -->
<else>
<if-not-empty field-name="lastNonSerInventoryItem">
<if-not-empty field="lastNonSerInventoryItem">
<!-- subtract from quantityNotReserved from the availableToPromise of existing inventory item -->
<!-- instead of updating InventoryItem, add an InventoryItemDetail -->
<set from-field="lastNonSerInventoryItem.inventoryItemId" field="createDetailMap.inventoryItemId"/>
@@ -165,9 +165,9 @@ under the License.
<get-related-one value-name="lastNonSerInventoryItem" relation-name="ProductFacility" to-value-name="productFacility"/>
<clear-field field-name="daysToShip"/>
<set field="daysToShip" from-field="productFacility.daysToShip"/>
<if-empty field-name="daysToShip">
<if-empty field="daysToShip">
<!-- if the product does not have its own days to ship, use Facility.defaultDaysToShip, if not then use 30 days as a USA industry default -->
<if-not-empty field-name="facility.defaultDaysToShip">
<if-not-empty field="facility.defaultDaysToShip">
<set field="daysToShip" from-field="facility.defaultDaysToShip" type="Long"/>
<else>
<set field="daysToShip" value="30" type="Long"/>
@@ -230,9 +230,9 @@ under the License.
<get-related-one value-name="newNonSerInventoryItem" relation-name="ProductFacility" to-value-name="productFacility"/>
<clear-field field-name="daysToShip"/>
<set field="daysToShip" from-field="productFacility.daysToShip"/>
<if-empty field-name="daysToShip">
<if-empty field="daysToShip">
<!-- if the product does not have its own days to ship, use Facility.defaultDaysToShip, if not then use 30 days as a USA industry default -->
<if-not-empty field-name="facility.defaultDaysToShip">
<if-not-empty field="facility.defaultDaysToShip">
<set field="daysToShip" from-field="facility.defaultDaysToShip" type="Long"/>
<else>
<set field="daysToShip" value="30" type="Long"/>
@@ -282,7 +282,7 @@ under the License.
<entity-one entity-name="InventoryItem" value-name="inventoryItem"/>
<set field="facilityId" from-field="inventoryItem.facilityId"/>
<set field="inventoryReservationLookUp.inventoryItemId" from-field="inventoryItem.inventoryItemId"/>
<if-compare value="NON_SERIAL_INV_ITEM" operator="equals" field-name="inventoryItem.inventoryItemTypeId">
<if-compare value="NON_SERIAL_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId">
<!-- Reservation was holding on to a InventoryItem shadow, Reduce number of Shadow's available -->
<set from-field="inventoryItem.inventoryItemId" field="createDetailMap.inventoryItemId"/>
<set from-field="parameters.orderId" field="createDetailMap.orderId"/>
@@ -304,7 +304,7 @@ under the License.
<clear-field field-name="inventoryItem"/>
<first-from-list list-name="inventoryItems" entry-name="inventoryItem"/>
<!-- If no inventory item found for the serial number, than create it -->
<if-empty field-name="inventoryItem">
<if-empty field="inventoryItem">
<set field="receiveCtx.productId" from-field="parameters.productId"/>
<set field="receiveCtx.facilityId" from-field="facilityId"/>
<set field="receiveCtx.quantityAccepted" from-field="parameters.quantity"/>
@@ -320,7 +320,7 @@ under the License.
<set field="inventoryReservationLookUp.inventoryItemId" from-field="inventoryItem.inventoryItemId"/>
<find-by-and map-name="inventoryReservationLookUp" list-name="invReservations" entity-name="OrderItemShipGrpInvRes"/>
<first-from-list entry-name="inventoryItemReservation" list-name="invReservations"/>
<if-not-empty field-name="inventoryItemReservation">
<if-not-empty field="inventoryItemReservation">
<set-service-fields map-name="inventoryItemReservation" to-map-name="cancelOrderItemShipGrpInvResMap" service-name="cancelOrderItemShipGrpInvRes"/>
<call-service service-name="cancelOrderItemShipGrpInvRes" in-map-name="cancelOrderItemShipGrpInvResMap"/>
<!-- Hold our inventoryItem -->
@@ -337,7 +337,7 @@ under the License.
<set from-field="inventoryItemReservation.reservedDatetime" field="reserveOisgirMap.reservedDatetime"/>
<set field="reserveOisgirMap.quantity" value="1" type="Double"/>
<set field="reserveOisgirMap.requireInventory" from-field="parameters.requireInventory"/>
<if-not-empty field-name="inventoryItemReservation.sequenceId">
<if-not-empty field="inventoryItemReservation.sequenceId">
<set field="reserveOisgirMap.sequenceId" from-field="inventoryItemReservation.sequenceId"/>
</if-not-empty>
<call-service service-name="reserveProductInventory" in-map-name="reserveOisgirMap"/>
@@ -345,7 +345,7 @@ under the License.
</if-not-empty>
<!-- Step 3 Now Reserve for our order-->
<if-compare value="INV_AVAILABLE" operator="equals" field-name="statusId" map-name="inventoryItem">
<if-compare value="INV_AVAILABLE" operator="equals" field="inventoryItem.statusId">
<!-- change status on inventoryItem -->
<set value="INV_PROMISED" field="inventoryItem.statusId"/>
<store-value value-name="inventoryItem"/>
@@ -358,7 +358,7 @@ under the License.
<set from-field="parameters.reservedDatetime" field="reserveOisgirMap.reservedDatetime"/>
<set from-field="promisedDatetime" field="reserveOisgirMap.promisedDatetime"/>
<set field="reserveOisgirMap.quantity" value="1" type="Double"/>
<if-not-empty field-name="parameters.sequenceId">
<if-not-empty field="parameters.sequenceId">
<set field="reserveOisgirMap.sequenceId" from-field="parameters.sequenceId"/>
</if-not-empty>
<!-- store OrderItemShipGrpInvRes record -->
@@ -369,13 +369,13 @@ under the License.
<simple-method method-name="reserveForInventoryItemInline" short-description="Does a reservation for one InventoryItem, meant to be called in-line">
<!-- only do something with this inventoryItem if there is more inventory to reserve -->
<if-compare field-name="parameters.quantityNotReserved" operator="greater" value="0" type="Double">
<if-compare field="parameters.quantityNotReserved" operator="greater" value="0" type="Double">
<!-- get the promiseDatetime -->
<get-related-one value-name="inventoryItem" relation-name="ProductFacility" to-value-name="productFacility"/>
<set field="daysToShip" from-field="productFacility.daysToShip"/>
<if-empty field-name="daysToShip">
<if-empty field="daysToShip">
<!-- if the product does not have its own days to ship, use Facility.defaultDaysToShip, if not then use 30 days as a USA industry default -->
<if-not-empty field-name="facility.defaultDaysToShip">
<if-not-empty field="facility.defaultDaysToShip">
<set field="daysToShip" from-field="facility.defaultDaysToShip" type="Long"/>
<else>
<set field="daysToShip" value="30" type="Long"/>
@@ -390,8 +390,8 @@ under the License.
return org.ofbiz.base.util.UtilMisc.toMap("promisedDatetime", new java.sql.Timestamp(cal.getTimeInMillis()));
]]></call-bsh>
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field-name="inventoryItemTypeId" map-name="inventoryItem">
<if-compare value="INV_AVAILABLE" operator="equals" field-name="statusId" map-name="inventoryItem">
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId">
<if-compare value="INV_AVAILABLE" operator="equals" field="inventoryItem.statusId">
<!-- change status on inventoryItem -->
<set value="INV_PROMISED" field="inventoryItem.statusId"/>
<store-value value-name="inventoryItem"/>
@@ -405,7 +405,7 @@ under the License.
<set from-field="parameters.reservedDatetime" field="reserveOisgirMap.reservedDatetime"/>
<set from-field="promisedDatetime" field="reserveOisgirMap.promisedDatetime"/>
<set field="reserveOisgirMap.quantity" value="1" type="Double"/>
<if-not-empty field-name="parameters.sequenceId">
<if-not-empty field="parameters.sequenceId">
<set field="reserveOisgirMap.sequenceId" from-field="parameters.sequenceId"/>
</if-not-empty>
<call-service service-name="reserveOrderItemInventory" in-map-name="reserveOisgirMap"/>
@@ -416,18 +416,18 @@ under the License.
</calculate>
</if-compare>
</if-compare>
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<!-- reduce atp on inventoryItem if availableToPromise greater than 0, if not the code at the end of this method will handle it -->
<if>
<condition>
<and>
<if-empty field-name="inventoryItem.statusId"/>
<not><if-empty field-name="inventoryItem.availableToPromiseTotal"/></not>
<if-compare field-name="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double"/>
<if-empty field="inventoryItem.statusId"/>
<not><if-empty field="inventoryItem.availableToPromiseTotal"/></not>
<if-compare field="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double"/>
</and>
</condition>
<then>
<if-compare-field field-name="parameters.quantityNotReserved" operator="greater" to-field-name="inventoryItem.availableToPromiseTotal" type="Double">
<if-compare-field field="parameters.quantityNotReserved" to-field="inventoryItem.availableToPromiseTotal" operator="greater" type="Double">
<set from-field="inventoryItem.availableToPromiseTotal" field="parameters.deductAmount"/>
<else>
<set from-field="parameters.quantityNotReserved" field="parameters.deductAmount"/>
@@ -453,7 +453,7 @@ under the License.
<set from-field="parameters.reservedDatetime" field="reserveOisgirMap.reservedDatetime"/>
<set from-field="parameters.deductAmount" field="reserveOisgirMap.quantity"/>
<set from-field="promisedDatetime" field="reserveOisgirMap.promisedDatetime"/>
<if-not-empty field-name="parameters.sequenceId">
<if-not-empty field="parameters.sequenceId">
<set field="reserveOisgirMap.sequenceId" from-field="parameters.sequenceId"/>
</if-not-empty>
<call-service service-name="reserveOrderItemInventory" in-map-name="reserveOisgirMap"/>
@@ -480,14 +480,14 @@ under the License.
<set field="parameters.promisedDatetime" from-field="orderItem.shipBeforeDate"/>
<set field="parameters.currentPromisedDate" from-field="orderItem.shipBeforeDate"/>
<if-empty field-name="checkOisgirEntity">
<if-empty field="checkOisgirEntity">
<!-- create OrderItemShipGrpInvRes record -->
<make-value entity-name="OrderItemShipGrpInvRes" value-name="newOisgirEntity"/>
<set-pk-fields map-name="parameters" value-name="newOisgirEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newOisgirEntity"/>
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newOisgirEntity.createdDatetime"/>
<if-empty field-name="newOisgirEntity.reservedDatetime">
<if-empty field="newOisgirEntity.reservedDatetime">
<set from-field="nowTimestamp" field="newOisgirEntity.reservedDatetime"/>
</if-empty>
<create-value value-name="newOisgirEntity"/>
@@ -514,11 +514,11 @@ under the License.
corresponding serialized inventoryItem to available.
-->
<set from-field="parameters.orderId" field="oisgirListLookupMap.orderId"/>
<if-not-empty field-name="parameters.orderItemSeqId">
<if-not-empty field="parameters.orderItemSeqId">
<set from-field="parameters.orderItemSeqId" field="oisgirListLookupMap.orderItemSeqId"/>
<log level="verbose" message="OISGIR Cancel for single item : ${oisgirListLookupMap}"/>
</if-not-empty>
<if-not-empty field-name="parameters.shipGroupSeqId">
<if-not-empty field="parameters.shipGroupSeqId">
<set from-field="parameters.shipGroupSeqId" field="oisgirListLookupMap.shipGroupSeqId"/>
<log level="verbose" message="OISGIR Cancel for single item : ${oisgirListLookupMap}"/>
</if-not-empty>
@@ -539,13 +539,13 @@ under the License.
This will cancel the specified amount by looking through the reservations in order and cancelling
just the right amount
-->
<if-empty field-name="parameters.cancelQuantity">
<if-empty field="parameters.cancelQuantity">
<set from-field="parameters.orderId" field="cancelMap.orderId"/>
<set from-field="parameters.orderItemSeqId" field="cancelMap.orderItemSeqId"/>
<set from-field="parameters.shipGroupSeqId" field="cancelMap.shipGroupSeqId"/>
<call-service service-name="cancelOrderInventoryReservation" in-map-name="cancelMap"/>
</if-empty>
<if-not-empty field-name="parameters.cancelQuantity">
<if-not-empty field="parameters.cancelQuantity">
<set from-field="parameters.cancelQuantity" field="toCancelAmount"/>
<set from-field="parameters.orderId" field="oisgirListLookupMap.orderId"/>
@@ -553,11 +553,11 @@ under the License.
<set from-field="parameters.shipGroupSeqId" field="oisgirListLookupMap.shipGroupSeqId"/>
<find-by-and entity-name="OrderItemShipGrpInvRes" map-name="oisgirListLookupMap" list-name="oisgirList" use-cache="false"/>
<iterate entry-name="oisgir" list-name="oisgirList">
<if-compare field-name="toCancelAmount" operator="greater" value="0" type="Double">
<if-compare-field field-name="oisgir.quantity" operator="greater-equals" to-field-name="toCancelAmount" type="Double">
<if-compare field="toCancelAmount" operator="greater" value="0" type="Double">
<if-compare-field field="oisgir.quantity" to-field="toCancelAmount" operator="greater-equals" type="Double">
<set from-field="toCancelAmount" field="cancelOisgirMap.cancelQuantity"/>
</if-compare-field>
<if-compare-field field-name="oisgir.quantity" operator="less" to-field-name="toCancelAmount" type="Double">
<if-compare-field field="oisgir.quantity" to-field="toCancelAmount" operator="less" type="Double">
<set from-field="oisgir.quantity" field="cancelOisgirMap.cancelQuantity"/>
</if-compare-field>
@@ -582,16 +582,16 @@ under the License.
<simple-method method-name="cancelOrderItemShipGrpInvRes" short-description="Cancel An Inventory Reservation">
<entity-one entity-name="OrderItemShipGrpInvRes" value-name="orderItemShipGrpInvRes"/>
<get-related-one relation-name="InventoryItem" value-name="orderItemShipGrpInvRes" to-value-name="inventoryItem"/>
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field-name="inventoryItem.inventoryItemTypeId">
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId">
<log level="verbose" message="Serialized inventory re-enabled."/>
<set value="INV_AVAILABLE" field="inventoryItem.statusId"/>
<remove-value value-name="orderItemShipGrpInvRes"/>
<store-value value-name="inventoryItem"/>
</if-compare>
<if-compare value="NON_SERIAL_INV_ITEM" operator="equals" field-name="inventoryItem.inventoryItemTypeId">
<if-compare value="NON_SERIAL_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId">
<log level="verbose" message="Non-Serialized inventory item incrementing availableToPromise."/>
<set from-field="parameters.cancelQuantity" field="cancelQuantity"/>
<if-empty field-name="cancelQuantity">
<if-empty field="cancelQuantity">
<set from-field="orderItemShipGrpInvRes.quantity" field="cancelQuantity"/>
</if-empty>
@@ -604,7 +604,7 @@ under the License.
<call-service service-name="createInventoryItemDetail" in-map-name="createDetailMap"/>
<clear-field field-name="createDetailMap"/>
<if-compare-field field-name="cancelQuantity" operator="less" to-field-name="quantity" to-map-name="orderItemShipGrpInvRes" type="Double">
<if-compare-field field="cancelQuantity" to-field="orderItemShipGrpInvRes.quantity" operator="less" type="Double">
<calculate field-name="orderItemShipGrpInvRes.quantity">
<calcop operator="subtract" field-name="orderItemShipGrpInvRes.quantity">
<calcop operator="get" field-name="cancelQuantity"/>
@@ -24,10 +24,10 @@ under the License.
<!-- a method to centralize facility security code, meant to be called in-line with
call-simple-method, and the checkAction and callingMethodName attributes should be in the method context -->
<simple-method method-name="checkFacilityRelatedPermission" short-description="Check Facility Related Permission">
<if-empty field-name="callingMethodName">
<if-empty field="callingMethodName">
<set value="this operation" field="callingMethodName"/>
</if-empty>
<if-empty field-name="checkAction">
<if-empty field="checkAction">
<set value="UPDATE" field="checkAction"/>
</if-empty>
@@ -40,7 +40,7 @@ under the License.
<if-has-permission permission="FACILITY" action="_${checkAction}"/>
<if-has-permission permission="FACILITY_ADMIN"/>
<and>
<not><if-empty field-name="alternatePermissionRoot"/></not>
<not><if-empty field="alternatePermissionRoot"/></not>
<if-has-permission permission="${alternatePermissionRoot}" action="_${checkAction}"/>
</and>
</or>
@@ -53,7 +53,7 @@ under the License.
</simple-method>
<simple-method method-name="facilityGenericPermission" short-description="Main permission logic">
<set field="mainAction" from-field="parameters.mainAction"/>
<if-empty field-name="mainAction">
<if-empty field="mainAction">
<add-error><fail-message message="In the permission-service element for the facilityGenericPermission service the main-action attribute was missing but is required"/></add-error>
<check-errors/>
</if-empty>
@@ -62,7 +62,7 @@ under the License.
<set field="checkAction" from-field="parameters.mainAction"/>
<call-simple-method method-name="checkFacilityRelatedPermission"/>
<if-empty field-name="error_list">
<if-empty field="error_list">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
@@ -75,22 +75,22 @@ under the License.
</if-empty>
</simple-method>
<simple-method method-name="checkProductFacilityRelatedPermission" short-description="ProductFacility Permission Checking Logic">
<if-empty field-name="mainAction">
<if-empty field="mainAction">
<set field="mainAction" from-field="parameters.mainAction"/>
<if-empty field-name="mainAction">
<if-empty field="mainAction">
<add-error><fail-property resource="CommonUiLabels" property="CommonPermissionMainActionAttributeMissing"/></add-error>
</if-empty>
</if-empty>
<check-errors/>
<set field="resourceDescription" from-field="parameters.resourceDescription"/>
<if-empty field-name="resourceDescription">
<if-empty field="resourceDescription">
<property-to-field resource="CommonUiLabels" property="CommonPermissionThisOperation" field-name="resourceDescription"/>
</if-empty>
<set field="callingMethodName" from-field="resourceDescription" />
<set field="checkAction" from-field="mainAction" />
<set field="alternatePermissionRoot" value="FACILITY"/>
<call-simple-method method-name="checkProductRelatedPermission" xml-resource="org/ofbiz/product/product/ProductServices.xml"/>
<if-empty field-name="error_list">
<if-empty field="error_list">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
@@ -121,8 +121,8 @@ under the License.
<if>
<condition>
<or>
<not><if-empty field-name="parameters.availableToPromiseTotal"/></not>
<not><if-empty field-name="parameters.quantityOnHandTotal"/></not>
<not><if-empty field="parameters.availableToPromiseTotal"/></not>
<not><if-empty field="parameters.quantityOnHandTotal"/></not>
</or>
</condition>
<then>
@@ -135,7 +135,7 @@ under the License.
</if>
</simple-method>
<simple-method method-name="inventoryItemCheckSetDefaultValues" short-description="Check and, if empty, fills with default values ownerPartyId, currencyUomId, unitCost" login-required="false">
<if-empty field-name="inventoryItem">
<if-empty field="inventoryItem">
<entity-one entity-name="InventoryItem" value-name="inventoryItem"/>
<set field="updateInventoryItem" value="Y"/>
</if-empty>
@@ -143,28 +143,28 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="inventoryItem.facilityId"/></not>
<not><if-empty field-name="inventoryItem.ownerPartyId"/></not>
<not><if-empty field-name="inventoryItem.currencyUomId"/></not>
<not><if-empty field-name="inventoryItem.unitCost"/></not>
<not><if-empty field="inventoryItem.facilityId"/></not>
<not><if-empty field="inventoryItem.ownerPartyId"/></not>
<not><if-empty field="inventoryItem.currencyUomId"/></not>
<not><if-empty field="inventoryItem.unitCost"/></not>
</and>
</condition>
<then>
<return/>
</then>
</if>
<if-empty field-name="inventoryItem.facilityId">
<if-empty field="inventoryItem.facilityId">
<add-error>
<fail-message message="Error: you cannot create inventory items with no facility id."/>
</add-error>
<check-errors/>
</if-empty>
<!-- if inventoryItem's ownerPartyId is empty, get the ownerPartyId from the facility -->
<if-empty field-name="inventoryItem.ownerPartyId">
<if-empty field="inventoryItem.ownerPartyId">
<get-related-one value-name="inventoryItem" relation-name="Facility" to-value-name="facility"/>
<set field="inventoryItem.ownerPartyId" from-field="facility.ownerPartyId"/>
<!-- if inventoryItem's ownerPartyId is still empty, return an error message -->
<if-empty field-name="inventoryItem.ownerPartyId">
<if-empty field="inventoryItem.ownerPartyId">
<add-error>
<fail-message message="Error: you cannot create inventory items with no ownerPartyId."/>
</add-error>
@@ -173,17 +173,17 @@ under the License.
</if-empty>
<!-- if inventoryItem's currencyUomId is empty, get the currencyUomId
from the party accounting preferences of the owner of the inventory item -->
<if-empty field-name="inventoryItem.currencyUomId">
<if-empty field="inventoryItem.currencyUomId">
<set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="inventoryItem.ownerPartyId"/>
<call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap">
<result-to-field result-name="partyAccountingPreference" field-name="accPref"/>
</call-service>
<set field="inventoryItem.currencyUomId" from-field="accPref.baseCurrencyUomId"/>
<if-empty field-name="inventoryItem.currencyUomId">
<if-empty field="inventoryItem.currencyUomId">
<property-to-field resource="general" property="currency.uom.id.default" field-name="inventoryItem.currencyUomId"/>
</if-empty>
<!-- if inventoryItem's currencyUomId is still empty, return an error message -->
<if-empty field-name="inventoryItem.currencyUomId">
<if-empty field="inventoryItem.currencyUomId">
<add-error>
<fail-message message="Error: you cannot create inventory items with no currencyUomId; you can set a default currency in the PartyAcctgPreference for the party [${inventoryItem.ownerPartyId}], or in the general.properties file under the key [currency.uom.id.default]."/>
</add-error>
@@ -192,7 +192,7 @@ under the License.
</if-empty>
<!-- if inventoryItem's unitCost is empty, get the product's standard
cost by calling the getProductCost service -->
<if-empty field-name="inventoryItem.unitCost">
<if-empty field="inventoryItem.unitCost">
<set from-field="inventoryItem.productId" field="inputMap.productId"/>
<set from-field="inventoryItem.currencyUomId" field="inputMap.currencyUomId"/>
<set value="EST_STD" field="inputMap.costComponentTypePrefix"/> <!-- TODO: create a new service getProductStdCost that calls getProductCost -->
@@ -202,7 +202,7 @@ under the License.
</if-empty>
<!-- if inventoryItem's unitCost is still empty, or negative return an error message -->
<!-- TODO/WARNING: getProductCost returns 0 even if no std costs are found -->
<if-empty field-name="inventoryItem.unitCost">
<if-empty field="inventoryItem.unitCost">
<add-error>
<fail-message message="Error: you cannot create inventory items with no unitCost."/>
</add-error>
@@ -211,13 +211,13 @@ under the License.
<!-- if you don't want inventory item with unitCost = 0, change the operator
attribute from "less" to "less-equals".
-->
<if-compare field-name="inventoryItem.unitCost" operator="less" value="0" type="Double">
<if-compare field="inventoryItem.unitCost" operator="less" value="0" type="Double">
<add-error>
<fail-message message="Error: you cannot create inventory items with a negative unitCost."/>
</add-error>
</if-compare>
<check-errors/>
<if-not-empty field-name="updateInventoryItem">
<if-not-empty field="updateInventoryItem">
<store-value value-name="inventoryItem"/>
</if-not-empty>
</simple-method>
@@ -227,15 +227,15 @@ under the License.
<make-value entity-name="InventoryItem" value-name="lookupPKMap"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-empty field-name="lookedUpValue.ownerPartyId">
<if-empty field="lookedUpValue.ownerPartyId">
<get-related-one value-name="lookedUpValue" relation-name="Facility" to-value-name="oldFacility"/>
<set field="lookedUpValue.ownerPartyId" from-field="oldFacility.ownerPartyId"/>
</if-empty>
<field-to-result field-name="lookedUpValue.ownerPartyId" result-name="oldOwnerPartyId"/>
<field-to-result field-name="lookedUpValue.statusId" result-name="oldStatusId"/>
<!-- special handling for the unitCost -->
<if-not-empty field-name="parameters.unitCost">
<if-compare field-name="parameters.unitCost" operator="less" value="0.0" type="Double">
<if-not-empty field="parameters.unitCost">
<if-compare field="parameters.unitCost" operator="less" value="0.0" type="Double">
<add-error><fail-message message="Unit cost for inventory item [${lookupPKMap.inventoryItemId}] cannot be negative."/></add-error>
<check-errors/>
</if-compare>
@@ -244,8 +244,8 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
<!-- if the unit cost is changed create an InventoryItemDetail to keep track of unit cost history -->
<if-not-empty field-name="parameters.unitCost">
<if-compare-field field-name="parameters.unitCost" operator="not-equals" to-field-name="oldUnitCost">
<if-not-empty field="parameters.unitCost">
<if-compare-field field="parameters.unitCost" to-field="oldUnitCost" operator="not-equals">
<set field="createInventoryItemDetailInMap.inventoryItemId" from-field="lookedUpValue.inventoryItemId"/>
<set field="createInventoryItemDetailInMap.unitCost" from-field="parameters.unitCost"/>
<call-service service-name="createInventoryItemDetail" in-map-name="createInventoryItemDetailInMap"/>
@@ -262,7 +262,7 @@ under the License.
<order-by field-name="-statusDatetime"/>
</entity-and>
<first-from-list entry-name="oldInventoryItemStatus" list-name="oldInventoryItemStatusList"/>
<if-not-empty field-name="oldInventoryItemStatus">
<if-not-empty field="oldInventoryItemStatus">
<set field="oldInventoryItemStatus.statusEndDatetime" from-field="nowTimestamp"/>
<store-value value-name="oldInventoryItemStatus"/>
</if-not-empty>
@@ -273,7 +273,7 @@ under the License.
<set field="inventoryItemStatus.statusDatetime" from-field="nowTimestamp"/>
<!-- make sure the current productId is set, if not passed in look up the current value -->
<if-empty field-name="inventoryItemStatus.productId">
<if-empty field="inventoryItemStatus.productId">
<entity-one entity-name="InventoryItem" value-name="inventoryItem"/>
<set field="inventoryItemStatus.productId" from-field="inventoryItem.productId"/>
</if-empty>
@@ -292,7 +292,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<!-- set the effectiveDate; if from an ItemIssuance lookup the issuedDateTime -->
<if-not-empty field-name="parameters.itemIssuanceId">
<if-not-empty field="parameters.itemIssuanceId">
<entity-one entity-name="ItemIssuance" value-name="itemIssuance"/>
<set field="newEntity.effectiveDate" from-field="itemIssuance.issuedDateTime"/>
<else>
@@ -301,8 +301,8 @@ under the License.
</if-not-empty>
<!-- if availableToPromiseDiff or quantityOnHandDiff are empty set to 0 -->
<if-empty field-name="newEntity.availableToPromiseDiff"><set field="newEntity.availableToPromiseDiff" value="0" type="Double"/></if-empty>
<if-empty field-name="newEntity.quantityOnHandDiff"><set field="newEntity.quantityOnHandDiff" value="0" type="Double"/></if-empty>
<if-empty field="newEntity.availableToPromiseDiff"><set field="newEntity.availableToPromiseDiff" value="0" type="Double"/></if-empty>
<if-empty field="newEntity.quantityOnHandDiff"><set field="newEntity.quantityOnHandDiff" value="0" type="Double"/></if-empty>
<create-value value-name="newEntity"/>
</simple-method>
@@ -317,15 +317,15 @@ under the License.
<simple-method method-name="updateSerializedInventoryTotals" short-description="Update the totals on serialized inventory">
<entity-one entity-name="InventoryItem" value-name="inventoryItem"/>
<if-compare field-name="inventoryItem.inventoryItemTypeId" value="SERIALIZED_INV_ITEM" operator="equals">
<if-compare field="inventoryItem.inventoryItemTypeId" value="SERIALIZED_INV_ITEM" operator="equals">
<if>
<!-- available -->
<condition>
<and>
<if-compare field-name="inventoryItem.statusId" value="INV_AVAILABLE" operator="equals"/>
<if-compare field="inventoryItem.statusId" value="INV_AVAILABLE" operator="equals"/>
<or>
<if-compare field-name="inventoryItem.availableToPromiseTotal" operator="not-equals" value="1" type="Double"/>
<if-compare field-name="inventoryItem.quantityOnHandTotal" operator="not-equals" value="1" type="Double"/>
<if-compare field="inventoryItem.availableToPromiseTotal" operator="not-equals" value="1" type="Double"/>
<if-compare field="inventoryItem.quantityOnHandTotal" operator="not-equals" value="1" type="Double"/>
</or>
</and>
</condition>
@@ -340,10 +340,10 @@ under the License.
<else-if>
<condition>
<and>
<if-compare field-name="inventoryItem.statusId" value="INV_DELIVERED" operator="equals"/>
<if-compare field="inventoryItem.statusId" value="INV_DELIVERED" operator="equals"/>
<or>
<if-compare field-name="inventoryItem.availableToPromiseTotal" operator="not-equals" value="0" type="Double"/>
<if-compare field-name="inventoryItem.quantityOnHandTotal" operator="not-equals" value="0" type="Double"/>
<if-compare field="inventoryItem.availableToPromiseTotal" operator="not-equals" value="0" type="Double"/>
<if-compare field="inventoryItem.quantityOnHandTotal" operator="not-equals" value="0" type="Double"/>
</or>
</and>
</condition>
@@ -359,11 +359,11 @@ under the License.
<else-if>
<condition>
<and>
<if-compare field-name="inventoryItem.statusId" operator="not-equals" value="INV_AVAILABLE"/>
<if-compare field-name="inventoryItem.statusId" operator="not-equals" value="INV_DELIVERED"/>
<if-compare field="inventoryItem.statusId" operator="not-equals" value="INV_AVAILABLE"/>
<if-compare field="inventoryItem.statusId" operator="not-equals" value="INV_DELIVERED"/>
<or>
<if-compare field-name="inventoryItem.availableToPromiseTotal" operator="not-equals" value="0" type="Double"/>
<if-compare field-name="inventoryItem.quantityOnHandTotal" operator="not-equals" value="1" type="Double"/>
<if-compare field="inventoryItem.availableToPromiseTotal" operator="not-equals" value="0" type="Double"/>
<if-compare field="inventoryItem.quantityOnHandTotal" operator="not-equals" value="1" type="Double"/>
</or>
</and>
</condition>
@@ -410,8 +410,8 @@ under the License.
<now-timestamp-to-env env-name="nowTimestamp"/>
<!-- if discontinueProductSales field is empty and the product is a variant, get the fieldcontent from the virtual product -->
<if-not-empty field-name="product">
<if-compare field-name="product.isVariant" value="Y" operator="equals">
<if-not-empty field="product">
<if-compare field="product.isVariant" value="Y" operator="equals">
<!-- retrieve related virtual product because also to be used later -->
<set field="getAssoc.productIdTo" from-field="product.productId"/>
<set field="getAssoc.productAssocTypeId" value="PRODUCT_VARIANT"/>
@@ -419,7 +419,7 @@ under the License.
<filter-list-by-date list-name="assocs" to-list-name="assocsDate"/>
<first-from-list entry-name="assoc" list-name="assocsDate"/>
<get-related-one value-name="assoc" relation-name="MainProduct" to-value-name="virtProduct"/>
<if-empty field-name="product.salesDiscWhenNotAvail">
<if-empty field="product.salesDiscWhenNotAvail">
<set field="product.salesDiscWhenNotAvail" from-field="virtProduct.salesDiscWhenNotAvail"/>
</if-empty>
</if-compare>
@@ -429,11 +429,11 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="product"/></not>
<if-compare field-name="product.salesDiscWhenNotAvail" operator="equals" value="Y"/>
<not><if-empty field="product"/></not>
<if-compare field="product.salesDiscWhenNotAvail" operator="equals" value="Y"/>
<or>
<if-empty field-name="product.salesDiscontinuationDate"/>
<if-compare-field field-name="product.salesDiscontinuationDate" operator="greater" to-field-name="nowTimestamp" type="Timestamp"/>
<if-empty field="product.salesDiscontinuationDate"/>
<if-compare-field field="product.salesDiscontinuationDate" to-field="nowTimestamp" operator="greater" type="Timestamp"/>
</or>
</and>
</condition>
@@ -442,19 +442,19 @@ under the License.
<call-service service-name="getProductInventoryAvailable" in-map-name="productIdMap">
<result-to-field result-name="availableToPromiseTotal"/>
</call-service>
<if-compare field-name="availableToPromiseTotal" operator="less-equals" value="0" type="Double">
<if-compare field="availableToPromiseTotal" operator="less-equals" value="0" type="Double">
<set from-field="parameters.productId" field="discontinueProductSalesMap.productId"/>
<call-service service-name="discontinueProductSales" in-map-name="discontinueProductSalesMap"/>
</if-compare>
<!-- check if related virtual product has no variant left, if yes discontinue the virtual product too when salesDiscWhenNotAvail is 'Y'-->
<if-not-empty field-name="virtProduct">
<if-compare field-name="virtProduct.salesDiscWhenNotAvail" operator="equals" value="Y">
<if-not-empty field="virtProduct">
<if-compare field="virtProduct.salesDiscWhenNotAvail" operator="equals" value="Y">
<set field="getFromAssoc.productId" from-field="virtProduct.productId"/>
<set field="getFromAssoc.productAssocTypeId" value="PRODUCT_VARIANT"/>
<find-by-and entity-name="ProductAssoc" map-name="getFromAssoc" list-name="assocs"/>
<filter-list-by-date list-name="assocs" to-list-name="assocsDate"/>
<if-empty field-name="assocsDate">
<if-empty field="assocsDate">
<set from-field="virtProduct.productId" field="discontinueProductSalesMap.productId"/>
<call-service service-name="discontinueProductSales" in-map-name="discontinueProductSalesMap"/>
</if-empty>
@@ -473,7 +473,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="inventoryItemLookup"/>
<find-by-primary-key map-name="inventoryItemLookup" value-name="inventoryItem"/>
<if-compare field-name="inventoryItemTypeId" map-name="inventoryItem" operator="not-equals" value="NON_SERIAL_INV_ITEM">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="not-equals" value="NON_SERIAL_INV_ITEM">
<string-to-list string="Can only create an InventoryItemVariance for a Non-Serialized Inventory Item" list-name="error_list"/>
</if-compare>
<check-errors/>
@@ -500,10 +500,10 @@ under the License.
<make-value value-name="newEntity" entity-name="PhysicalInventory"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.physicalInventoryDate">
<if-empty field="newEntity.physicalInventoryDate">
<now-timestamp-to-env env-name="newEntity.physicalInventoryDate"/>
</if-empty>
<if-empty field-name="newEntity.partyId">
<if-empty field="newEntity.partyId">
<set from-field="userLogin.partyId" field="newEntity.partyId"/>
</if-empty>
@@ -601,12 +601,12 @@ under the License.
if the parameters.locationSeqId string is equal to "nullField" then
set the lookupFieldMap.locationSeqId to null
-->
<if-compare field-name="parameters.locationSeqId" operator="equals" value="nullField">
<if-compare field="parameters.locationSeqId" operator="equals" value="nullField">
<set from-field="nullField" field="lookupFieldMap.locationSeqId"/>
</if-compare>
<!-- we might get away with a cache here since real serious errors will occur during the reservation service... but only if we need the speed -->
<if-compare field-name="parameters.useCache" operator="equals" value="true" type="Boolean">
<if-compare field="parameters.useCache" operator="equals" value="true" type="Boolean">
<find-by-and entity-name="InventoryItem" map-name="lookupFieldMap" list-name="inventoryItems" use-iterator="true" use-cache="true"/>
<else>
<find-by-and entity-name="InventoryItem" map-name="lookupFieldMap" list-name="inventoryItems" use-iterator="true" use-cache="false"/>
@@ -616,13 +616,13 @@ under the License.
<set field="parameters.availableToPromiseTotal" value="0" type="Double"/>
<set field="parameters.quantityOnHandTotal" value="0" type="Double"/>
<iterate entry-name="inventoryItem" list-name="inventoryItems">
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="SERIALIZED_INV_ITEM">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="SERIALIZED_INV_ITEM">
<if>
<condition>
<or>
<if-compare field-name="inventoryItem.statusId" value="INV_AVAILABLE" operator="equals"/>
<if-compare field-name="inventoryItem.statusId" value="INV_PROMISED" operator="equals"/>
<if-compare field-name="inventoryItem.statusId" value="INV_BEING_TRANSFERED" operator="equals"/>
<if-compare field="inventoryItem.statusId" value="INV_AVAILABLE" operator="equals"/>
<if-compare field="inventoryItem.statusId" value="INV_PROMISED" operator="equals"/>
<if-compare field="inventoryItem.statusId" value="INV_BEING_TRANSFERED" operator="equals"/>
</or>
</condition>
<then>
@@ -631,34 +631,34 @@ under the License.
</calculate>
</then>
</if>
<if-compare value="INV_AVAILABLE" operator="equals" field-name="inventoryItem.statusId">
<if-compare value="INV_AVAILABLE" operator="equals" field="inventoryItem.statusId">
<calculate field-name="parameters.availableToPromiseTotal" type="Double">
<calcop field-name="parameters.availableToPromiseTotal" operator="add"><number value="1.0"/></calcop>
</calculate>
</if-compare>
</if-compare>
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if>
<condition>
<or>
<and>
<not><if-empty field-name="parameters.statusId"/></not>
<if-compare-field operator="equals" field-name="parameters.statusId" to-field-name="inventoryItem.statusId"/>
<not><if-empty field="parameters.statusId"/></not>
<if-compare-field operator="equals" field="parameters.statusId" to-field="inventoryItem.statusId"/>
</and>
<and>
<if-empty field-name="parameters.statusId"/>
<if-empty field-name="inventoryItem.statusId"/>
<if-empty field="parameters.statusId"/>
<if-empty field="inventoryItem.statusId"/>
</and>
</or>
</condition>
<then>
<if-not-empty field-name="inventoryItem.quantityOnHandTotal">
<if-not-empty field="inventoryItem.quantityOnHandTotal">
<calculate field-name="parameters.quantityOnHandTotal" type="Double">
<calcop operator="get" field-name="parameters.quantityOnHandTotal"/>
<calcop operator="get" field-name="inventoryItem.quantityOnHandTotal"/>
</calculate>
</if-not-empty>
<if-not-empty field-name="inventoryItem.availableToPromiseTotal">
<if-not-empty field="inventoryItem.availableToPromiseTotal">
<calculate field-name="parameters.availableToPromiseTotal" type="Double">
<calcop operator="get" field-name="parameters.availableToPromiseTotal"/>
<calcop operator="get" field-name="inventoryItem.availableToPromiseTotal"/>
@@ -678,7 +678,7 @@ under the License.
<set field="quantityOnHandTotal" value="0" type="Double"/>
<set from-field="parameters.productId" field="lookupMktgPkgParams.productId"/>
<entity-one entity-name="Product" value-name="product"/>
<if-compare field-name="product.productTypeId" operator="equals" value="MARKETING_PKG_AUTO">
<if-compare field="product.productTypeId" operator="equals" value="MARKETING_PKG_AUTO">
<set value="MANUF_COMPONENT" field="lookupMktgPkgParams.type"/>
<else>
<set value="PRODUCT_COMPONENT" field="lookupMktgPkgParams.type"/>
@@ -689,7 +689,7 @@ under the License.
</call-service>
<!-- if there are any components, then the ATP and QOH are based on the quantities of those component
products and found with another service -->
<if-not-empty field-name="assocProducts">
<if-not-empty field="assocProducts">
<set from-field="assocProducts" field="inventoryByAssocProductsParams.assocProducts"/>
<set from-field="parameters.facilityId" field="inventoryByAssocProductsParams.facilityId"/>
<set from-field="parameters.statusId" field="inventoryByAssocProductsParams.statusId"/>
@@ -734,7 +734,7 @@ under the License.
for example, if we have a negative quantityOnHandTotal and quantityOnHandTotal equal to
availableToPromiseTotal, then no reservations are present.
-->
<if-compare-field field-name="item.quantityOnHandTotal" operator="not-equals" to-field-name="item.availableToPromiseTotal">
<if-compare-field field="item.quantityOnHandTotal" to-field="item.availableToPromiseTotal" operator="not-equals">
<get-related value-name="item" relation-name="OrderItemShipGrpInvRes" list-name="relatedRes"/>
<!--<list-to-list list-name="relatedRes" to-list-name="reservations"/>-->
@@ -753,13 +753,13 @@ under the License.
<!-- only cancel/re-reserve when there are no picklists associated; this will prevent
orders appearing on duplicate pick lists -->
<if-empty field-name="picklistItemList">
<if-empty field="picklistItemList">
<log level="info" message="Order [${oneRelatedRes.orderId}] was not found on any picklist for InventoryItem [${oneRelatedRes.inventoryItemId}]"/>
<if>
<condition>
<and>
<if-compare-field field-name="parameters.priorityOrderId" operator="equals" to-field-name="oneRelatedRes.orderId"/>
<if-compare-field field-name="parameters.priorityOrderItemSeqId" operator="equals" to-field-name="oneRelatedRes.orderItemSeqId"/>
<if-compare-field field="parameters.priorityOrderId" to-field="oneRelatedRes.orderId" operator="equals"/>
<if-compare-field field="parameters.priorityOrderItemSeqId" to-field="oneRelatedRes.orderItemSeqId" operator="equals"/>
</and>
</condition>
<then>
@@ -782,7 +782,7 @@ under the License.
<list-to-list list-name="privilegedReservations" to-list-name="allReservations"/>
<list-to-list list-name="reservations" to-list-name="allReservations"/>
<if-compare field-name="inventoryItemTypeId" map-name="inventoryItem" operator="equals" value="SERIALIZED_INV_ITEM">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="SERIALIZED_INV_ITEM">
<!-- if the new item is serialized, i.e. qoh is 1, we just need the first reservation -->
<first-from-list entry-name="inventoryReservation" list-name="allReservations"/>
<clear-field field-name="allReservations"/>
@@ -802,8 +802,8 @@ under the License.
<!-- THEN, re-reserve the cancelled items -->
<iterate list-name="allReservations" entry-name="oisgir">
<!-- maintain a Set (in a Map) of orderIds that we have reallocated for, but only if they had some quantityNotReserved -->
<if-not-empty field-name="oisgir.quantityNotAvailable">
<if-compare field-name="oisgir.quantityNotAvailable" operator="greater" value="0" type="Double">
<if-not-empty field="oisgir.quantityNotAvailable">
<if-compare field="oisgir.quantityNotAvailable" operator="greater" value="0" type="Double">
<set field="touchedOrderIdMap.${oisgir.orderId}" value="Y"/>
<log level="verbose" message="Adding ${oisgir.orderId} to touchedOrderIdMap"/>
</if-compare>
@@ -821,7 +821,7 @@ under the License.
<set field="resMap.shipGroupSeqId" from-field="oisgir.shipGroupSeqId"/>
<set field="resMap.sequenceId" from-field="oisgir.sequenceId"/>
<log level="info" message="Re-reserving product [${resMap.productId}] for order item [${resMap.orderId}:${resMap.orderItemSeqId}] quantity [${resMap.quantity}]; facility [${inventoryItem.facilityId}]"/>
<if-empty field-name="inventoryItem.facilityId">
<if-empty field="inventoryItem.facilityId">
<log level="warning" message="In balanceInventoryItems there is no facilityId, so reserving from any facility for order item [${resMap.orderId}:${resMap.orderItemSeqId}]"></log>
<call-service service-name="reserveProductInventory" in-map-name="resMap"/>
@@ -839,11 +839,11 @@ under the License.
<result-to-field result-name="isBackOrder"/>
</call-service>
<if-compare field-name="isBackOrder" operator="equals" value="false" type="Boolean">
<if-compare field="isBackOrder" operator="equals" value="false" type="Boolean">
<set field="noLongerOnBackOrderIdMap.${touchedOrderId}" value="Y"/>
</if-compare>
</iterate-map>
<if-not-empty field-name="noLongerOnBackOrderIdMap">
<if-not-empty field="noLongerOnBackOrderIdMap">
<call-object-method obj-field-name="noLongerOnBackOrderIdMap" method-name="keySet" ret-field-name="noLongerOnBackOrderIdSet"/>
<field-to-result field-name="noLongerOnBackOrderIdSet"/>
</if-not-empty>
@@ -885,13 +885,13 @@ under the License.
<!-- only cancel/re-reserve when there are no picklists associated; this will prevent
orders appearing on duplicate pick lists -->
<if-empty field-name="picklistItemList">
<if-empty field="picklistItemList">
<log level="info" message="Order [${oneRelatedRes.orderId}] was not found on any picklist for InventoryItem [${oneRelatedRes.inventoryItemId}]"/>
<if>
<condition>
<and>
<if-compare-field field-name="parameters.priorityOrderId" operator="equals" to-field-name="oneRelatedRes.orderId"/>
<if-compare-field field-name="parameters.priorityOrderItemSeqId" operator="equals" to-field-name="oneRelatedRes.orderItemSeqId"/>
<if-compare-field field="parameters.priorityOrderId" to-field="oneRelatedRes.orderId" operator="equals"/>
<if-compare-field field="parameters.priorityOrderItemSeqId" to-field="oneRelatedRes.orderItemSeqId" operator="equals"/>
</and>
</condition>
<then>
@@ -920,8 +920,8 @@ under the License.
<!-- THEN, re-reserve the cancelled items -->
<iterate list-name="allReservations" entry-name="oisgir">
<!-- maintain a Set (in a Map) of orderIds that we have reallocated for, but only if they had some quantityNotReserved -->
<if-not-empty field-name="oisgir.quantityNotAvailable">
<if-compare field-name="oisgir.quantityNotAvailable" operator="greater" value="0" type="Double">
<if-not-empty field="oisgir.quantityNotAvailable">
<if-compare field="oisgir.quantityNotAvailable" operator="greater" value="0" type="Double">
<set field="touchedOrderIdMap.${oisgir.orderId}" value="Y"/>
<log level="verbose" message="Adding ${oisgir.orderId} to touchedOrderIdMap"/>
</if-compare>
@@ -950,11 +950,11 @@ under the License.
<result-to-field result-name="isBackOrder"/>
</call-service>
<if-compare field-name="isBackOrder" operator="equals" value="false" type="Boolean">
<if-compare field="isBackOrder" operator="equals" value="false" type="Boolean">
<set field="noLongerOnBackOrderIdMap.${touchedOrderId}" value="Y"/>
</if-compare>
</iterate-map>
<if-not-empty field-name="noLongerOnBackOrderIdMap">
<if-not-empty field="noLongerOnBackOrderIdMap">
<call-object-method obj-field-name="noLongerOnBackOrderIdMap" method-name="keySet" ret-field-name="noLongerOnBackOrderIdSet"/>
<field-to-result field-name="noLongerOnBackOrderIdSet"/>
</if-not-empty>
@@ -963,7 +963,7 @@ under the License.
<simple-method method-name="balanceOrderItemsWithNegativeReservations" short-description="To balance order items with negative reservations">
<entity-one entity-name="OrderHeader" value-name="orderHeader" auto-field-map="true"/>
<get-related-one value-name="orderHeader" relation-name="ProductStore" to-value-name="productStore"/>
<if-compare field-name="productStore.balanceResOnOrderCreation" operator="equals" value="Y">
<if-compare field="productStore.balanceResOnOrderCreation" operator="equals" value="Y">
<entity-condition entity-name="OrderItemAndShipGrpInvResAndItem" list-name="oisgirais">
<condition-list combine="and">
<condition-expr field-name="orderId" operator="equals" env-name="parameters.orderId"/>
@@ -979,7 +979,7 @@ under the License.
<iterate-map key-name="orderItemSeqId" value-name="oisgir" map-name="orderItems">
<set field="reassignInventoryReservationsCtx.productId" from-field="oisgir.productId"/>
<set field="reassignInventoryReservationsCtx.facilityId" from-field="oisgir.facilityId"/>
<if-not-empty field-name="oisgir.shipBeforeDate">
<if-not-empty field="oisgir.shipBeforeDate">
<set field="reassignInventoryReservationsCtx.fromDate" from-field="oisgir.shipBeforeDate"/>
<else>
<set field="reassignInventoryReservationsCtx.fromDate" from-field="nowTimestamp"/>
@@ -1008,14 +1008,14 @@ under the License.
<set from-field="parameters.inventoryTransferId" field="lookupPKMap.inventoryTransferId"/>
<find-by-primary-key entity-name="InventoryTransfer" map-name="lookupPKMap" value-name="inventoryTransfer"/>
<if-not-empty field-name="parameters.statusId">
<if-compare-field field-name="parameters.statusId" operator="not-equals" to-field-name="inventoryTransfer.statusId">
<if-not-empty field="parameters.statusId">
<if-compare-field field="parameters.statusId" to-field="inventoryTransfer.statusId" operator="not-equals">
<!-- make sure a StatusValidChange record exists, if not return error -->
<entity-one entity-name="StatusValidChange" value-name="checkStatusValidChange" auto-field-map="false">
<field-map env-name="inventoryTransfer.statusId" field-name="statusId"/>
<field-map env-name="parameters.statusId" field-name="statusIdTo"/>
</entity-one>
<if-empty field-name="checkStatusValidChange">
<if-empty field="checkStatusValidChange">
<set value="ERROR: Changing the status from ${inventoryTransfer.statusId} to ${parameters.statusId} is not allowed." field="error_list[]"/>
</if-empty>
<check-errors/>
@@ -1037,26 +1037,26 @@ under the License.
<entity-one entity-name="Product" value-name="product"/>
<entity-one entity-name="Facility" value-name="facility" use-cache="true"/>
<get-related-one value-name="product" relation-name="ProductType" to-value-name="productType"/>
<if-compare field-name="productType.isPhysical" operator="equals" value="N">
<if-compare field="productType.isPhysical" operator="equals" value="N">
<set field="quantityNotTransferred" value="0" type="Double"/>
<else>
<!-- before we do the find, put together the orderBy list based on which reserveOrderEnumId is specified -->
<!-- FIFO=first in first out, so it should be order by ASCending receive or expire date
LIFO=last in first out, so it means order by DESCending receive or expire date
-->
<if-compare value="INVRO_GUNIT_COST" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_GUNIT_COST" operator="equals" field="parameters.reserveOrderEnumId">
<set value="unitCost DESC" field="orderByString"/>
<else>
<if-compare value="INVRO_LUNIT_COST" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_LUNIT_COST" operator="equals" field="parameters.reserveOrderEnumId">
<set value="+unitCost" field="orderByString"/>
<else>
<if-compare value="INVRO_FIFO_EXP" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_FIFO_EXP" operator="equals" field="parameters.reserveOrderEnumId">
<set value="+expireDate" field="orderByString"/>
<else>
<if-compare value="INVRO_LIFO_EXP" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_LIFO_EXP" operator="equals" field="parameters.reserveOrderEnumId">
<set value="-expireDate" field="orderByString"/>
<else>
<if-compare value="INVRO_LIFO_REC" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
<if-compare value="INVRO_LIFO_REC" operator="equals" field="parameters.reserveOrderEnumId">
<set value="-datetimeReceived" field="orderByString"/>
<else>
<!-- the default reserveOrderEnumId is INVRO_FIFO_REC, ie FIFO based on date received -->
@@ -1082,9 +1082,9 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="inventoryItemAndLocation.locationTypeEnumId" operator="equals" value="FLT_PICKLOC"/>
<if-compare field-name="quantityNotTransferred" value="0.0" operator="greater" type="Double"/>
<if-compare field-name="inventoryItemAndLocation.availableToPromiseTotal" value="0.0" operator="greater" type="Double"/>
<if-compare field="inventoryItemAndLocation.locationTypeEnumId" operator="equals" value="FLT_PICKLOC"/>
<if-compare field="quantityNotTransferred" value="0.0" operator="greater" type="Double"/>
<if-compare field="inventoryItemAndLocation.availableToPromiseTotal" value="0.0" operator="greater" type="Double"/>
</and>
</condition>
<then>
@@ -1095,8 +1095,8 @@ under the License.
<set field="inputMap.facilityIdTo" from-field="parameters.facilityIdTo"/>
<set field="inputMap.sendDate" from-field="parameters.sendDate"/>
<!-- TODO: inventory transfers for serialized items are not yet implemented -->
<if-compare field-name="inventoryItemAndLocation.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare-field field-name="quantityNotTransferred" to-field-name="inventoryItemAndLocation.availableToPromiseTotal" operator="greater" type="Double">
<if-compare field="inventoryItemAndLocation.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare-field field="quantityNotTransferred" to-field="inventoryItemAndLocation.availableToPromiseTotal" operator="greater" type="Double">
<set field="inputMap.xferQty" from-field="inventoryItemAndLocation.availableToPromiseTotal"/>
<else>
<set field="inputMap.xferQty" from-field="quantityNotTransferred"/>
@@ -1114,15 +1114,15 @@ under the License.
</iterate>
<!-- still some left? try the FLT_BULK locations -->
<if-compare field-name="quantityNotTransferred" operator="greater" value="0" type="Double">
<if-compare field="quantityNotTransferred" operator="greater" value="0" type="Double">
<find-by-and entity-name="InventoryItemAndLocation" map-name="lookupFieldMap" list-name="inventoryItemAndLocations" use-iterator="true" order-by-list-name="orderByList"/>
<iterate entry-name="inventoryItemAndLocation" list-name="inventoryItemAndLocations">
<if>
<condition>
<and>
<if-compare field-name="inventoryItemAndLocation.locationTypeEnumId" operator="equals" value="FLT_BULK"/>
<if-compare field-name="quantityNotTransferred" value="0.0" operator="greater" type="Double"/>
<if-compare field-name="inventoryItemAndLocation.availableToPromiseTotal" value="0.0" operator="greater" type="Double"/>
<if-compare field="inventoryItemAndLocation.locationTypeEnumId" operator="equals" value="FLT_BULK"/>
<if-compare field="quantityNotTransferred" value="0.0" operator="greater" type="Double"/>
<if-compare field="inventoryItemAndLocation.availableToPromiseTotal" value="0.0" operator="greater" type="Double"/>
</and>
</condition>
<then>
@@ -1133,8 +1133,8 @@ under the License.
<set field="inputMap.facilityIdTo" from-field="parameters.facilityIdTo"/>
<set field="inputMap.sendDate" from-field="parameters.sendDate"/>
<!-- TODO: inventory transfers for serialized items are not yet implemented -->
<if-compare field-name="inventoryItemAndLocation.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare-field field-name="quantityNotTransferred" to-field-name="inventoryItemAndLocation.availableToPromiseTotal" operator="greater" type="Double">
<if-compare field="inventoryItemAndLocation.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare-field field="quantityNotTransferred" to-field="inventoryItemAndLocation.availableToPromiseTotal" operator="greater" type="Double">
<set field="inputMap.xferQty" from-field="inventoryItemAndLocation.availableToPromiseTotal"/>
<else>
<set field="inputMap.xferQty" from-field="quantityNotTransferred"/>
@@ -1153,15 +1153,15 @@ under the License.
</if-compare>
<!-- last of all transfer InventoryItems that have no locationSeqId, ie are not in any particular location -->
<if-compare field-name="quantityNotTransferred" operator="greater" value="0" type="Double">
<if-compare field="quantityNotTransferred" operator="greater" value="0" type="Double">
<find-by-and entity-name="InventoryItem" map-name="lookupFieldMap" list-name="inventoryItems" use-iterator="true" order-by-list-name="orderByList"/>
<iterate entry-name="inventoryItem" list-name="inventoryItems">
<if>
<condition>
<and>
<if-empty field-name="inventoryItem.locationSeqId"/>
<if-compare field-name="quantityNotTransferred" value="0.0" operator="greater" type="Double"/>
<if-compare field-name="inventoryItem.availableToPromiseTotal" value="0.0" operator="greater" type="Double"/>
<if-empty field="inventoryItem.locationSeqId"/>
<if-compare field="quantityNotTransferred" value="0.0" operator="greater" type="Double"/>
<if-compare field="inventoryItem.availableToPromiseTotal" value="0.0" operator="greater" type="Double"/>
</and>
</condition>
<then>
@@ -1172,8 +1172,8 @@ under the License.
<set field="inputMap.facilityIdTo" from-field="parameters.facilityIdTo"/>
<set field="inputMap.sendDate" from-field="parameters.sendDate"/>
<!-- TODO: inventory transfers for serialized items are not yet implemented -->
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare-field field-name="quantityNotTransferred" to-field-name="inventoryItem.availableToPromiseTotal" operator="greater" type="Double">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare-field field="quantityNotTransferred" to-field="inventoryItem.availableToPromiseTotal" operator="greater" type="Double">
<set field="inputMap.xferQty" from-field="inventoryItem.availableToPromiseTotal"/>
<else>
<set field="inputMap.xferQty" from-field="quantityNotTransferred"/>
@@ -1258,7 +1258,7 @@ under the License.
</call-service>
<assert>
<not>
<if-empty field-name="physicalInventoryId">
<if-empty field="physicalInventoryId">
<log level="info" message="========physicalInventoryId ${physicalInventoryId} found null============================"/>
</if-empty>
</not>
@@ -84,7 +84,7 @@ under the License.
<field-map field-name="locationTypeEnumId" value="FLT_PICKLOC"/>
</entity-and>
<if-empty field-name="productFacilityLocationViewList">
<if-empty field="productFacilityLocationViewList">
<string-to-list string="Error in stock move, could not find a pick/primary location for facility [${parameters.facilityId}] and product [${productId}]" list-name="warningMessageList"/>
<else>
<!-- should generally only be one pick/primary location, just choose the first... -->
@@ -119,7 +119,7 @@ under the License.
</iterate>
<set from-field="totalQuantityOnHand" field="moveInfo.quantityOnHandTotalFrom"/>
<set from-field="totalAvailableToPromise" field="moveInfo.availableToPromiseTotalFrom"/>
<if-compare-field field-name="totalQuantityOnHand" operator="less" to-field-name="moveInfo.totalQuantity" type="Double">
<if-compare-field field="totalQuantityOnHand" to-field="moveInfo.totalQuantity" operator="less" type="Double">
<!-- not enough on hand for move: add warning message, set moveInfo.totalQuantity to totalQuantityOnHand, and don't even bother looking for pre-emptive replenishment needs for this location right now -->
<string-to-list string="Warning in stock move: for facility [${parameters.facilityId}] and product [${productId}] going from location [${productFacilityLocation.locationSeqId}] to location [${moveInfo.targetProductFacilityLocation.locationSeqId}] a quantity of [${moveInfo.totalQuantity}] was needed but there are only [${totalQuantityOnHand}] on hand (this will be in the pick list with the full quantity on hand, but note that this will not be enough to prepare for all orders reserved against this location)" list-name="warningMessageList"/>
<set from-field="totalQuantityOnHand" field="moveInfo.totalQuantity"/>
@@ -144,8 +144,8 @@ under the License.
now if there is enough left and there is less than the minimum for the
ProductFacilityLocation, move the restock quantity from ProductFacilityLocation
-->
<if-compare-field field-name="targetTotalAvailableToPromise" operator="less" to-field-name="moveInfo.targetProductFacilityLocation.minimumStock" type="Double">
<if-empty field-name="targetLocationSimpleMoveQuantity.${moveInfo.targetProductFacilityLocation.locationSeqId}">
<if-compare-field field="targetTotalAvailableToPromise" to-field="moveInfo.targetProductFacilityLocation.minimumStock" operator="less" type="Double">
<if-empty field="targetLocationSimpleMoveQuantity.${moveInfo.targetProductFacilityLocation.locationSeqId}">
<!-- if targetTotalAvailableToPromise is less than productFacilityLocation.minimumStock, move over the moveInfo.targetProductFacilityLocation.moveQuantity -->
<!-- if trying to move more from the location than is there, find the difference and put it in targetLocationSimpleMoveQuantity.${moveInfo.targetProductFacilityLocation.locationSeqId} -->
@@ -164,7 +164,7 @@ under the License.
</calculate>
</else>
</if-empty>
<if-compare-field field-name="totalQuantityOnHand" operator="less" to-field-name="moveInfo.totalQuantity" type="Double">
<if-compare-field field="totalQuantityOnHand" to-field="moveInfo.totalQuantity" operator="less" type="Double">
<calculate field-name="targetLocationSimpleMoveQuantity.${moveInfo.targetProductFacilityLocation.locationSeqId}" type="Double">
<calcop field-name="moveInfo.totalQuantity" operator="subtract"><calcop field-name="totalQuantityOnHand" operator="get"/></calcop>
</calculate>
@@ -226,17 +226,17 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="productFacilityLocationQuantityTest.moveQuantity"/></not>
<if-compare field-name="productFacilityLocationQuantityTest.moveQuantity" operator="greater" value="0" type="Double"/>
<not><if-empty field="productFacilityLocationQuantityTest.moveQuantity"/></not>
<if-compare field="productFacilityLocationQuantityTest.moveQuantity" operator="greater" value="0" type="Double"/>
<or>
<and>
<if-empty field-name="productFacilityLocationQuantityTest.availableToPromiseTotal"/>
<not><if-empty field-name="productFacilityLocationQuantityTest.minimumStock"/></not>
<if-compare field-name="productFacilityLocationQuantityTest.minimumStock" operator="greater" value="0" type="Double"></if-compare>
<if-empty field="productFacilityLocationQuantityTest.availableToPromiseTotal"/>
<not><if-empty field="productFacilityLocationQuantityTest.minimumStock"/></not>
<if-compare field="productFacilityLocationQuantityTest.minimumStock" operator="greater" value="0" type="Double"></if-compare>
</and>
<and>
<not><if-empty field-name="productFacilityLocationQuantityTest.availableToPromiseTotal"/></not>
<if-compare-field field-name="productFacilityLocationQuantityTest.availableToPromiseTotal" operator="less" to-field-name="productFacilityLocationQuantityTest.minimumStock" type="Double"/>
<not><if-empty field="productFacilityLocationQuantityTest.availableToPromiseTotal"/></not>
<if-compare-field field="productFacilityLocationQuantityTest.availableToPromiseTotal" to-field="productFacilityLocationQuantityTest.minimumStock" operator="less" type="Double"/>
</and>
</or>
</and>
@@ -245,12 +245,12 @@ under the License.
<if>
<condition>
<or>
<if-empty field-name="stockMoveHandled.${productFacilityLocationQuantityTest.locationSeqId}"/>
<if-compare field-name="stockMoveHandled.${productFacilityLocationQuantityTest.locationSeqId}" operator="not-equals" value="Y"/>
<if-empty field="stockMoveHandled.${productFacilityLocationQuantityTest.locationSeqId}"/>
<if-compare field="stockMoveHandled.${productFacilityLocationQuantityTest.locationSeqId}" operator="not-equals" value="Y"/>
</or>
</condition>
<then>
<if-compare-field field-name="productFacilityLocationQuantityTest.productId" operator="not-equals" to-field-name="productSave.productId">
<if-compare-field field="productFacilityLocationQuantityTest.productId" to-field="productSave.productId" operator="not-equals">
<get-related-one value-name="productFacilityLocationQuantityTest" relation-name="Product" to-value-name="productSave"/>
<clear-field field-name="fromLocationTotalAvailableToPromise"/>
</if-compare-field>
@@ -263,7 +263,7 @@ under the License.
<field-map field-name="locationTypeEnumId" value="FLT_BULK"/>
</entity-and>
<if-empty field-name="inventoryItemAndLocationList">
<if-empty field="inventoryItemAndLocationList">
<string-to-list string="Error in stock move, could not find a bulk location for facility [${productFacilityLocationQuantityTest.facilityId}] and product [${productFacilityLocationQuantityTest.productId}]" list-name="warningMessageList"/>
<else>
<set from-field="productFacilityLocationQuantityTest.moveQuantity" field="targetLocationMoveQuantity"/>
@@ -275,7 +275,7 @@ under the License.
<clear-field field-name="locationSeqId"/>
<clear-field field-name="perLocationInventoryItemAndLocList"/>
<iterate-map key-name="locationSeqId" value-name="perLocationInventoryItemAndLocList" map-name="InventoryItemAndLocationByLocMap">
<if-empty field-name="fromLocationTotalAvailableToPromise.${locationSeqId}">
<if-empty field="fromLocationTotalAvailableToPromise.${locationSeqId}">
<calculate field-name="totalQuantityOnHand" type="Double"><number value="0"/></calculate>
<calculate field-name="totalAvailableToPromise" type="Double"><number value="0"/></calculate>
<iterate entry-name="inventoryItem" list-name="perLocationInventoryItemAndLocList">
@@ -294,8 +294,8 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="totalAvailableToPromise" operator="greater" value="0" type="Double"/>
<if-compare field-name="targetLocationMoveQuantity" operator="greater" value="0" type="Double"/>
<if-compare field="totalAvailableToPromise" operator="greater" value="0" type="Double"/>
<if-compare field="targetLocationMoveQuantity" operator="greater" value="0" type="Double"/>
</and>
</condition>
<then>
@@ -312,7 +312,7 @@ under the License.
<!-- see if there is enough left for the full amount in targetLocationMoveQuantity,
if not do whatever is available and put difference back in targetLocationMoveQuantity,
trying to move more from the location than is there, find the difference and put it in targetLocationMoveQuantity -->
<if-compare-field field-name="totalAvailableToPromise" operator="less" to-field-name="targetLocationMoveQuantity" type="Double">
<if-compare-field field="totalAvailableToPromise" to-field="targetLocationMoveQuantity" operator="less" type="Double">
<calculate field-name="targetLocationMoveQuantity" type="Double">
<calcop field-name="targetLocationMoveQuantity" operator="subtract"><calcop field-name="totalAvailableToPromise" operator="get"/></calcop>
</calculate>
@@ -367,7 +367,7 @@ under the License.
<call-simple-method method-name="processOisgirMoveByStatusInline"/>
<!-- Now for any remaining quantity, do a simple, ie non-OISGIR, stock move -->
<if-compare field-name="quantityLeftToProcess" operator="greater" value="0" type="Double">
<if-compare field="quantityLeftToProcess" operator="greater" value="0" type="Double">
<!-- find InventoryItems in the origin location with some availableToPromise to move -->
<entity-and entity-name="InventoryItem" list-name="inventoryItemList">
<field-map field-name="productId" env-name="parameters.productId"/>
@@ -378,10 +378,10 @@ under the License.
<iterate entry-name="inventoryItem" list-name="inventoryItemList">
<!-- for each inventoryItem only process if quantityLeftToProcess > 0 and inventoryItem.availableToPromiseTotal > 0 -->
<if-compare field-name="quantityLeftToProcess" operator="greater" value="0" type="Double">
<if-compare field-name="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double">
<if-compare field="quantityLeftToProcess" operator="greater" value="0" type="Double">
<if-compare field="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double">
<!-- set the currentQuantityToMove to the lower of these two values to ensure we don't move too much -->
<if-compare-field field-name="quantityLeftToProcess" operator="greater" to-field-name="inventoryItem.availableToPromiseTotal" type="Double">
<if-compare-field field="quantityLeftToProcess" to-field="inventoryItem.availableToPromiseTotal" operator="greater" type="Double">
<set from-field="inventoryItem.availableToPromiseTotal" field="currentQuantityToMove"/>
<else>
<set from-field="quantityLeftToProcess" field="currentQuantityToMove"/>
@@ -422,7 +422,7 @@ under the License.
</iterate>
</if-compare>
<if-compare field-name="quantityLeftToProcess" operator="greater" value="0" type="Double">
<if-compare field="quantityLeftToProcess" operator="greater" value="0" type="Double">
<!-- this really isn't good, that means more was moved than we found to move, how did that happen? -->
<string-to-list string="ERROR: Not enough available inventory found in location [${parameters.locationSeqId}] in facility [${parameters.facilityId}], did not reallocate ${quantityLeftToProcess} of the ${parameters.quantityMoved} reported as physically moved." list-name="warningMessageList"/>
</if-compare>
@@ -448,7 +448,7 @@ under the License.
<entity-one entity-name="InventoryItem" value-name="inventoryItem"/>
<!-- if this is a serialized InventoryItem, then just update the location -->
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="SERIALIZED_INV_ITEM">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="SERIALIZED_INV_ITEM">
<set from-field="parameters.targetLocationSeqId" field="inventoryItem.locationSeqId"/>
<store-value value-name="inventoryItem"/>
</if-compare>
@@ -457,7 +457,7 @@ under the License.
if this is a non-serialized InventoryItem, create a new targetInventoryItem in the
target location and start moving all OrderItemShipGrpInvRes over, plus min move quantity from ProductFacilityLocation
-->
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
<!-- create a new InventoryItem for the targetInventoryItem -->
<make-value entity-name="InventoryItem" map-name="inventoryItem" value-name="targetInventoryItem"/>
<set from-field="parameters.targetLocationSeqId" field="targetInventoryItem.locationSeqId"/>
@@ -488,7 +488,7 @@ under the License.
OISGIR (reservation), so we would have to split it up
-->
<clear-field field-name="reservedQuantityLeftOver"/>
<if-compare-field field-name="quantityLeftToProcess" operator="less" to-field-name="orderItemShipGrpInvRes.quantity" type="Double">
<if-compare-field field="quantityLeftToProcess" to-field="orderItemShipGrpInvRes.quantity" operator="less" type="Double">
<!-- the complicated part: can split up the OISGIR (reservation) into two parts, and then transfer the inventory, somewhat complicated... -->
<calculate field-name="reservedQuantityLeftOver" type="Double">
<calcop field-name="orderItemShipGrpInvRes.quantity" operator="get"/>
@@ -507,7 +507,7 @@ under the License.
</if-compare-field>
<!-- now make sure that the currentQuantityToMove we decided on is not greater than remainingQuantityOnHand... -->
<if-compare-field field-name="currentQuantityToMove" operator="greater" to-field-name="remainingQuantityOnHand" type="Double">
<if-compare-field field="currentQuantityToMove" to-field="remainingQuantityOnHand" operator="greater" type="Double">
<set from-field="remainingQuantityOnHand" field="currentQuantityToMove"/>
</if-compare-field>
@@ -515,9 +515,9 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="orderItemShipGrpInvRes.quantityNotAvailable"/></not>
<not><if-empty field-name="reservedQuantityLeftOver"/></not>
<if-compare-field field-name="orderItemShipGrpInvRes.quantityNotAvailable" operator="greater" to-field-name="reservedQuantityLeftOver" type="Double"/>
<not><if-empty field="orderItemShipGrpInvRes.quantityNotAvailable"/></not>
<not><if-empty field="reservedQuantityLeftOver"/></not>
<if-compare-field field="orderItemShipGrpInvRes.quantityNotAvailable" to-field="reservedQuantityLeftOver" operator="greater" type="Double"/>
</and>
</condition>
<then>
@@ -554,8 +554,8 @@ under the License.
ProductFacilityLocation based pre-emptive move is done
-->
<!-- if the OISGIR has a quantityNotAvailable, move that over by adding it to the origin, and subtracting it from the target -->
<if-not-empty field-name="orderItemShipGrpInvRes.quantityNotAvailable">
<if-compare field-name="orderItemShipGrpInvRes.quantityNotAvailable" operator="greater" value="0" type="Double">
<if-not-empty field="orderItemShipGrpInvRes.quantityNotAvailable">
<if-compare field="orderItemShipGrpInvRes.quantityNotAvailable" operator="greater" value="0" type="Double">
<calculate field-name="createOisgirDetailMap.availableToPromiseDiff" type="Double">
<calcop field-name="quantityNotAvailableToMove" operator="get"/>
</calculate>
@@ -570,7 +570,7 @@ under the License.
<!-- create the new and remove or update the old OISGIRs -->
<create-value value-name="targetOrderItemShipGrpInvRes"/>
<if-empty field-name="reservedQuantityLeftOver">
<if-empty field="reservedQuantityLeftOver">
<remove-value value-name="orderItemShipGrpInvRes"/>
<else>
<calculate field-name="orderItemShipGrpInvRes.quantity" type="Double">
@@ -600,7 +600,7 @@ under the License.
<!-- <log level="info" message="Just update targetInventoryItem from OISGIR [${targetInventoryItem}]"/> -->
</iterate>
<if-compare field-name="haveSetIiDetail" operator="equals" value="N">
<if-compare field="haveSetIiDetail" operator="equals" value="N">
<log level="info" message="Did not end up finding an OISGIR that we could move inventory with, so removing targetInventoryItem: ${targetInventoryItem}"/>
<remove-value value-name="targetInventoryItem"/>
</if-compare>
@@ -34,7 +34,7 @@ under the License.
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<set field="newEntity.fromDate" from-field="nowTimestamp" />
</if-empty>
<field-to-result field-name="fromDate" map-name="newEntity"/>
@@ -115,7 +115,7 @@ under the License.
<check-errors/>
<make-value entity-name="ProductPaymentMethodType" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<create-value value-name="newEntity"/>
</simple-method>
@@ -58,7 +58,7 @@ under the License.
<!-- create association with ProductStore.digProdUploadCategoryId -->
<entity-one entity-name="ProductStore" value-name="productStore"/>
<if-not-empty field-name="productStore.digProdUploadCategoryId">
<if-not-empty field="productStore.digProdUploadCategoryId">
<make-value value-name="addProductToCategoryMap" entity-name="ProductCategoryMember"/>
<set field="addProductToCategoryMap.productId" from-field="productId"/>
<set field="addProductToCategoryMap.productCategoryId" from-field="productStore.digProdUploadCategoryId"/>
@@ -72,7 +72,7 @@ under the License.
<set field="parameters.partyId" from-field="userLogin.partyId"/>
<entity-one entity-name="SupplierProduct" value-name="supplierProduct"/>
<if-empty field-name="supplierProduct">
<if-empty field="supplierProduct">
<add-error><fail-message message="Cannot update this Product: you are not associated with it as the Supplier"/></add-error>
</if-empty>
<check-errors/>
@@ -81,8 +81,8 @@ under the License.
<if>
<condition>
<or>
<not><if-empty field-name="parameters.productName"></if-empty></not>
<not><if-empty field-name="parameters.description"></if-empty></not>
<not><if-empty field="parameters.productName"></if-empty></not>
<not><if-empty field="parameters.description"></if-empty></not>
</or>
</condition>
<then>
@@ -94,7 +94,7 @@ under the License.
</if>
<!-- update price -->
<if-not-empty field-name="parameters.price">
<if-not-empty field="parameters.price">
<entity-and entity-name="ProductPrice" list-name="productPriceList">
<field-map field-name="productId" env-name="parameters.productId"/>
<field-map field-name="productPriceTypeId" value="DEFAULT_PRICE"/>
@@ -116,7 +116,7 @@ under the License.
<field-map field-name="partyId" env-name="userLogin.partyId"/>
</entity-and>
<if-empty field-name="supplierProductList">
<if-empty field="supplierProductList">
<add-error><fail-message message="Cannot update this Product: you are not associated with it as a Supplier"/></add-error>
</if-empty>
<check-errors/>
@@ -144,7 +144,7 @@ under the License.
<field-map field-name="productId" env-name="parameters.productId"/>
<field-map field-name="partyId" env-name="userLogin.partyId"/>
</entity-and>
<if-empty field-name="supplierProductList">
<if-empty field="supplierProductList">
<add-error><fail-message message="Cannot update this Product: you are not associated with it as a Supplier"/></add-error>
</if-empty>
@@ -154,7 +154,7 @@ under the License.
<field-map field-name="contentId" env-name="parameters.contentId"/>
<field-map field-name="roleTypeId" value="OWNER"/>
</entity-and>
<if-empty field-name="contentRoleList">
<if-empty field="contentRoleList">
<add-error><fail-message message="Cannot add this Content: you are not associated with it as an Owner"/></add-error>
</if-empty>
@@ -176,7 +176,7 @@ under the License.
<field-map field-name="partyId" env-name="userLogin.partyId"/>
</entity-and>
<if-empty field-name="supplierProductList">
<if-empty field="supplierProductList">
<add-error><fail-message message="Cannot update this Product: you are not associated with it as a Supplier"/></add-error>
</if-empty>
<check-errors/>
@@ -26,7 +26,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp" />
</if-empty>
@@ -31,7 +31,7 @@ under the License.
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set from-field="parameters.productId" field="newEntity.productId"/>
<if-empty field-name="newEntity.productId">
<if-empty field="newEntity.productId">
<sequenced-id-to-env sequence-name="Product" env-name="newEntity.productId"/>
<else>
<check-id field-name="productId" map-name="newEntity"/>
@@ -45,13 +45,13 @@ under the License.
<set from-field="nowTimestamp" field="newEntity.lastModifiedDate"/>
<set from-field="userLogin.userLoginId" field="newEntity.lastModifiedByUserLogin"/>
<set from-field="userLogin.userLoginId" field="newEntity.createdByUserLogin"/>
<if-empty field-name="newEntity.isVariant">
<if-empty field="newEntity.isVariant">
<set field="newEntity.isVariant" value="N"/>
</if-empty>
<if-empty field-name="newEntity.isVirtual">
<if-empty field="newEntity.isVirtual">
<set field="newEntity.isVirtual" value="N"/>
</if-empty>
<if-empty field-name="newEntity.billOfMaterialLevel">
<if-empty field="newEntity.billOfMaterialLevel">
<set field="newEntity.billOfMaterialLevel" value="0" type="Integer"/>
</if-empty>
@@ -59,7 +59,7 @@ under the License.
<!-- if setting the primaryProductCategoryId create a member entity too -->
<!-- THIS IS REMOVED BECAUSE IT CAUSES PROBLEMS FOR WORKING ON PRODUCTION SITES
<if-not-empty field-name="primaryProductCategoryId" map-name="newEntity">
<if-not-empty field="newEntity.primaryProductCategoryId">
<make-value entity-name="ProductCategoryMember" value-name="newMember"/>
<set from-field="productId" map-name="newEntity" to-field-name="productId" to-map-name="newMember"/>
<set from-field="primaryProductCategoryId" map-name="newEntity" to-field-name="productCategoryId" to-map-name="newMember"/>
@@ -105,8 +105,8 @@ under the License.
<!-- if setting the primaryParentCategoryId, create a rollup entity too -->
<!-- THIS IS REMOVED BECAUSE IT CAUSES PROBLEMS FOR WORKING ON PRODUCTION SITES
<if-not-empty field-name="primaryProductCategoryId" map-name="lookedUpValue">
<if-compare-field field-name="primaryProductCategoryId" map-name="lookedUpValue" operator="equals" to-map-name="saveIdMap">
<if-not-empty field="lookedUpValue.primaryProductCategoryId">
<if-compare-field to-field="saveIdMap." field="lookedUpValue.primaryProductCategoryId" operator="equals">
<make-value entity-name="ProductCategoryMember" value-name="newMember"/>
<set from-field="productId" map-name="newEntity" to-field-name="productId" to-map-name="newMember"/>
<set from-field="primaryProductCategoryId" map-name="newEntity" to-field-name="productCategoryId" to-map-name="newMember"/>
@@ -126,7 +126,7 @@ under the License.
<entity-one entity-name="Product" value-name="lookedUpValue"/>
<set from-field="parameters.productName" field="lookedUpValue.productName"/>
<if-compare field-name="lookedUpValue.isVirtual" operator="equals" value="Y">
<if-compare field="lookedUpValue.isVirtual" operator="equals" value="Y">
<set from-field="lookedUpValue.productName" field="lookedUpValue.internalName"/>
</if-compare>
@@ -135,7 +135,7 @@ under the License.
<store-value value-name="lookedUpValue"/>
<if-compare field-name="lookedUpValue.isVirtual" operator="equals" value="Y">
<if-compare field="lookedUpValue.isVirtual" operator="equals" value="Y">
<!-- get all variant products, to update their productNames -->
<set from-field="parameters.productId" field="variantProductAssocMap.productId"/>
<set value="PRODUCT_VARIANT" field="variantProductAssocMap.productAssocTypeId"/>
@@ -175,22 +175,22 @@ under the License.
<set from-field="parameters.productId" field="newProduct.productId"/>
<!-- if requested, set the new internalName field -->
<if-not-empty field-name="newInternalName" map-name="parameters">
<if-not-empty field="parameters.newInternalName">
<set from-field="parameters.newInternalName" field="newProduct.internalName"/>
</if-not-empty>
<!-- if requested, set the new productName field -->
<if-not-empty field-name="newProductName" map-name="parameters">
<if-not-empty field="parameters.newProductName">
<set from-field="parameters.newProductName" field="newProduct.productName"/>
</if-not-empty>
<!-- if requested, set the new description field -->
<if-not-empty field-name="newDescription" map-name="parameters">
<if-not-empty field="parameters.newDescription">
<set from-field="parameters.newDescription" field="newProduct.description"/>
</if-not-empty>
<!-- if requested, set the new longDescription field -->
<if-not-empty field-name="newLongDescription" map-name="parameters">
<if-not-empty field="parameters.newLongDescription">
<set from-field="parameters.newLongDescription" field="newProduct.longDescription"/>
</if-not-empty>
@@ -201,7 +201,7 @@ under the License.
<set field="reverseProductFindContext.productIdTo" from-field="parameters.oldProductId"/>
<!-- if requested, duplicate related data as well -->
<if-not-empty field-name="duplicatePrices" map-name="parameters">
<if-not-empty field="parameters.duplicatePrices">
<find-by-and entity-name="ProductPrice" map-name="productFindContext" list-name="foundValues"/>
<iterate entry-name="foundValue" list-name="foundValues">
<clone-value value-name="foundValue" new-value-name="newTempValue"/>
@@ -209,7 +209,7 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateIDs" map-name="parameters">
<if-not-empty field="parameters.duplicateIDs">
<find-by-and entity-name="GoodIdentification" map-name="productFindContext" list-name="foundValues"/>
<iterate entry-name="foundValue" list-name="foundValues">
<clone-value value-name="foundValue" new-value-name="newTempValue"/>
@@ -217,7 +217,7 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateContent" map-name="parameters">
<if-not-empty field="parameters.duplicateContent">
<find-by-and entity-name="ProductContent" map-name="productFindContext" list-name="foundValues"/>
<iterate entry-name="foundValue" list-name="foundValues">
<clone-value value-name="foundValue" new-value-name="newTempValue"/>
@@ -225,7 +225,7 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateCategoryMembers" map-name="parameters">
<if-not-empty field="parameters.duplicateCategoryMembers">
<find-by-and entity-name="ProductCategoryMember" map-name="productFindContext" list-name="foundValues"/>
<iterate entry-name="foundValue" list-name="foundValues">
<clone-value value-name="foundValue" new-value-name="newTempValue"/>
@@ -233,7 +233,7 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateAssocs" map-name="parameters">
<if-not-empty field="parameters.duplicateAssocs">
<find-by-and entity-name="ProductAssoc" map-name="productFindContext" list-name="foundValues"/>
<iterate entry-name="foundValue" list-name="foundValues">
<clone-value value-name="foundValue" new-value-name="newTempValue"/>
@@ -251,7 +251,7 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateAttributes" map-name="parameters">
<if-not-empty field="parameters.duplicateAttributes">
<find-by-and entity-name="ProductAttribute" map-name="productFindContext" list-name="foundValues"/>
<iterate entry-name="foundValue" list-name="foundValues">
<clone-value value-name="foundValue" new-value-name="newTempValue"/>
@@ -259,7 +259,7 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateFeatureAppls" map-name="parameters">
<if-not-empty field="parameters.duplicateFeatureAppls">
<find-by-and entity-name="ProductFeatureAppl" map-name="productFindContext" list-name="foundValues"/>
<iterate entry-name="foundValue" list-name="foundValues">
<clone-value value-name="foundValue" new-value-name="newTempValue"/>
@@ -267,7 +267,7 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateInventoryItems" map-name="parameters">
<if-not-empty field="parameters.duplicateInventoryItems">
<find-by-and entity-name="InventoryItem" map-name="productFindContext" list-name="foundValues"/>
<iterate entry-name="foundValue" list-name="foundValues">
<!--
@@ -288,30 +288,30 @@ under the License.
</if-not-empty>
<!-- if requested, remove related data as well -->
<if-not-empty field-name="removePrices" map-name="parameters">
<if-not-empty field="parameters.removePrices">
<remove-by-and entity-name="ProductPrice" map-name="productFindContext"/>
</if-not-empty>
<if-not-empty field-name="removeIDs" map-name="parameters">
<if-not-empty field="parameters.removeIDs">
<remove-by-and entity-name="GoodIdentification" map-name="productFindContext"/>
</if-not-empty>
<if-not-empty field-name="removeContent" map-name="parameters">
<if-not-empty field="parameters.removeContent">
<remove-by-and entity-name="ProductContent" map-name="productFindContext"/>
</if-not-empty>
<if-not-empty field-name="removeCategoryMembers" map-name="parameters">
<if-not-empty field="parameters.removeCategoryMembers">
<remove-by-and entity-name="ProductCategoryMember" map-name="productFindContext"/>
</if-not-empty>
<if-not-empty field-name="removeAssocs" map-name="parameters">
<if-not-empty field="parameters.removeAssocs">
<remove-by-and entity-name="ProductAssoc" map-name="productFindContext"/>
<!-- small difference here, also do the reverse assocs... -->
<remove-by-and entity-name="ProductAssoc" map-name="reverseProductFindContext"/>
</if-not-empty>
<if-not-empty field-name="removeAttributes" map-name="parameters">
<if-not-empty field="parameters.removeAttributes">
<remove-by-and entity-name="ProductAttribute" map-name="productFindContext"/>
</if-not-empty>
<if-not-empty field-name="removeFeatureAppls" map-name="parameters">
<if-not-empty field="parameters.removeFeatureAppls">
<remove-by-and entity-name="ProductFeatureAppl" map-name="productFindContext"/>
</if-not-empty>
<if-not-empty field-name="removeInventoryItems" map-name="parameters">
<if-not-empty field="parameters.removeInventoryItems">
<remove-by-and entity-name="InventoryItem" map-name="productFindContext"/>
</if-not-empty>
</simple-method>
@@ -348,7 +348,7 @@ under the License.
<!-- if it is the Product entity itself triggering this action, then a [productInstance] parameter
will be passed and we can save a few cycles looking that up -->
<set from-field="parameters.productInstance" field="productInstance"/>
<if-empty field-name="productInstance">
<if-empty field="productInstance">
<set from-field="parameters.productId" field="findProductMap.productId"/>
<find-by-primary-key entity-name="Product" map-name="findProductMap" value-name="productInstance"/>
</if-empty>
@@ -357,8 +357,8 @@ under the License.
<if>
<condition>
<or>
<if-empty field-name="autoCreateKeywords" map-name="productInstance"/>
<if-compare field-name="autoCreateKeywords" map-name="productInstance" operator="equals" value="Y"/>
<if-empty field="productInstance.autoCreateKeywords"/>
<if-compare field="productInstance.autoCreateKeywords" operator="equals" value="Y"/>
</or>
</condition>
<then>
@@ -378,7 +378,7 @@ under the License.
<!-- expire product from all categories -->
<get-related value-name="product" relation-name="ProductCategoryMember" list-name="productCategoryMembers"/>
<iterate entry-name="productCategoryMember" list-name="productCategoryMembers">
<if-empty field-name="productCategoryMember.thruDate">
<if-empty field="productCategoryMember.thruDate">
<set from-field="nowTimestamp" field="productCategoryMember.thruDate"/>
<store-value value-name="productCategoryMember"/>
</if-empty>
@@ -386,7 +386,7 @@ under the License.
<!-- expire product from all associations going to it -->
<get-related value-name="product" relation-name="AssocProductAssoc" list-name="assocProductAssocs"/>
<iterate entry-name="assocProductAssoc" list-name="assocProductAssocs">
<if-empty field-name="assocProductAssoc.thruDate">
<if-empty field="assocProductAssoc.thruDate">
<set from-field="nowTimestamp" field="assocProductAssoc.thruDate"/>
<store-value value-name="assocProductAssoc"/>
</if-empty>
@@ -394,11 +394,11 @@ under the License.
</simple-method>
<simple-method method-name="countProductView" short-description="Count Product View" login-required="false">
<if-empty field-name="parameters.weight">
<if-empty field="parameters.weight">
<calculate field-name="parameters.weight" type="Long"><number value="1"/></calculate>
</if-empty>
<entity-one entity-name="ProductCalculatedInfo" value-name="productCalculatedInfo"/>
<if-empty field-name="productCalculatedInfo">
<if-empty field="productCalculatedInfo">
<!-- go ahead and create it -->
<make-value value-name="productCalculatedInfo" entity-name="ProductCalculatedInfo"/>
<set from-field="parameters.productId" field="productCalculatedInfo.productId"/>
@@ -419,18 +419,18 @@ under the License.
<call-class-method class-name="org.ofbiz.product.product.ProductWorker" method-name="getVariantVirtualId" ret-field-name="virtualProductId">
<field field-name="product" type="GenericValue"/>
</call-class-method>
<if-not-empty field-name="virtualProductId">
<if-not-empty field="virtualProductId">
<set from-field="virtualProductId" field="callSubMap.productId"/>
<set from-field="parameters.weight" field="callSubMap.weight"/>
<call-service service-name="countProductView" in-map-name="callSubMap"></call-service>
</if-not-empty>
</simple-method>
<simple-method method-name="countProductQuantityOrdered" short-description="Count Product Quantity Ordered" login-required="true">
<if-empty field-name="parameters.quantity">
<if-empty field="parameters.quantity">
<calculate field-name="parameters.quantity" type="Double"><number value="1"/></calculate>
</if-empty>
<entity-one entity-name="ProductCalculatedInfo" value-name="productCalculatedInfo"/>
<if-empty field-name="productCalculatedInfo">
<if-empty field="productCalculatedInfo">
<!-- go ahead and create it -->
<make-value value-name="productCalculatedInfo" entity-name="ProductCalculatedInfo"/>
<set from-field="parameters.productId" field="productCalculatedInfo.productId"/>
@@ -451,7 +451,7 @@ under the License.
<call-class-method class-name="org.ofbiz.product.product.ProductWorker" method-name="getVariantVirtualId" ret-field-name="virtualProductId">
<field field-name="product" type="GenericValue"/>
</call-class-method>
<if-not-empty field-name="virtualProductId">
<if-not-empty field="virtualProductId">
<set from-field="virtualProductId" field="callSubMap.productId"/>
<set from-field="parameters.quantity" field="callSubMap.quantity"/>
<call-service service-name="countProductQuantityOrdered" in-map-name="callSubMap"></call-service>
@@ -539,14 +539,14 @@ under the License.
<!-- code to check for auto-approved reviews (store setting) -->
<entity-one entity-name="ProductStore" value-name="productStore"/>
<if-not-empty field-name="productStore">
<if-compare field-name="productStore.autoApproveReviews" operator="equals" value="Y">
<if-not-empty field="productStore">
<if-compare field="productStore.autoApproveReviews" operator="equals" value="Y">
<set value="PRR_APPROVED" field="newEntity.statusId"/>
</if-compare>
</if-not-empty>
<!-- auto approve the review if it is just a rating and has no review text -->
<if-empty field-name="parameters.productReview">
<if-empty field="parameters.productReview">
<set value="PRR_APPROVED" field="newEntity.statusId"/>
</if-empty>
@@ -554,7 +554,7 @@ under the License.
<sequenced-id-to-env sequence-name="ProductReview" env-name="newEntity.productReviewId"/>
<field-to-result field-name="newEntity.productReviewId" result-name="productReviewId"/>
<if-empty field-name="postedDateTime" map-name="newEntity">
<if-empty field="newEntity.postedDateTime">
<now-timestamp-to-env env-name="newEntity.postedDateTime"/>
</if-empty>
@@ -586,12 +586,12 @@ under the License.
<field field-name="productId" type="java.lang.String"/>
</call-class-method>
<log level="info" message="Got new average customer rating ${averageCustomerRating}"/>
<if-compare field-name="averageCustomerRating" operator="equals" value="0" type="Double">
<if-compare field="averageCustomerRating" operator="equals" value="0" type="Double">
<return/>
</if-compare>
<!-- update the review average on the ProductCalculatedInfo entity -->
<entity-one entity-name="ProductCalculatedInfo" value-name="productCalculatedInfo"/>
<if-empty field-name="productCalculatedInfo">
<if-empty field="productCalculatedInfo">
<!-- go ahead and create it -->
<make-value value-name="productCalculatedInfo" entity-name="ProductCalculatedInfo"/>
<set from-field="parameters.productId" field="productCalculatedInfo.productId"/>
@@ -621,8 +621,8 @@ under the License.
<iterate entry-name="newProduct" list-name="variants">
<set from-field="newProduct.productIdTo" field="productVariantContext.productId"/>
<!-- if requested, duplicate related data -->
<if-not-empty field-name="duplicatePrices" map-name="parameters">
<if-not-empty field-name="removeBefore" map-name="parameters">
<if-not-empty field="parameters.duplicatePrices">
<if-not-empty field="parameters.removeBefore">
<find-by-and entity-name="ProductPrice" map-name="productVariantContext" list-name="foundVariantValues"/>
<iterate entry-name="foundVariantValue" list-name="foundVariantValues">
<remove-value value-name="foundVariantValue"/>
@@ -635,8 +635,8 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateIDs" map-name="parameters">
<if-not-empty field-name="removeBefore" map-name="parameters">
<if-not-empty field="parameters.duplicateIDs">
<if-not-empty field="parameters.removeBefore">
<find-by-and entity-name="GoodIdentification" map-name="productVariantContext" list-name="foundVariantValues"/>
<iterate entry-name="foundVariantValue" list-name="foundVariantValues">
<remove-value value-name="foundVariantValue"/>
@@ -649,8 +649,8 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateContent" map-name="parameters">
<if-not-empty field-name="removeBefore" map-name="parameters">
<if-not-empty field="parameters.duplicateContent">
<if-not-empty field="parameters.removeBefore">
<find-by-and entity-name="ProductContent" map-name="productVariantContext" list-name="foundVariantValues"/>
<iterate entry-name="foundVariantValue" list-name="foundVariantValues">
<remove-value value-name="foundVariantValue"/>
@@ -663,8 +663,8 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateCategoryMembers" map-name="parameters">
<if-not-empty field-name="removeBefore" map-name="parameters">
<if-not-empty field="parameters.duplicateCategoryMembers">
<if-not-empty field="parameters.removeBefore">
<find-by-and entity-name="ProductCategoryMember" map-name="productVariantContext" list-name="foundVariantValues"/>
<iterate entry-name="foundVariantValue" list-name="foundVariantValues">
<remove-value value-name="foundVariantValue"/>
@@ -677,8 +677,8 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateAttributes" map-name="parameters">
<if-not-empty field-name="removeBefore" map-name="parameters">
<if-not-empty field="parameters.duplicateAttributes">
<if-not-empty field="parameters.removeBefore">
<find-by-and entity-name="ProductAttribute" map-name="productVariantContext" list-name="foundVariantValues"/>
<iterate entry-name="foundVariantValue" list-name="foundVariantValues">
<remove-value value-name="foundVariantValue"/>
@@ -691,8 +691,8 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="duplicateFacilities" map-name="parameters">
<if-not-empty field-name="removeBefore" map-name="parameters">
<if-not-empty field="parameters.duplicateFacilities">
<if-not-empty field="parameters.removeBefore">
<find-by-and entity-name="ProductFacility" map-name="productVariantContext" list-name="foundVariantValues"/>
<iterate entry-name="foundVariantValue" list-name="foundVariantValues">
<remove-value value-name="foundVariantValue"/>
@@ -705,8 +705,8 @@ under the License.
<create-value value-name="newTempValue"/>
</iterate>
</if-not-empty>
<if-not-empty field-name="parameters.duplicateLocations">
<if-not-empty field-name="parameters.removeBefore">
<if-not-empty field="parameters.duplicateLocations">
<if-not-empty field="parameters.removeBefore">
<find-by-and entity-name="ProductFacilityLocation" map-name="productVariantContext" list-name="foundVariantValues"/>
<iterate entry-name="foundVariantValue" list-name="foundVariantValues">
<remove-value value-name="foundVariantValue"/>
@@ -844,10 +844,10 @@ under the License.
<!-- a method to centralize product security code, meant to be called in-line with
call-simple-method, and the checkAction and callingMethodName attributes should be in the method context -->
<simple-method method-name="checkProductRelatedPermission" short-description="Check Product Related Permission">
<if-empty field-name="callingMethodName">
<if-empty field="callingMethodName">
<set value="this operation" field="callingMethodName"/>
</if-empty>
<if-empty field-name="checkAction">
<if-empty field="checkAction">
<set value="UPDATE" field="checkAction"/>
</if-empty>
@@ -872,10 +872,10 @@ under the License.
<if-has-permission permission="CATALOG" action="_${checkAction}"/>
<and>
<if-has-permission permission="CATALOG_ROLE" action="_${checkAction}"/>
<not><if-empty field-name="roleCategories"/></not>
<not><if-empty field="roleCategories"/></not>
</and>
<and>
<not><if-empty field-name="alternatePermissionRoot"/></not>
<not><if-empty field="alternatePermissionRoot"/></not>
<if-has-permission permission="${alternatePermissionRoot}" action="_${checkAction}"/>
</and>
</or>
@@ -888,7 +888,7 @@ under the License.
</simple-method>
<simple-method method-name="productGenericPermission" short-description="Main permission logic">
<set field="mainAction" from-field="parameters.mainAction"/>
<if-empty field-name="mainAction">
<if-empty field="mainAction">
<add-error><fail-message message="In the permission-service element for the productGenericPermission service the main-action attribute was missing but is required"/></add-error>
<check-errors/>
</if-empty>
@@ -897,7 +897,7 @@ under the License.
<set field="checkAction" from-field="parameters.mainAction"/>
<call-simple-method method-name="checkProductRelatedPermission"/>
<if-empty field-name="error_list">
<if-empty field="error_list">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
@@ -940,7 +940,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -40,7 +40,7 @@ under the License.
login-required="false">
<set field="args" from-field="parameters.arguments"/>
<if-empty field-name="args.conversionParameters.productId">
<if-empty field="args.conversionParameters.productId">
<add-error> <fail-property property="NoProductSpecifiedForUomConversion" resource="ProductUiLabels"/> </add-error>
<check-errors/>
</if-empty>
@@ -51,7 +51,7 @@ under the License.
<log level="verbose" message="convertUomProduct: productId=${productId}"/>
<entity-one entity-name="Product" value-name="product" auto-field-map="true"/>
<if-empty field-name="product">
<if-empty field="product">
<add-error> <fail-property property="NoProductSpecifiedForUomConversion" resource="ProductUiLabels"/> </add-error>
<check-errors/>
</if-empty>
@@ -63,16 +63,16 @@ under the License.
<entity-one entity-name="Uom" value-name="toUom" auto-field-map="true"/>
<!-- if the UoM types are the same, just use the uomConversion.conversionFactor (not product based) -->
<if-compare-field field-name="fromUom.uomTypeId" operator="equals" to-field-name="toUom.uomTypeId">
<if-compare-field field="fromUom.uomTypeId" to-field="toUom.uomTypeId" operator="equals">
<set field="productFactor" from-field="args.uomConversion.conversionFactor"/>
<else>
<!-- Determine a conversion value for the From UoM -->
<set field="fromVal" type="Double" value="1"/>
<if-compare field-name="fromUom.uomTypeId" operator="equals" value="LENGTH_MEASURE">
<if-compare field="fromUom.uomTypeId" operator="equals" value="LENGTH_MEASURE">
<set field="fromVal" type="Double" from-field="product.productDepth"/>
</if-compare>
<if-compare field-name="fromUom.uomTypeId" operator="equals" value="AREA_MEASURE">
<if-compare field="fromUom.uomTypeId" operator="equals" value="AREA_MEASURE">
<calculate field-name="fromVal" type="Double" decimal-scale="15">
<calcop operator="multiply">
<calcop operator="get" field-name="product.productDepth"/>
@@ -80,7 +80,7 @@ under the License.
</calcop>
</calculate>
</if-compare>
<if-compare field-name="fromUom.uomTypeId" operator="equals" value="VOLUME_DRY_MEASURE">
<if-compare field="fromUom.uomTypeId" operator="equals" value="VOLUME_DRY_MEASURE">
<calculate field-name="fromVal" type="Double" decimal-scale="15">
<calcop operator="multiply">
<calcop operator="get" field-name="product.productDepth"/>
@@ -91,17 +91,17 @@ under the License.
</calcop>
</calculate>
</if-compare>
<if-compare field-name="fromUom.uomTypeId" operator="equals" value="WEIGHT_MEASURE">
<if-compare field="fromUom.uomTypeId" operator="equals" value="WEIGHT_MEASURE">
<set field="fromVal" from-field="product.weight"/>
</if-compare>
<log level="verbose" message="From product-based conversion factor: ${fromVal}"/>
<!-- Determine a conversion value for the To UoM -->
<set field="toVal" type="Double" value="1"/>
<if-compare field-name="toUom.uomTypeId" operator="equals" value="LENGTH_MEASURE">
<if-compare field="toUom.uomTypeId" operator="equals" value="LENGTH_MEASURE">
<set field="toVal" from-field="product.productDepth"/>
</if-compare>
<if-compare field-name="toUom.uomTypeId" operator="equals" value="AREA_MEASURE">
<if-compare field="toUom.uomTypeId" operator="equals" value="AREA_MEASURE">
<calculate field-name="toVal" type="Double" decimal-scale="15">
<calcop operator="multiply">
<calcop operator="get" field-name="product.productDepth"/>
@@ -109,7 +109,7 @@ under the License.
</calcop>
</calculate>
</if-compare>
<if-compare field-name="toUom.uomTypeId" operator="equals" value="VOLUME_DRY_MEASURE">
<if-compare field="toUom.uomTypeId" operator="equals" value="VOLUME_DRY_MEASURE">
<calculate field-name="toVal" type="Double" decimal-scale="15">
<calcop operator="multiply">
<calcop operator="get" field-name="product.productDepth"/>
@@ -120,7 +120,7 @@ under the License.
</calcop>
</calculate>
</if-compare>
<if-compare field-name="toUom.uomTypeId" operator="equals" value="WEIGHT_MEASURE">
<if-compare field="toUom.uomTypeId" operator="equals" value="WEIGHT_MEASURE">
<set field="toVal" from-field="product.weight"/>
</if-compare>
<log level="verbose" message="To product-based conversion factor: ${toVal}"/>
@@ -31,7 +31,7 @@ under the License.
<sequenced-id-to-env sequence-name="ProductPromo" env-name="newEntity.productPromoId"/>
<field-to-result field-name="productPromoId" map-name="newEntity"/>
<if-empty field-name="newEntity.userEntered">
<if-empty field="newEntity.userEntered">
<set value="Y" set-if-empty="true" field="newEntity.userEntered"/>
</if-empty>
@@ -52,7 +52,7 @@ under the License.
<find-by-primary-key entity-name="ProductPromo" map-name="lookupPKMap" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<if-empty field-name="lookedUpValue.userEntered">
<if-empty field="lookedUpValue.userEntered">
<set value="Y" set-if-empty="true" field="lookedUpValue.userEntered"/>
</if-empty>
@@ -153,14 +153,14 @@ under the License.
<make-value value-name="newEntity" entity-name="ProductPromoCode"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.productPromoCodeId">
<if-empty field="newEntity.productPromoCodeId">
<sequenced-id-to-env sequence-name="ProductPromoCode" env-name="newEntity.productPromoCodeId" stagger-max="100"/>
</if-empty>
<field-to-result field-name="productPromoCodeId" map-name="newEntity"/>
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<set field="newEntity.fromDate" from-field="nowTimestamp"/>
</if-empty>
<set from-field="nowTimestamp" field="newEntity.createdDate"/>
@@ -359,7 +359,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" set-if-empty="true" field="newEntity.fromDate"/>
</if-empty>
@@ -28,10 +28,10 @@ under the License.
<check-errors/>
<set field="createFixedAsset.fixedAssetTypeId" value="PROPERTY"/>
<if-not-empty field-name="parameters.productName">
<if-not-empty field="parameters.productName">
<set field="createFixedAsset.fixedAssetName" from-field="parameters.productName"/>
</if-not-empty>
<if-not-empty field-name="parameters.internalName">
<if-not-empty field="parameters.internalName">
<set field="createFixedAsset.fixedAssetName" from-field="parameters.internalName"/>
</if-not-empty>
<call-service service-name="createFixedAsset" in-map-name="createFixedAsset">
@@ -52,7 +52,7 @@ under the License.
<entity-one entity-name="Product" value-name="product"/>
<get-related relation-name="FixedAssetProduct" value-name="product" list-name="productFixedAssets"/>
<if-not-empty field-name="productFixedAssets">
<if-not-empty field="productFixedAssets">
<first-from-list list-name="productFixedAssets" entry-name="productFixedAsset"/>
<field-to-result field-name="productFixedAsset.fixedAssetId" result-name="fixedAssetId"/>
</if-not-empty>
@@ -26,7 +26,7 @@ under the License.
<make-value entity-name="FacilityContactMech" value-name="newValue"/>
<make-value entity-name="FacilityContactMech" value-name="newFacilityContactMech"/>
<log level="info" message="contactMechId is ${parameters.contactMechId}"/>
<if-empty map-name="parameters" field-name="contactMechId">
<if-empty field="parameters.contactMechId">
<set-service-fields service-name="createContactMech" map-name="parameters" to-map-name="createContactMechMap"/>
<set field="createContactMechMap.contactMechTypeId" from-field="parameters.contactMechTypeId" />
@@ -62,7 +62,7 @@ under the License.
<find-by-and entity-name="FacilityContactMech" list-name="facilityContactMechs" map-name="facilityContactMechMap"/>
<filter-list-by-date list-name="facilityContactMechs" to-list-name="validFacilityContactMechs"/>
<first-from-list entry-name="facilityContactMech" list-name="validFacilityContactMechs"/>
<if-empty field-name="facilityContactMech">
<if-empty field="facilityContactMech">
<add-error><fail-message message="ERROR: Cannot update specified contact info because it does not correspond to the specified facility"/></add-error>
</if-empty>
<check-errors/>
@@ -71,7 +71,7 @@ under the License.
<clone-value value-name="facilityContactMech" new-value-name="newFacilityContactMech"/>
<log message="parameters: ${parameters}" level="info"/>
<!-- If we already have a new contactMechId don't update ContactMech -->
<if-empty map-name="parameters" field-name="newContactMechId">
<if-empty field="parameters.newContactMechId">
<set-service-fields service-name="updateContactMech" map-name="parameters" to-map-name="updateContactMechMap"/>
<set field="updateContactMechMap.contactMechTypeId" from-field="parameters.contactMechTypeId" />
<call-service service-name="updateContactMech" in-map-name="updateContactMechMap">
@@ -93,7 +93,7 @@ under the License.
<store-value value-name="facilityContactMech"/>
<create-value value-name="newFacilityContactMech"/>
<if-compare-field field-name="contactMechId" map-name="parameters" to-map-name="newFacilityContactMech" operator="not-equals">
<if-compare-field to-field="newFacilityContactMech." field="parameters.contactMechId" operator="not-equals">
<get-related value-name="facilityContactMech" relation-name="FacilityContactMechPurpose" list-name="facilityContactMechPurposes"/>
<iterate entry-name="facilityContactMechPurposeOld" list-name="facilityContactMechPurposes">
<clone-value value-name="facilityContactMechPurposeOld" new-value-name="facilityContactMechPurpose"/>
@@ -107,7 +107,7 @@ under the License.
<set field="purposeMap.contactMechId" from-field="facilityContactMechPurpose.contactMechId"/>
<find-by-and entity-name="FacilityContactMechPurpose" list-name="purposeResult" map-name="purposeMap"/>
<if-empty field-name="purposeResult">
<if-empty field="purposeResult">
<create-value value-name="facilityContactMechPurpose"/>
</if-empty>
@@ -130,7 +130,7 @@ under the License.
<filter-list-by-date list-name="facilityContactMechs" to-list-name="validFacilityContactMechs"/>
<first-from-list entry-name="facilityContactMech" list-name="validFacilityContactMechs"/>
<if-empty field-name="facilityContactMech">
<if-empty field="facilityContactMech">
<add-error>
<fail-property resource="PartyUiLabels" property="PartyContactMechNotFoundCannotDelete"/>
</add-error>
@@ -289,7 +289,7 @@ under the License.
<find-by-and entity-name="FacilityContactMechPurpose" map-name="lookUpMap" list-name="purposeList"/>
<filter-list-by-date list-name="purposeList"/>
<if-not-empty field-name="purposeList">
<if-not-empty field="purposeList">
<add-error><fail-message message="Could not create new purpose, a purpose with that type already exists"/></add-error>
<check-errors/>
@@ -316,7 +316,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="lookUpMap"/>
<find-by-primary-key value-name="purposeEntity" entity-name="FacilityContactMechPurpose" map-name="lookUpMap"/>
<if-empty field-name="purposeEntity">
<if-empty field="purposeEntity">
<add-error><fail-message message="Unable to locate purpose; cannot delete"/></add-error>
<check-errors/>
</if-empty>
@@ -65,22 +65,22 @@ under the License.
<set field="locationSeqId" value="${parameters.areaId}${parameters.aisleId}${parameters.sectionId}${parameters.levelId}${parameters.positionId}"/>
<!-- check to see if it exists already, if so try a simple suffix, then give up and use a sequenced id -->
<if-not-empty field-name="locationSeqId">
<if-not-empty field="locationSeqId">
<set field="checkLocationSeqIdMap.locationSeqId" from-field="locationSeqId" />
<set field="checkLocationSeqIdMap.facilityId" from-field="parameters.facilityId" />
<find-by-primary-key entity-name="FacilityLocation" map-name="checkLocationSeqIdMap" value-name="checkLocationSeqIdValue"/>
<if-not-empty field-name="checkLocationSeqIdValue">
<if-not-empty field="checkLocationSeqIdValue">
<set field="locationSeqId" value="${locationSeqId}_2" />
<set field="checkLocationSeqIdMap.locationSeqId" from-field="locationSeqId" />
<set field="checkLocationSeqIdMap.facilityId" from-field="parameters.facilityId" />
<find-by-primary-key entity-name="FacilityLocation" map-name="checkLocationSeqIdMap" value-name="checkLocationSeqIdValue"/>
<if-not-empty field-name="checkLocationSeqIdValue">
<if-not-empty field="checkLocationSeqIdValue">
<set field="locationSeqId" value="" />
</if-not-empty>
</if-not-empty>
</if-not-empty>
<if-empty field-name="locationSeqId">
<if-empty field="locationSeqId">
<sequenced-id-to-env sequence-name="FacilityLocation" env-name="locationSeqId"/>
<to-string field-name="locationSeqId"/>
</if-empty>
@@ -133,7 +133,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp" />
</if-empty>
@@ -160,7 +160,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.fromDate" from-field="nowTimestamp" />
</if-empty>
@@ -24,11 +24,11 @@ under the License.
<check-permission permission="CATALOG" action="_CREATE"><fail-message message="Security Error: to run createProductStore you must have the CATALOG_CREATE or CATALOG_ADMIN permission"/></check-permission>
<check-errors/>
<if-compare field-name="parameters.showPricesWithVatTax" operator="equals" value="Y">
<if-empty field-name="parameters.vatTaxAuthGeoId" >
<if-compare field="parameters.showPricesWithVatTax" operator="equals" value="Y">
<if-empty field="parameters.vatTaxAuthGeoId">
<add-error><fail-property property="VatTaxAuthGeoNotSet" resource="CommonUiLabels"/></add-error>
</if-empty>
<if-empty field-name="parameters.vatTaxAuthPartyId" >
<if-empty field="parameters.vatTaxAuthPartyId">
<add-error><fail-property property="VatTaxAuthPartyNotSet" resource="CommonUiLabels"/></add-error>
</if-empty>
<check-errors/>
@@ -46,7 +46,7 @@ under the License.
<!-- create the ProductStoreFacility record -->
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-not-empty field-name="inventoryFacilityId" map-name="newEntity">
<if-not-empty field="newEntity.inventoryFacilityId">
<make-value value-name="storeFacility" entity-name="ProductStoreFacility"/>
<set from-field="newEntity.inventoryFacilityId" field="storeFacility.facilityId"/>
<set from-field="newEntity.productStoreId" field="storeFacility.productStoreId"/>
@@ -63,11 +63,11 @@ under the License.
<set from-field="store.inventoryFacilityId" field="oldFacilityId"/>
<set-nonpk-fields map-name="parameters" value-name="store"/>
<if-compare field-name="store.showPricesWithVatTax" operator="equals" value="Y">
<if-empty field-name="store.vatTaxAuthGeoId" >
<if-compare field="store.showPricesWithVatTax" operator="equals" value="Y">
<if-empty field="store.vatTaxAuthGeoId">
<add-error><fail-property property="VatTaxAuthGeoNotSet" resource="CommonUiLabels"/></add-error>
</if-empty>
<if-empty field-name="store.vatTaxAuthPartyId" >
<if-empty field="store.vatTaxAuthPartyId">
<add-error><fail-property property="VatTaxAuthPartyNotSet" resource="CommonUiLabels"/></add-error>
</if-empty>
<check-errors/>
@@ -77,8 +77,8 @@ under the License.
<!-- update the ProductStoreFacility record -->
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-compare-field field-name="inventoryFacilityId" map-name="store" operator="not-equals" to-field-name="oldFacilityId">
<if-compare field-name="oneInventoryFacility" map-name="store" operator="equals" value="Y">
<if-compare-field field="store.inventoryFacilityId" to-field="oldFacilityId" operator="not-equals">
<if-compare field="store.oneInventoryFacility" operator="equals" value="Y">
<!-- expire all the facilities -->
<set from-field="store.productStoreId" field="lookupPFMap.productStoreId"/>
<find-by-and entity-name="ProductStoreFacility" map-name="lookupPFMap" list-name="storeFacilities"/>
@@ -106,7 +106,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -265,7 +265,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -281,7 +281,7 @@ under the License.
<find-by-primary-key map-name="lookupPKMap" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<if-empty field-name="thruDate" map-name="lookedUpValue">
<if-empty field="lookedUpValue.thruDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="lookedUpValue.thruDate"/>
</if-empty>
@@ -297,7 +297,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -338,7 +338,7 @@ under the License.
<field-to-result field-name="productStoreSurveyId" result-name="productStoreSurveyId"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -354,7 +354,7 @@ under the License.
<find-by-primary-key map-name="lookupPKMap" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<if-empty field-name="thruDate" map-name="lookedUpValue">
<if-empty field="lookedUpValue.thruDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="lookedUpValue.thruDate"/>
</if-empty>
@@ -396,13 +396,13 @@ under the License.
<simple-method method-name="reserveStoreInventory" short-description="Reserve Store Inventory">
<entity-one entity-name="Product" value-name="product" use-cache="true"/>
<entity-one entity-name="ProductStore" value-name="productStore" use-cache="true"/>
<if-empty field-name="productStore">
<if-empty field="productStore">
<add-error><fail-message message="No ProductStore found with id ${parameters.productStoreId}, not reserving inventory."/></add-error>
<check-errors/>
</if-empty>
<!-- if prodCatalog is set to not reserve inventory, break here -->
<if-compare value="N" operator="equals" field-name="productStore.reserveInventory">
<if-compare value="N" operator="equals" field="productStore.reserveInventory">
<!-- note: if not set, defaults to yes, reserve inventory -->
<log level="verbose" message="ProductStore with id ${productStore.productStoreId}, is set to NOT reserve inventory, not reserving inventory"/>
<field-to-result field-name="parameters.quantity" result-name="quantityNotReserved"/>
@@ -411,8 +411,8 @@ under the License.
<call-simple-method method-name="isStoreInventoryRequiredInline"/>
<if-compare value="Y" field-name="productStore.oneInventoryFacility" operator="equals">
<if-empty field-name="productStore.inventoryFacilityId">
<if-compare value="Y" field="productStore.oneInventoryFacility" operator="equals">
<if-empty field="productStore.inventoryFacilityId">
<add-error><fail-message message="ProductStore with id ${productStoreId} has Y for oneInventoryFacility but inventoryFacilityId is empty, not reserving inventory."/></add-error>
<check-errors/>
</if-empty>
@@ -425,7 +425,7 @@ under the License.
<result-to-field result-name="quantityNotReserved"/>
</call-service>
<if-compare value="0" field-name="quantityNotReserved" operator="equals" type="Double">
<if-compare value="0" field="quantityNotReserved" operator="equals" type="Double">
<log level="info" message="Inventory IS reserved in facility with id [${productStore.inventoryFacilityId}] for product id [${parameters.productId}]; desired quantity was ${parameters.quantity}"/>
<else>
<log level="info" message="There is insufficient inventory available in facility with id [${productStore.inventoryFacilityId}] for product id [${parameters.productId}]; desired quantity is ${parameters.quantity}, amount could not reserve is ${quantityNotReserved}"/>
@@ -439,7 +439,7 @@ under the License.
<iterate list-name="productStoreFacilities" entry-name="productStoreFacility">
<!-- in this case quantityNotReserved will always be empty until it finds a facility it can totally reserve from, then it will be 0.0 and we are done -->
<if-empty field-name="storeFound">
<if-empty field="storeFound">
<!-- TODO: must entire quantity be available in one location? -->
<!-- Right now the answer is yes, it only succeeds if one facility has sufficient inventory for the order. -->
<set from-field="parameters.productId" field="callServiceMap.productId"/>
@@ -449,14 +449,14 @@ under the License.
</call-service>
<clear-field field-name="callServiceMap"/>
<if-compare-field field-name="availableToPromiseTotal" operator="greater-equals" to-field-name="parameters.quantity" type="Double">
<if-compare-field field="availableToPromiseTotal" to-field="parameters.quantity" operator="greater-equals" type="Double">
<set field="storeFound" from-field="productStoreFacility"/>
</if-compare-field>
<clear-field field-name="availableToPromiseTotal"/>
</if-empty>
</iterate>
<!-- didn't find anything? Take the first facility from list -->
<if-empty field-name="storeFound">
<if-empty field="storeFound">
<first-from-list list-name="productStoreFacilities" entry-name="storeFound"/>
</if-empty>
<set-service-fields map-name="parameters" to-map-name="callServiceMap" service-name="reserveProductInventoryByFacility"/>
@@ -474,13 +474,13 @@ under the License.
</simple-method>
<simple-method method-name="isStoreInventoryRequired" short-description="Is Store Inventory Required" login-required="false">
<if-empty field-name="parameters.productStore">
<if-empty field="parameters.productStore">
<entity-one entity-name="ProductStore" value-name="productStore" use-cache="true"/>
<else>
<set from-field="parameters.productStore" field="productStore"/>
</else>
</if-empty>
<if-empty field-name="parameters.product">
<if-empty field="parameters.product">
<entity-one entity-name="Product" value-name="product" use-cache="true"/>
<else>
<set from-field="parameters.product" field="product"/>
@@ -492,22 +492,22 @@ under the License.
</simple-method>
<simple-method method-name="isStoreInventoryRequiredInline" short-description="Is Store Inventory Required" login-required="false">
<set from-field="product.requireInventory" field="requireInventory"/>
<if-empty field-name="requireInventory">
<if-empty field="requireInventory">
<set from-field="productStore.requireInventory" field="requireInventory"/>
</if-empty>
<if-empty field-name="requireInventory">
<if-empty field="requireInventory">
<set value="Y" field="requireInventory"/>
</if-empty>
</simple-method>
<simple-method method-name="isStoreInventoryAvailable" short-description="Is Store Inventory Available" login-required="false">
<if-empty field-name="parameters.productStore">
<if-empty field="parameters.productStore">
<entity-one entity-name="ProductStore" value-name="productStore" use-cache="true"/>
<else>
<set from-field="parameters.productStore" field="productStore"/>
</else>
</if-empty>
<if-empty field-name="parameters.product">
<if-empty field="parameters.product">
<entity-one entity-name="Product" value-name="product" use-cache="true"/>
<else>
<set from-field="parameters.product" field="product"/>
@@ -518,8 +518,8 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="product.productTypeId" operator="equals" value="SERVICE"/>
<if-compare field-name="product.productTypeId" operator="equals" value="DIGITAL_GOOD"/>
<if-compare field="product.productTypeId" operator="equals" value="SERVICE"/>
<if-compare field="product.productTypeId" operator="equals" value="DIGITAL_GOOD"/>
</or>
</condition>
<then>
@@ -533,7 +533,7 @@ under the License.
<!-- TODO: what to do with ASSET_USAGE? Only done elsewhere? Would need date/time range info to check availability -->
<!-- if prodCatalog is set to not check inventory break here -->
<if-compare value="N" field-name="productStore.checkInventory" operator="equals">
<if-compare value="N" field="productStore.checkInventory" operator="equals">
<!-- note: if not set, defaults to yes, check inventory -->
<log level="verbose" message="ProductStore with id ${productStore.productStoreId}, is set to NOT check inventory, returning true for inventory available check"/>
<set value="Y" field="available"/>
@@ -541,8 +541,8 @@ under the License.
<return/>
</if-compare>
<if-compare value="Y" operator="equals" field-name="productStore.oneInventoryFacility">
<if-empty field-name="productStore.inventoryFacilityId">
<if-compare value="Y" operator="equals" field="productStore.oneInventoryFacility">
<if-empty field="productStore.inventoryFacilityId">
<add-error><fail-message message="ProductStore with id ${productStoreId} has Y for oneInventoryFacility but inventoryFacilityId is empty, not checking available inventory."/></add-error>
<check-errors/>
</if-empty>
@@ -552,8 +552,8 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="product.productTypeId" value="MARKETING_PKG_AUTO" operator="equals"/>
<if-compare field-name="product.productTypeId" value="MARKETING_PKG_PICK" operator="equals"/>
<if-compare field="product.productTypeId" value="MARKETING_PKG_AUTO" operator="equals"/>
<if-compare field="product.productTypeId" value="MARKETING_PKG_PICK" operator="equals"/>
</or>
</condition>
<then>
@@ -568,7 +568,7 @@ under the License.
</else>
</if>
<!-- check to see if we got enough back... -->
<if-compare-field field-name="availableToPromiseTotal" operator="greater-equals" to-field-name="parameters.quantity" type="Double">
<if-compare-field field="availableToPromiseTotal" to-field="parameters.quantity" operator="greater-equals" type="Double">
<set value="Y" field="available"/>
<log level="info" message="Inventory IS available in facility with id ${productStore.inventoryFacilityId} for product id ${parameters.productId}; desired quantity is ${parameters.quantity}, available quantity is ${availableToPromiseTotal}"/>
<else>
@@ -584,7 +584,7 @@ under the License.
<set value="N" field="available"/>
<iterate list-name="productStoreFacilities" entry-name="productStoreFacility">
<if-compare value="N" field-name="available" operator="equals">
<if-compare value="N" field="available" operator="equals">
<!-- TODO: must entire quantity be available in one location? -->
<!-- Right now the answer is yes, it only succeeds if one facility has sufficient inventory for the order. -->
<set from-field="parameters.productId" field="callServiceMap.productId"/>
@@ -592,8 +592,8 @@ under the License.
<if>
<condition>
<or>
<if-compare field-name="product.productTypeId" value="MARKETING_PKG_AUTO" operator="equals"/>
<if-compare field-name="product.productTypeId" value="MARKETING_PKG_PICK" operator="equals"/>
<if-compare field="product.productTypeId" value="MARKETING_PKG_AUTO" operator="equals"/>
<if-compare field="product.productTypeId" value="MARKETING_PKG_PICK" operator="equals"/>
</or>
</condition>
<then>
@@ -610,7 +610,7 @@ under the License.
<clear-field field-name="callServiceMap"/>
<if-compare-field field-name="availableToPromiseTotal" operator="greater-equals" to-field-name="parameters.quantity" type="Double">
<if-compare-field field="availableToPromiseTotal" to-field="parameters.quantity" operator="greater-equals" type="Double">
<set value="Y" field="available"/>
<log level="info" message="Inventory IS available in facility with id ${productStoreFacility.facilityId} for product id ${parameters.productId}; desired quantity is ${parameters.quantity}, available quantity is ${availableToPromiseTotal}"/>
</if-compare-field>
@@ -638,13 +638,13 @@ under the License.
</simple-method>
<simple-method method-name="isStoreInventoryAvailableOrNotRequired" short-description="Is Store Inventory Available or Not Required" login-required="false">
<if-empty field-name="parameters.productStore">
<if-empty field="parameters.productStore">
<entity-one entity-name="ProductStore" value-name="productStore" use-cache="true"/>
<else>
<set from-field="parameters.productStore" field="productStore"/>
</else>
</if-empty>
<if-empty field-name="parameters.product">
<if-empty field="parameters.product">
<entity-one entity-name="Product" value-name="product" use-cache="true"/>
<else>
<set from-field="parameters.product" field="product"/>
@@ -653,7 +653,7 @@ under the License.
<call-simple-method method-name="isStoreInventoryRequiredInline"/>
<if-compare field-name="requireInventory" operator="not-equals" value="Y">
<if-compare field="requireInventory" operator="not-equals" value="Y">
<set value="Y" field="availableOrNotRequired"/>
<field-to-result field-name="availableOrNotRequired"/>
<else>
@@ -25,7 +25,7 @@ under the License.
<check-permission permission="CATALOG" action="${securityAction}"><fail-property resource="ProductUiLabels" property="GeneralCatalogPermissionError"/></check-permission>
<check-errors/>
<make-value entity-name="Subscription" value-name="newEntity"/>
<if-empty field-name="parameters.subscriptionId">
<if-empty field="parameters.subscriptionId">
<sequenced-id-to-env sequence-name="Subscription" env-name="newEntity.subscriptionId"/> <!-- get the next sequenced ID -->
<else>
<set field="newEntity.subscriptionId" from-field="parameters.subscriptionId"/>
@@ -34,15 +34,15 @@ under the License.
<field-to-result field-name="newEntity.subscriptionId" result-name="subscriptionId"/>
<!-- lookup the product subscription resource (if exists) -->
<if-not-empty field-name="parameters.subscriptionResourceId">
<if-not-empty field-name="parameters.productId">
<if-not-empty field="parameters.subscriptionResourceId">
<if-not-empty field="parameters.productId">
<entity-and entity-name="ProductSubscriptionResource" list-name="resourceList" filter-by-date="true">
<field-map field-name="subscriptionResourceId" env-name="parameters.subscriptionResourceId"/>
<field-map field-name="productId" env-name="parameters.productId"/>
<order-by field-name="-fromDate"/>
</entity-and>
<first-from-list entry-name="resource" list-name="resourceList"/>
<if-not-empty field-name="resource">
<if-not-empty field="resource">
<set-nonpk-fields value-name="newEntity" map-name="resource"/>
</if-not-empty>
</if-not-empty>
@@ -66,7 +66,7 @@ under the License.
<check-errors/>
<set field="pfInput.inputFields" from-field="parameters"/>
<set field="pfInput.entityName" value="Subscription"/>
<if-empty field-name="parameters.filterByDate">
<if-empty field="parameters.filterByDate">
<set field="pfInput.filterByDate" value="Y"/>
<else>
<set field="pfInput.filterByDate" from-field="parameters.filterByDate"/>
@@ -77,7 +77,7 @@ under the License.
<result-to-field result-name="list" field-name="pfResultList"/>
</call-service>
<if-empty field-name="pfResultList">
<if-empty field="pfResultList">
<set field="found" value="false" type="Boolean"/>
<else>
<set field="found" value="true" type="Boolean"/>
@@ -95,7 +95,7 @@ under the License.
<check-errors/>
<entity-one entity-name="Subscription" value-name="subscription"/>
<field-to-result field-name="parameters.subscriptionId" result-name="subscriptionId"/>
<if-not-empty field-name="subscription">
<if-not-empty field="subscription">
<field-to-result field-name="subscription" result-name="subscription"/>
</if-not-empty>
</simple-method>
@@ -125,7 +125,7 @@ under the License.
<check-errors/>
<make-value entity-name="ProductSubscriptionResource" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<create-value value-name="newEntity"/>
</simple-method>
@@ -150,7 +150,7 @@ under the License.
<check-errors/>
<field-to-result field-name="parameters.subscriptionId" result-name="subscriptionId"/>
<entity-one entity-name="SubscriptionAttribute" value-name="lookedUpValue"/>
<if-empty field-name="lookedUpValue">
<if-empty field="lookedUpValue">
<make-value entity-name="SubscriptionAttribute" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -39,10 +39,10 @@ under the License.
<!-- if the InventoryItem issued is serialized, then change its status to DELIVERED -->
<get-related-one value-name="newEntity" relation-name="InventoryItem" to-value-name="inventoryItem"/>
<if-not-empty field-name="inventoryItem">
<if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="SERIALIZED_INV_ITEM">
<if-not-empty field="inventoryItem">
<if-compare field="inventoryItem.inventoryItemTypeId" operator="equals" value="SERIALIZED_INV_ITEM">
<get-related-one value-name="newEntity" relation-name="OrderHeader" to-value-name="orderHeader"/>
<if-not-empty field-name="orderHeader">
<if-not-empty field="orderHeader">
<set field="orderRoleAndMap.orderId" from-field="orderHeader.orderId"/>
<set field="orderRoleAndMap.roleTypeId" value="END_USER_CUSTOMER"/>
<find-by-and entity-name="OrderRole" list-name="orderRoles" map-name="orderRoleAndMap"/>
@@ -53,11 +53,11 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="orderRole"/></not>
<not><if-empty field="orderRole"/></not>
<or>
<if-empty field-name="productStore"/>
<if-empty field-name="productStore.setOwnerUponIssuance"/>
<if-compare field-name="productStore.setOwnerUponIssuance" operator="equals" value="Y"/>
<if-empty field="productStore"/>
<if-empty field="productStore.setOwnerUponIssuance"/>
<if-compare field="productStore.setOwnerUponIssuance" operator="equals" value="Y"/>
</or>
</and>
</condition>
@@ -138,7 +138,7 @@ under the License.
<entity-one entity-name="OrderHeader" value-name="orderHeader" auto-field-map="true"/>
<!-- make sure the order is NOT of orderTypeId: SALES_ORDER -->
<if-compare field-name="orderTypeId" map-name="orderHeader" operator="equals" value="SALES_ORDER">
<if-compare field="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER">
<string-to-list string="Not issuing Order Item to shipment [${parameters.shipmentId}] because the order is a Sales Order for order [${orderHeader.orderId}] order item [${parameters.orderItemSeqId}] (should call the issueOrderItemShipGrpInvResToShipment service)" list-name="error_list"/>
</if-compare>
<check-errors/>
@@ -177,24 +177,24 @@ under the License.
<find-by-primary-key map-name="orderHeaderLookupPk" value-name="orderHeader"/>
<!-- make sure the order is of orderTypeId: SALES_ORDER -->
<if-compare field-name="orderTypeId" map-name="orderHeader" operator="not-equals" value="SALES_ORDER">
<if-compare field="orderHeader.orderTypeId" operator="not-equals" value="SALES_ORDER">
<string-to-list string="Not issuing Order Item Ship Group Inventory Reservation to shipment [${parameters.shipmentId}] because the order is not a Sales Order for order [${orderItemShipGrpInvRes.orderId}] order item [${orderItemShipGrpInvRes.orderItemSeqId}] inventoryItem [${orderItemShipGrpInvRes.inventoryItemId}] (should call the issueOrderItemToShipment service)" list-name="error_list"/>
</if-compare>
<!-- make sure specified quantity is not empty -->
<if-empty field-name="parameters.quantity">
<if-empty field="parameters.quantity">
<add-error><fail-message message="Not issuing Order Item Ship Group Inventory Reservation to shipment [${parameters.shipmentId}] because the quantity to issue is empty for order [${orderItemShipGrpInvRes.orderId}] order item [${orderItemShipGrpInvRes.orderItemSeqId}] inventoryItem [${orderItemShipGrpInvRes.inventoryItemId}]"/></add-error>
</if-empty>
<if-empty field-name="orderItemShipGrpInvRes.quantity">
<if-empty field="orderItemShipGrpInvRes.quantity">
<log level="info" message="Order item reservation amount is null! PK lookup: ${OrderItemShipGrpInvResLookupPk}"/>
</if-empty>
<!-- make sure specified quantity is not less than or equal to 0 -->
<if-compare field-name="parameters.quantity" operator="less-equals" value="0" type="Double">
<if-compare field="parameters.quantity" operator="less-equals" value="0" type="Double">
<add-error><fail-message message="Not issuing Order Item Ship Group Inventory Reservation to shipment [${parameters.shipmentId}] because the quantity to issue [${parameters.quantity}] is less than or equal to 0 for order [${orderItemShipGrpInvRes.orderId}] order item [${orderItemShipGrpInvRes.orderItemSeqId}] inventoryItem [${orderItemShipGrpInvRes.inventoryItemId}]"/></add-error>
</if-compare>
<!-- make sure specified quantity is not greater than reserved quantity left to be issued, ie orderItemShipGrpInvRes.quantity -->
<if-compare-field field-name="parameters.quantity" operator="greater" to-field-name="orderItemShipGrpInvRes.quantity" type="Double">
<if-compare-field field="parameters.quantity" to-field="orderItemShipGrpInvRes.quantity" operator="greater" type="Double">
<add-error><fail-message message="Not issuing Order Item Ship Group Inventory Reservation to shipment [${parameters.shipmentId}] because the quantity to issue [${parameters.quantity}] is greater than the quantity left to issue [${orderItemShipGrpInvRes.quantity}] for order [${orderItemShipGrpInvRes.orderId}] order item [${orderItemShipGrpInvRes.orderItemSeqId}] inventoryItem [${orderItemShipGrpInvRes.inventoryItemId}]"/></add-error>
</if-compare-field>
@@ -219,9 +219,9 @@ under the License.
</calcop>
</calculate>
<if-compare value="0" operator="greater-equals" field-name="qtyForShipmentItem" type="Double">
<if-compare value="0" operator="greater-equals" field="qtyForShipmentItem" type="Double">
<!-- remove the orderShipment.quantity -->
<if-not-empty field-name="orderShipment">
<if-not-empty field="orderShipment">
<field-to-result field-name="orderShipment.shipmentItemSeqId" result-name="shipmentItemSeqId"/>
<make-value entity-name="ShipmentItem" value-name="shipmentItemLookupPk"/>
<set-pk-fields value-name="shipmentItemLookupPk" map-name="parameters"/>
@@ -229,7 +229,7 @@ under the License.
<find-by-primary-key map-name="shipmentItemLookupPk" value-name="shipmentItem"/>
<remove-value value-name="orderShipment"/>
</if-not-empty>
<if-compare value="0" operator="not-equals" field-name="qtyForShipmentItem" type="Double">
<if-compare value="0" operator="not-equals" field="qtyForShipmentItem" type="Double">
<!-- add the qtyForShipmentItem to the shipmentItem -->
<set from-field="paremeters.quantity" field="originalQuantity"/>
<set from-field="qtyForShipmentItem" field="paremeters.quantity"/>
@@ -263,12 +263,12 @@ under the License.
<calcop operator="get" field-name="parameters.quantity"/>
</calcop>
</calculate>
<if-compare value="0" operator="equals" field-name="orderItemShipGrpInvRes.quantity" type="Double">
<if-compare value="0" operator="equals" field="orderItemShipGrpInvRes.quantity" type="Double">
<!-- if none left reserved, remove OIIR -->
<remove-value value-name="orderItemShipGrpInvRes"/>
<!-- if there are no more OIIRs for the orderItem, set the orderItem.statusId to ITEM_COMPLETED -->
<get-related value-name="orderItem" relation-name="OrderItemShipGrpInvRes" list-name="otherOiirs"/>
<if-empty field-name="otherOiirs">
<if-empty field="otherOiirs">
<set value="ITEM_COMPLETED" field="changeOrderItemStatusMap.statusId"/>
<set from-field="orderItem.orderId" field="changeOrderItemStatusMap.orderId"/>
<set from-field="orderItem.orderItemSeqId" field="changeOrderItemStatusMap.orderItemSeqId"/>
@@ -299,7 +299,7 @@ under the License.
<simple-method method-name="findCreateIssueShipmentItem" short-description="Find or Create ShipmentItem to Issue To - meant to be called in-line">
<!-- try to find an existing shipmentItem and attach to it, if none found create a new shipmentItem -->
<!-- if there is NO productId on the orderItem, ALWAYS create a new shipmentItem -->
<if-not-empty field-name="productId" map-name="orderItem">
<if-not-empty field="orderItem.productId">
<entity-condition entity-name="ShipmentItem" list-name="shipmentItems">
<condition-list combine="and">
<condition-expr field-name="productId" env-name="orderItem.productId"/>
@@ -311,7 +311,7 @@ under the License.
<first-from-list entry-name="shipmentItem" list-name="shipmentItems"/>
</if-not-empty>
<if-empty field-name="shipmentItem">
<if-empty field="shipmentItem">
<set from-field="orderItem.productId" field="shipmentItemCreate.productId"/>
<set from-field="parameters.shipmentId" field="shipmentItemCreate.shipmentId"/>
<set from-field="parameters.quantity" field="shipmentItemCreate.quantity"/>
@@ -339,12 +339,12 @@ under the License.
<set from-field="orderItem.orderId" field="itemIssuanceCreate.orderId"/>
<set from-field="orderItem.orderItemSeqId" field="itemIssuanceCreate.orderItemSeqId"/>
<if-not-empty field-name="orderItemShipGrpInvRes">
<if-not-empty field="orderItemShipGrpInvRes">
<!-- if this is coming from an OrderItem issue instead of an OrderItemShipGrpInvRes issue, we won't have this info -->
<set from-field="orderItemShipGrpInvRes.inventoryItemId" field="itemIssuanceCreate.inventoryItemId"/>
<set from-field="orderItemShipGrpInvRes.shipGroupSeqId" field="itemIssuanceCreate.shipGroupSeqId"/>
</if-not-empty>
<if-not-empty field-name="orderItemShipGroupAssoc">
<if-not-empty field="orderItemShipGroupAssoc">
<!-- If we have a ShipGroup Assoc for this Item to focus on, set that; this is mostly the case for purchase orders and such -->
<set from-field="orderItemShipGroupAssoc.shipGroupSeqId" field="itemIssuanceCreate.shipGroupSeqId"/>
</if-not-empty>
@@ -361,7 +361,7 @@ under the License.
<set field="partyRole.partyId" from-field="userLogin.partyId"/>
<set field="partyRole.roleTypeId" value="PACKER"/>
<find-by-primary-key entity-name="PartyRole" map-name="partyRole" value-name="checkPartyRole"/>
<if-empty field-name="checkPartyRole">
<if-empty field="checkPartyRole">
<create-value value-name="partyRole"/>
</if-empty>
@@ -377,11 +377,11 @@ under the License.
<entity-one entity-name="FixedAssetMaint" value-name="fixedAssetMaint"/>
<!-- make sure specified quantity is not less than or equal to 0 -->
<if-compare field-name="parameters.quantity" operator="less-equals" value="0" type="Double">
<if-compare field="parameters.quantity" operator="less-equals" value="0" type="Double">
<add-error><fail-message message="Not issuing InventoryItem to FixedAssetMaint [${fixedAssetMaint.fixedAssetId:fixedAssetMaint.maintHistSeqId}] because the quantity to issue [${parameters.quantity}] is less than or equal to 0 for inventoryItem [${inventoryItem.inventoryItemId}]"/></add-error>
</if-compare>
<!-- make sure specified quantity is not greater than available quantity left to be issued, ie intentoryItem.availableToPromiseTotal -->
<if-compare-field field-name="parameters.quantity" operator="greater" to-field-name="inventoryItem.availableToPromiseTotal" type="Double">
<if-compare-field field="parameters.quantity" to-field="inventoryItem.availableToPromiseTotal" operator="greater" type="Double">
<add-error><fail-message message="Not issuing InventoryItem to FixedAssetMaint [${fixedAssetMaint.fixedAssetId:fixedAssetMaint.maintHistSeqId}] because the quantity to issue [${parameters.quantity}] is greater than the quantity left to issue (ie the ATP or Available To Promise) [${intentoryItem.availableToPromiseTotal}] for inventoryItem [${orderItemShipGrpInvRes.inventoryItemId}]"/></add-error>
</if-compare-field>
@@ -452,7 +452,7 @@ under the License.
<check-errors/>
<!-- make sure the order is of orderTypeId: SALES_ORDER -->
<if-compare field-name="orderTypeId" map-name="orderHeader" operator="not-equals" value="SALES_ORDER">
<if-compare field="orderHeader.orderTypeId" operator="not-equals" value="SALES_ORDER">
<add-error><fail-message message="Not canceling ItemIssuance because the order is not a Sales Order"/></add-error>
</if-compare>
@@ -465,17 +465,17 @@ under the License.
<!-- if not provided, get the left issued quantity -->
<set from-field="parameters.cancelQuantity" field="toCancelQuantity"/>
<if-empty field-name="toCancelQuantity">
<if-empty field="toCancelQuantity">
<set from-field="qtyIssuedLeft" field="toCancelQuantity"/>
</if-empty>
<!-- make sure specified cancel Quantity is not less than or equal to 0 -->
<if-compare field-name="toCancelQuantity" operator="less-equals" value="0" type="Double">
<if-compare field="toCancelQuantity" operator="less-equals" value="0" type="Double">
<add-error><fail-message message="Not cancelling ItemIssuance [${parameters.itemIssuanceId}] because the quantity to cancel [${toCancelQuantity}] is less than or equal to 0 "/></add-error>
</if-compare>
<!-- make sure specified quantity is not greater than issued quantity left -->
<if-compare-field field-name="toCancelQuantity" operator="greater" to-field-name="qtyIssuedLeft" type="Double">
<if-compare-field field="toCancelQuantity" to-field="qtyIssuedLeft" operator="greater" type="Double">
<add-error><fail-message message="Not cancelling ItemIssuance because the quantity to cancel [${toCancelQuantity}] is greater than the quantity left [${qtyIssuedLeft}] for ItemIssuance [${parameters.itemIssuanceId}]"/></add-error>
</if-compare-field>
<check-errors/>
@@ -506,7 +506,7 @@ under the License.
<entity-one entity-name="ProductStore" value-name="productStore" auto-field-map="false">
<field-map field-name="productStoreId" env-name="orderHeader.productStoreId"/>
</entity-one>
<if-compare value="Y" operator="equals" field-name="productStore.isImmediatelyFulfilled">
<if-compare value="Y" operator="equals" field="productStore.isImmediatelyFulfilled">
<log level="verbose" message="ProductStore with id ${productStore.productStoreId}, is immediatly fulfilled. Not reserving inventory"/>
<else>
<set field="reserveStoreInventoryMap.productId" from-field="inventoryItem.productId"/>
@@ -65,7 +65,7 @@ under the License.
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-empty field-name="orderHeaderList" map-name="parameters">
<if-empty field="parameters.orderHeaderList">
<log level="info" message="No order header list found in parameters; finding orders to pick."/>
<entity-condition entity-name="OrderHeader" list-name="orderHeaderList">
@@ -101,13 +101,13 @@ under the License.
<and>
<!-- only pick if it is the right shipmentMethodTypeId, if one was passed in -->
<or>
<if-empty field-name="parameters.shipmentMethodTypeId"/>
<if-compare-field field-name="parameters.shipmentMethodTypeId" operator="equals" to-field-name="orderItemShipGroup.shipmentMethodTypeId"/>
<if-empty field="parameters.shipmentMethodTypeId"/>
<if-compare-field field="parameters.shipmentMethodTypeId" to-field="orderItemShipGroup.shipmentMethodTypeId" operator="equals"/>
</or>
<!-- only pick if now is after the shipAfterDate or the shipAfterDate is empty -->
<or>
<if-empty field-name="orderItemShipGroup.shipAfterDate"/>
<if-compare-field field-name="nowTimestamp" operator="greater-equals" to-field-name="orderItemShipGroup.shipAfterDate"/>
<if-empty field="orderItemShipGroup.shipAfterDate"/>
<if-compare-field field="nowTimestamp" to-field="orderItemShipGroup.shipAfterDate" operator="greater-equals"/>
</or>
</and>
</condition>
@@ -130,11 +130,11 @@ under the License.
<set value="N" field="hasStockToPick"/>
<iterate entry-name="orderItemShipGrpInvRes" list-name="orderItemShipGrpInvResList">
<get-related-one value-name="orderItemShipGrpInvRes" relation-name="OrderItem" to-value-name="orderItem"/>
<if-compare field-name="orderItem.statusId" value="ITEM_APPROVED" operator="not-equals">
<if-compare field="orderItem.statusId" value="ITEM_APPROVED" operator="not-equals">
<set value="N" field="pickThisOrder"/>
</if-compare>
<if-compare field-name="pickThisOrder" operator="equals" value="Y">
<if-compare field="pickThisOrder" operator="equals" value="Y">
<get-related-one value-name="orderItemShipGrpInvRes" relation-name="InventoryItem" to-value-name="inventoryItem"/>
<!-- Look for other picklists which might include this order item ship group inventory reservation. If it is on another picklist, then
we should not include it again. We screen out picklists which are either cancelled or already picked or packed, so that we can re-pick items if
@@ -154,7 +154,7 @@ under the License.
</entity-condition>
<log level="info" message="Pick list ITEMS - ${picklistItemList}"/>
<!-- if all picklistItemList are not empty, don't include order as a pick candidate; keep a flag to see -->
<if-empty field-name="picklistItemList">
<if-empty field="picklistItemList">
<log level="info" message="The pick list item list is empty!"/>
<!-- note that this is separate because we can't really use it as a break condition, must check all of them before any useful information is to be had -->
<set value="N" field="allPickStarted"/>
@@ -164,12 +164,12 @@ under the License.
<or>
<!-- check all OISGIRs and if quantityNotAvailable is not empty and > 0 for any, don't pick order -->
<and>
<if-compare field-name="maySplit" map-name="orderItemShipGroup" operator="equals" value="N"/>
<not><if-empty field-name="orderItemShipGrpInvRes.quantityNotAvailable"/></not>
<if-compare field-name="orderItemShipGrpInvRes.quantityNotAvailable" operator="greater" value="0" type="Double"/>
<if-compare field="orderItemShipGroup.maySplit" operator="equals" value="N"/>
<not><if-empty field="orderItemShipGrpInvRes.quantityNotAvailable"/></not>
<if-compare field="orderItemShipGrpInvRes.quantityNotAvailable" operator="greater" value="0" type="Double"/>
</and>
<!-- make sure the inventoryItem is in the specified facility -->
<if-compare-field field-name="parameters.facilityId" operator="not-equals" to-field-name="inventoryItem.facilityId"/>
<if-compare-field field="parameters.facilityId" to-field="inventoryItem.facilityId" operator="not-equals"/>
</or>
</condition>
<then>
@@ -181,11 +181,11 @@ under the License.
<if>
<condition>
<or>
<if-empty field-name="orderItemShipGrpInvRes.quantityNotAvailable"/>
<if-compare field-name="orderItemShipGrpInvRes.quantityNotAvailable" operator="equals" value="0" type="Double"/>
<if-empty field="orderItemShipGrpInvRes.quantityNotAvailable"/>
<if-compare field="orderItemShipGrpInvRes.quantityNotAvailable" operator="equals" value="0" type="Double"/>
<and>
<if-compare-field field-name="orderItemShipGrpInvRes.quantity" operator="greater" to-field-name="orderItemShipGrpInvRes.quantityNotAvailable" type="Double"/>
<if-compare field-name="orderItemShipGroup.maySplit" operator="equals" value="Y"/>
<if-compare-field field="orderItemShipGrpInvRes.quantity" to-field="orderItemShipGrpInvRes.quantityNotAvailable" operator="greater" type="Double"/>
<if-compare field="orderItemShipGroup.maySplit" operator="equals" value="Y"/>
</and>
</or>
</condition>
@@ -200,8 +200,8 @@ under the License.
<!-- check InventoryItem->FacilityLocation (if exists), if it is of type FLT_BULK set needs stock move to true -->
<get-related-one value-name="inventoryItem" relation-name="FacilityLocation" to-value-name="facilityLocation"/>
<if-not-empty field-name="facilityLocation">
<if-compare field-name="facilityLocation.locationTypeEnumId" operator="equals" value="FLT_BULK">
<if-not-empty field="facilityLocation">
<if-compare field="facilityLocation.locationTypeEnumId" operator="equals" value="FLT_BULK">
<set value="Y" field="needsStockMove"/>
</if-compare>
</if-not-empty>
@@ -219,15 +219,15 @@ under the License.
</iterate>
<!-- another check to see if we should pick this order -->
<if-compare field-name="hasStockToPick" operator="equals" value="N">
<if-compare field="hasStockToPick" operator="equals" value="N">
<set value="N" field="pickThisOrder"/>
</if-compare>
<if>
<condition>
<and>
<not><if-empty field-name="parameters.maxNumberOfOrders"/></not>
<if-compare-field field-name="numberSoFar" type="Long" operator="greater-equals" to-field-name="maxNumberOfOrders"/>
<not><if-empty field="parameters.maxNumberOfOrders"/></not>
<if-compare-field field="numberSoFar" type="Long" to-field="maxNumberOfOrders" operator="greater-equals"/>
</and>
</condition>
<then>
@@ -242,8 +242,8 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="pickThisOrder" operator="equals" value="Y"/>
<if-compare field-name="allPickStarted" operator="equals" value="N"/>
<if-compare field="pickThisOrder" operator="equals" value="Y"/>
<if-compare field="allPickStarted" operator="equals" value="N"/>
</and>
</condition>
<then>
@@ -257,17 +257,17 @@ under the License.
<!-- pick now, or needs stock move first? -->
<!-- put in pick or move lists for the given shipmentMethodTypeId -->
<set from-field="orderItemShipGroup.shipmentMethodTypeId" field="shipmentMethodTypeId"/>
<if-empty field-name="pickMoveByShipmentMethodInfoMap.${shipmentMethodTypeId}">
<if-empty field="pickMoveByShipmentMethodInfoMap.${shipmentMethodTypeId}">
<get-related-one value-name="orderItemShipGroup" relation-name="ShipmentMethodType" to-value-name="pickMoveByShipmentMethodInfoMap.${shipmentMethodTypeId}.shipmentMethodType"/>
</if-empty>
<if-compare field-name="needsStockMove" operator="equals" value="Y">
<if-compare field="needsStockMove" operator="equals" value="Y">
<field-to-list field-name="orderHeaderInfo" list-name="pickMoveByShipmentMethodInfoMap.${shipmentMethodTypeId}.orderNeedsStockMoveInfoList"/>
<if-compare field-name="orderHeader.isRushOrder" operator="equals" value="Y">
<if-compare field="orderHeader.isRushOrder" operator="equals" value="Y">
<field-to-list field-name="orderHeaderInfo" list-name="rushOrderInfo.orderNeedsStockMoveInfoList"/>
</if-compare>
<else>
<field-to-list field-name="orderHeaderInfo" list-name="pickMoveByShipmentMethodInfoMap.${shipmentMethodTypeId}.orderReadyToPickInfoList"/>
<if-compare field-name="orderHeader.isRushOrder" operator="equals" value="Y">
<if-compare field="orderHeader.isRushOrder" operator="equals" value="Y">
<field-to-list field-name="orderHeaderInfo" list-name="rushOrderInfo.orderReadyToPickInfoList"/>
</if-compare>
</else>
@@ -303,7 +303,7 @@ under the License.
</entity-condition>
<iterate entry-name="shipmentMethodType" list-name="shipmentMethodTypeList">
<if-not-empty field-name="pickMoveByShipmentMethodInfoMap.${shipmentMethodType.shipmentMethodTypeId}">
<if-not-empty field="pickMoveByShipmentMethodInfoMap.${shipmentMethodType.shipmentMethodTypeId}">
<field-to-list field-name="pickMoveByShipmentMethodInfoMap.${shipmentMethodType.shipmentMethodTypeId}" list-name="pickMoveByShipmentMethodInfoList"/>
</if-not-empty>
</iterate>
@@ -323,8 +323,8 @@ under the License.
<if>
<condition>
<or>
<if-empty field-name="parameters.maxNumberOfOrders"/>
<if-compare-field field-name="numberSoFar" operator="less" to-field-name="parameters.maxNumberOfOrders"></if-compare-field>
<if-empty field="parameters.maxNumberOfOrders"/>
<if-compare-field field="numberSoFar" to-field="parameters.maxNumberOfOrders" operator="less"></if-compare-field>
</or>
</condition>
<then>
@@ -341,7 +341,7 @@ under the License.
<iterate entry-name="pickMoveByShipmentMethodInfo" list-name="pickMoveByShipmentMethodInfoList">
<iterate entry-name="orderReadyToPickInfo" list-name="pickMoveByShipmentMethodInfo.orderReadyToPickInfoList">
<iterate entry-name="orderItemAndShipGroupAssoc" list-name="orderReadyToPickInfo.orderItemAndShipGroupAssocList">
<if-compare value="ITEM_APPROVED" operator="equals" field-name="orderItemAndShipGroupAssoc.statusId">
<if-compare value="ITEM_APPROVED" operator="equals" field="orderItemAndShipGroupAssoc.statusId">
<calculate field-name="reservedQuantity" type="Double"><number value="0"/></calculate>
<set from-field="orderItemAndShipGroupAssoc.orderItemSeqId" field="itemFilterMap.orderItemSeqId"/>
@@ -350,19 +350,19 @@ under the License.
<set from-field="orderItemShipGrpInvRes.inventoryItemId" field="inventoryItemId"/>
<!-- update reserved quantity per inventoryItem, keep track of orderItems this came from -->
<set from-field="inventoryItems.${inventoryItemId}" field="inventoryItem"/>
<if-empty field-name="inventoryItem">
<if-empty field="inventoryItem">
<entity-one entity-name="InventoryItem" value-name="inventoryItem"></entity-one>
<set field="inventoryItems.${inventoryItemId}" from-field="inventoryItem"/>
</if-empty>
<if-compare-field field-name="inventoryItem.facilityId" operator="equals" to-field-name="parameters.facilityId">
<if-compare-field field="inventoryItem.facilityId" to-field="parameters.facilityId" operator="equals">
<set field="perItemResListValid[]" from-field="orderItemShipGrpInvRes"/>
<set field="inventoryItemOrderItemList" from-field="inventoryItemOrderItems.${inventoryItemId}"/>
<set field="inventoryItemOrderItemList[]" from-field="orderItemAndShipGroupAssoc"/>
<set field="inventoryItemOrderItems.${orderItemShipGrpInvRes.inventoryItemId}" from-field="inventoryItemOrderItemList"/>
<clear-field field-name="inventoryItemOrderItemList"/>
<if-not-empty field-name="inventoryItemQuantities.${inventoryItemId}">
<if-not-empty field="inventoryItemQuantities.${inventoryItemId}">
<calculate field-name="inventoryItemQuantities.${inventoryItemId}" type="Double">
<calcop field-name="inventoryItemQuantities.${inventoryItemId}" operator="add">
<calcop field-name="orderItemShipGrpInvRes.quantity" operator="get"/>
@@ -382,7 +382,7 @@ under the License.
</calculate>
</iterate>
<if-not-empty field-name="perItemResListValid">
<if-not-empty field="perItemResListValid">
<clear-field field-name="orderItemInfo"/>
<set field="orderItemInfo.orderItemAndShipGroupAssoc" from-field="orderItemAndShipGroupAssoc"/>
<set field="orderItemInfo.orderItemShipGrpInvResList" from-field="perItemResListValid"/>
@@ -408,7 +408,7 @@ under the License.
<calcop operator="get" field-name="issuedQuantity"/>
</calcop>
</calculate>
<if-compare-field field-name="reservedIssuedQuantity" operator="not-equals" to-field-name="orderItemAndShipGroupAssoc.quantity" type="Double">
<if-compare-field field="reservedIssuedQuantity" to-field="orderItemAndShipGroupAssoc.quantity" operator="not-equals" type="Double">
<set field="wrongQuantityReserved.orderItemAndShipGroupAssoc" from-field="orderItemAndShipGroupAssoc"/>
<set field="wrongQuantityReserved.reservedQuantity" from-field="reservedQuantity"/>
<set field="wrongQuantityReserved.issuedQuantity" from-field="issuedQuantity"/>
@@ -420,7 +420,7 @@ under the License.
</iterate>
<!-- keep the order info for easy handling of order pack info -->
<if-not-empty field-name="orderItemInfoList">
<if-not-empty field="orderItemInfoList">
<set field="orderHeaderInfo.orderHeader" from-field="orderReadyToPickInfo.orderHeader"/>
<set field="orderHeaderInfo.orderItemShipGroup" from-field="orderReadyToPickInfo.orderItemShipGroup"/>
<set field="orderHeaderInfo.orderItemInfoList" from-field="orderItemInfoList"/>
@@ -439,17 +439,17 @@ under the License.
<if>
<condition>
<and>
<if-compare value="1" operator="less-equals" field-name="quantityNeeded" type="Double"/>
<if-compare value="1" operator="less-equals" field="quantityNeeded" type="Double"/>
<or>
<and>
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field-name="inventoryItem.inventoryItemTypeId"/>
<if-compare value="1" operator="less" field-name="quantityNeeded" type="Double"/>
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId"/>
<if-compare value="1" operator="less" field="quantityNeeded" type="Double"/>
</and>
<and>
<if-compare value="NON_SERIAL_INV_ITEM" operator="equals" field-name="inventoryItem.inventoryItemTypeId"/>
<if-compare value="NON_SERIAL_INV_ITEM" operator="equals" field="inventoryItem.inventoryItemTypeId"/>
<or>
<if-empty field-name="inventoryItem.quantityOnHandTotal"/>
<if-compare-field field-name="quantityNeeded" operator="greater" to-field-name="inventoryItem.quantityOnHandTotal" type="Double"/>
<if-empty field="inventoryItem.quantityOnHandTotal"/>
<if-compare-field field="quantityNeeded" to-field="inventoryItem.quantityOnHandTotal" operator="greater" type="Double"/>
</or>
</and>
</or>
@@ -487,7 +487,7 @@ under the License.
<!-- <log level="info" message="orderHeaderInfoList=${orderHeaderInfoList}"/> -->
<!-- if the orderHeaderInfoList is not empty, create a Picklist, then populate it -->
<if-not-empty field-name="orderHeaderInfoList">
<if-not-empty field="orderHeaderInfoList">
<set from-field="parameters.facilityId" field="createPicklistMap.facilityId"/>
<set from-field="parameters.shipmentMethodTypeId" field="createPicklistMap.shipmentMethodTypeId"/>
<call-service service-name="createPicklist" in-map-name="createPicklistMap">
@@ -522,8 +522,8 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="orderItemShipGrpInvRes.quantityNotAvailable"/></not>
<if-compare field-name="orderItemShipGrpInvRes.quantityNotAvailable" value="0" operator="greater"/>
<not><if-empty field="orderItemShipGrpInvRes.quantityNotAvailable"/></not>
<if-compare field="orderItemShipGrpInvRes.quantityNotAvailable" value="0" operator="greater"/>
</and>
</condition>
<then>
@@ -538,7 +538,7 @@ under the License.
</if>
<log level="info" message="Order #${orderItemShipGrpInvRes.orderId} / ${orderItemShipGrpInvRes.orderItemSeqId} - ${quantityToPick}"/>
<if-compare field-name="quantityToPick" value="0" operator="greater" type="Double">
<if-compare field="quantityToPick" value="0" operator="greater" type="Double">
<clear-field field-name="createPicklistItemMap"/>
<set from-field="picklistBinId" field="createPicklistItemMap.picklistBinId"/>
<set field="createPicklistItemMap.itemStatusId" value="PICKITEM_PENDING"/>
@@ -555,7 +555,7 @@ under the License.
</iterate>
<!-- if we put nothing into this bin, delete the bin -->
<if-compare field-name="itemsInBin" value="0" operator="equals">
<if-compare field="itemsInBin" value="0" operator="equals">
<entity-one entity-name="PicklistBin" value-name="binToRemove">
<field-map field-name="picklistBinId" env-name="picklistBinId"/>
</entity-one>
@@ -584,7 +584,7 @@ under the License.
<sequenced-id-to-env sequence-name="Picklist" env-name="newEntity.picklistId"/>
<field-to-result field-name="newEntity.picklistId" result-name="picklistId"/>
<if-empty field-name="newEntity.statusId">
<if-empty field="newEntity.statusId">
<set value="PICKLIST_INPUT" field="newEntity.statusId"/>
</if-empty>
@@ -606,14 +606,14 @@ under the License.
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-not-empty field-name="parameters.statusId">
<if-compare-field field-name="parameters.statusId" operator="not-equals" to-field-name="lookedUpValue.statusId">
<if-not-empty field="parameters.statusId">
<if-compare-field field="parameters.statusId" to-field="lookedUpValue.statusId" operator="not-equals">
<!-- make sure a StatusValidChange record exists, if not return error -->
<entity-one entity-name="StatusValidChange" value-name="checkStatusValidChange" auto-field-map="false">
<field-map env-name="lookedUpValue.statusId" field-name="statusId"/>
<field-map env-name="parameters.statusId" field-name="statusIdTo"/>
</entity-one>
<if-empty field-name="checkStatusValidChange">
<if-empty field="checkStatusValidChange">
<set value="ERROR: Changing the status from ${lookedUpValue.statusId} to ${parameters.statusId} is not allowed." field="error_list[]"/>
</if-empty>
@@ -712,14 +712,14 @@ under the License.
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key map-name="lookupPKMap" value-name="lookedUpValue"/>
<if-not-empty field-name="parameters.itemStatusId">
<if-compare-field field-name="parameters.itemStatusId" operator="not-equals" to-field-name="lookedUpValue.itemStatusId">
<if-not-empty field="parameters.itemStatusId">
<if-compare-field field="parameters.itemStatusId" to-field="lookedUpValue.itemStatusId" operator="not-equals">
<!-- make sure a StatusValidChange record exists, if not return error -->
<entity-one entity-name="StatusValidChange" value-name="checkStatusValidChange" auto-field-map="false">
<field-map env-name="lookedUpValue.itemStatusId" field-name="statusId"/>
<field-map env-name="parameters.itemStatusId" field-name="statusIdTo"/>
</entity-one>
<if-empty field-name="checkStatusValidChange">
<if-empty field="checkStatusValidChange">
<set value="ERROR: Changing the status from ${lookedUpValue.itemStatusId} to ${parameters.itemStatusId} is not allowed." field="error_list[]"/>
</if-empty>
</if-compare-field>
@@ -769,7 +769,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="newEntity.fromDate"/>
</if-empty>
@@ -857,7 +857,7 @@ under the License.
AND
A Map with a List of PicklistItemInfo records keyed by the productId
-->
<if-not-empty field-name="picklistItemInfo.inventoryItemAndLocation.locationSeqId">
<if-not-empty field="picklistItemInfo.inventoryItemAndLocation.locationSeqId">
<make-value value-name="facilityLocation" entity-name="FacilityLocation" map-name="picklistItemInfo.inventoryItemAndLocation"/>
<set from-field="facilityLocation" field="facilityLocationByLocationSeqIdMap.${facilityLocation.locationSeqId}"/>
@@ -867,7 +867,7 @@ under the License.
<set field="picklistItemInfoListByLocationSeqIdMap.${facilityLocation.locationSeqId}" from-field="picklistItemInfoTempList"/>
<else>
<!-- handle case where an InventoryItem is not associated with a location -->
<if-not-empty field-name="picklistItemInfo.orderItem.productId">
<if-not-empty field="picklistItemInfo.orderItem.productId">
<clear-field field-name="productValueTemp"/>
<set field="productId" from-field="picklistItemInfo.inventoryItemAndLocation.productId"/>
<entity-one entity-name="Product" value-name="productValueTemp" use-cache="true">
@@ -934,10 +934,10 @@ under the License.
</calculate>
<!-- also put the product record in place -->
<if-empty field-name="facilityLocationInfo.product">
<if-empty field="facilityLocationInfo.product">
<set from-field="picklistItemInfo.product" field="facilityLocationInfo.product"/>
<else>
<if-compare-field field-name="facilityLocationInfo.product.productId" operator="not-equals" to-field-name="picklistItemInfo.product.productId">
<if-compare-field field="facilityLocationInfo.product.productId" to-field="picklistItemInfo.product.productId" operator="not-equals">
<!-- Uh oh, have different products in the same location... what to do about this? -->
<log level="error" message="When creating picklist report found in the same location [${facilityLocation.locationSeqId}] two different products: ${facilityLocationInfo.product.productId} and ${picklistItemInfo.product.productId}"/>
<string-append string=" WARNING: products with different IDs are sharing the same bin location, you must check products and quantities required against orders : ${facilityLocationInfo.product.productId} and ${picklistItemInfo.product.productId}" field-name="facilityLocationInfo.message"/>
@@ -1140,7 +1140,7 @@ under the License.
<!-- create a list of locations, then sort it, will have to create a reverse Map to go from location to inventory item -->
<clear-field field-name="facilityLocation"/>
<get-related-one value-name="inventoryItem" relation-name="FacilityLocation" to-value-name="facilityLocation"/>
<if-not-empty field-name="facilityLocation">
<if-not-empty field="facilityLocation">
<set from-field="facilityLocation" field="facilityLocationMap.${facilityLocation.locationSeqId}"/>
<!-- support multiple invnetoryItemIds per facilityLocation.locationSeqId -->
<clear-field field-name="inventoryItemIdList"/>
@@ -1252,11 +1252,11 @@ under the License.
<!-- determine if all the items are completed and/or cancelled -->
<iterate entry-name="item" list-name="picklistItem">
<log level="info" message="checking status for item: ${item}"/>
<if-compare field-name="item.itemStatusId" value="PICKITEM_CANCELLED" operator="not-equals">
<if-compare field="item.itemStatusId" value="PICKITEM_CANCELLED" operator="not-equals">
<log level="info" message="item is not cancelled; all cancelled set to false"/>
<set field="allCancelled" type="Boolean" value="false"/>
<if-compare field-name="item.itemStatusId" value="PICKITEM_COMPLETED" operator="not-equals">
<if-compare field="item.itemStatusId" value="PICKITEM_COMPLETED" operator="not-equals">
<log level="info" message="item is not completed; all completed set to false"/>
<set field="allCompleteOrCancelled" type="Boolean" value="false"/>
</if-compare>
@@ -1264,13 +1264,13 @@ under the License.
</iterate>
<!-- update the picklist status -->
<if-compare field-name="allCancelled" value="true" type="Boolean" operator="equals">
<if-compare field="allCancelled" value="true" type="Boolean" operator="equals">
<log level="info" message="Setting picklist #${picklist.picklistId} to cancelled"/>
<set field="picklist.statusId" value="PICKLIST_CANCELLED"/>
<store-value value-name="picklist"/>
<else>
<log level="info" message="Not all items were cancelled; now check if we can complete the picklist : ${allCompleteOrCancelled}"/>
<if-compare field-name="allCompleteOrCancelled" value="true" type="Boolean" operator="equals">
<if-compare field="allCompleteOrCancelled" value="true" type="Boolean" operator="equals">
<log level="info" message="Setting picklist #${picklist.picklistId} to completed"/>
<set field="picklist.statusId" value="PICKLIST_PICKED"/>
<store-value value-name="picklist"/>
@@ -32,7 +32,7 @@ under the License.
<set field="newEntity.receiptId" from-field="receiptId"/>
<field-to-result field-name="receiptId" result-name="receiptId"/>
<if-empty field-name="datetimeReceived" map-name="newEntity">
<if-empty field="newEntity.datetimeReceived">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set field="newEntity.datetimeReceived" from-field="nowTimestamp"/>
</if-empty>
@@ -40,7 +40,7 @@ under the License.
<set field="newEntity.receivedByUserLoginId" from-field="userLogin.userLoginId"/>
<create-value value-name="newEntity"/>
<if-not-empty field-name="inventoryItemDetailSeqId" map-name="parameters">
<if-not-empty field="parameters.inventoryItemDetailSeqId">
<entity-one entity-name="InventoryItemDetail" value-name="invDet">
<field-map field-name="inventoryItemDetailSeqId" env-name="parameters.inventoryItemDetailSeqId"/>
<field-map field-name="inventoryItemId" env-name="parameters.inventoryItemId"/>
@@ -81,16 +81,16 @@ under the License.
- DEJ20070822: something to consider for the future: maybe instead of this funny looping maybe for serialized items we should only allow a quantity of 1, ie return an error if it is not 1
-->
<set field="loops" value="1" type="Double"/>
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field-name="parameters.inventoryItemTypeId">
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="parameters.inventoryItemTypeId">
<!-- if we are serialized and either a serialNumber or inventoyItemId is passed in and the quantityAccepted is greater than 1 then complain -->
<if>
<condition>
<and>
<or>
<not><if-empty field-name="parameters.serialNumber"/></not>
<not><if-empty field-name="parameters.currentInventoryItemId"/></not>
<not><if-empty field="parameters.serialNumber"/></not>
<not><if-empty field="parameters.currentInventoryItemId"/></not>
</or>
<if-compare field-name="parameters.quantityAccepted" operator="greater" value="1" type="Double"/>
<if-compare field="parameters.quantityAccepted" operator="greater" value="1" type="Double"/>
</and>
</condition>
<then>
@@ -115,14 +115,14 @@ under the License.
<clear-field field-name="serviceInMap"/>
<clear-field field-name="currentInventoryItemId"/>
<if-empty field-name="parameters.currentInventoryItemId">
<if-empty field="parameters.currentInventoryItemId">
<set-service-fields service-name="createInventoryItem" map-name="parameters" to-map-name="serviceInMap"/>
<call-service service-name="createInventoryItem" in-map-name="serviceInMap">
<result-to-field result-name="inventoryItemId" field-name="currentInventoryItemId"/>
</call-service>
<else>
<if-not-empty field-name="parameters.currentInventoryItemId">
<if-not-empty field="parameters.currentInventoryItemId">
<set field="parameters.inventoryItemId" from-field="parameters.currentInventoryItemId"/>
</if-not-empty>
<set-service-fields service-name="updateInventoryItem" map-name="parameters" to-map-name="serviceInMap"/>
@@ -132,7 +132,7 @@ under the License.
</if-empty>
<!-- do this only for non-serialized inventory -->
<if-compare value="SERIALIZED_INV_ITEM" operator="not-equals" field-name="parameters.inventoryItemTypeId">
<if-compare value="SERIALIZED_INV_ITEM" operator="not-equals" field="parameters.inventoryItemTypeId">
<clear-field field-name="serviceInMap"/>
<set-service-fields service-name="createInventoryItemDetail" map-name="parameters" to-map-name="serviceInMap"/>
<set field="serviceInMap.inventoryItemId" from-field="currentInventoryItemId"/>
@@ -150,8 +150,8 @@ under the License.
<if>
<condition>
<and>
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field-name="parameters.inventoryItemTypeId"/>
<if-empty field-name="parameters.returnId"/>
<if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="parameters.inventoryItemTypeId"/>
<if-empty field="parameters.returnId"/>
</and>
</condition>
<then>
@@ -162,8 +162,8 @@ under the License.
<if>
<condition>
<and>
<if-compare value="INV_PROMISED" operator="not-equals" field-name="inventoryItem.statusId"/>
<if-compare value="INV_ON_HOLD" operator="not-equals" field-name="inventoryItem.statusId"/>
<if-compare value="INV_PROMISED" operator="not-equals" field="inventoryItem.statusId"/>
<if-compare value="INV_ON_HOLD" operator="not-equals" field="inventoryItem.statusId"/>
</and>
</condition>
<then>
@@ -195,13 +195,13 @@ under the License.
<field-map field-name="returnId" env-name="parameters.returnId"/>
</entity-one>
<if-compare field-name="needsInventoryReceive" map-name="returnHeader" operator="equals" value="Y">
<if-compare field="returnHeader.needsInventoryReceive" operator="equals" value="Y">
<!-- before receiving inventory, check to see if there is inventory information in this database -->
<entity-count entity-name="InventoryItem" count-name="iiCount">
<condition-expr field-name="facilityId" operator="equals" env-name="returnHeader.destinationFacilityId"/>
</entity-count>
<if-compare field-name="iiCount" operator="greater" value="0" type="Double">
<if-compare field="iiCount" operator="greater" value="0" type="Double">
<!-- create a return shipment for this return -->
<set field="shipmentCtx.returnId" from-field="parameters.returnId"/>
<call-service service-name="createShipmentForReturn" in-map-name="shipmentCtx">
@@ -214,7 +214,7 @@ under the License.
</entity-condition>
<!-- if no inventory item type specified, get default from facility -->
<if-empty field-name="inventoryItemTypeId" map-name="parameters">
<if-empty field="parameters.inventoryItemTypeId">
<get-related-one value-name="returnHeader" relation-name="Facility" to-value-name="facility"/>
<set from-field="facility.defaultInventoryItemTypeId" field="parameters.inventoryItemTypeId"/>
</if-empty>
@@ -240,11 +240,11 @@ under the License.
<iterate entry-name="returnItem" list-name="returnItems">
<clear-field field-name="receiveCtx"/>
<if-empty field-name="expectedItemStatus" map-name="returnItem">
<if-empty field="returnItem.expectedItemStatus">
<set value="INV_RETURNED" field="returnItem.expectedItemStatus" type="String"/>
</if-empty>
<get-related-one value-name="returnItem" relation-name="OrderItem" to-value-name="orderItem"/>
<if-not-empty field-name="productId" map-name="orderItem">
<if-not-empty field="orderItem.productId">
<set field="costCtx.returnItemSeqId" from-field="returnItem.returnItemSeqId"/>
<set field="costCtx.returnId" from-field="returnItem.returnId"/>
<call-service service-name="getReturnItemInitialCost" in-map-name="costCtx">
@@ -260,13 +260,13 @@ under the License.
</entity-count>
<get-related-one value-name="returnHeader" relation-name="Facility" to-value-name="destinationFacility"/>
<set field="setNonSerial" value="false"/>
<if-compare field-name="destinationFacility.defaultInventoryItemTypeId" value="NON_SERIAL_INV_ITEM" operator="equals">
<if-compare field-name="serializedItemCount" value="0" operator="equals">
<if-compare field="destinationFacility.defaultInventoryItemTypeId" value="NON_SERIAL_INV_ITEM" operator="equals">
<if-compare field="serializedItemCount" value="0" operator="equals">
<set field="parameters.inventoryItemTypeId" value="NON_SERIAL_INV_ITEM"/>
<set field="setNonSerial" value="true"/>
</if-compare>
</if-compare>
<if-compare field-name="setNonSerial" value="false" operator="equals">
<if-compare field="setNonSerial" value="false" operator="equals">
<set field="parameters.inventoryItemTypeId" value="SERIALIZED_INV_ITEM"/>
<set field="returnItem.returnQuantity" value="1" type="Double"/>
</if-compare>
@@ -302,7 +302,7 @@ under the License.
<store-value value-name="returnHeader"/>
<!-- check if we need to manually update the status -->
<if-compare-field field-name="nonProductItems" operator="equals" to-field-name="returnItemCount" type="Long">
<if-compare-field field="nonProductItems" to-field="returnItemCount" operator="equals" type="Long">
<set field="retStCtx.returnId" from-field="returnHeader.returnId"/>
<set field="retStCtx.statusId" value="RETURN_RECEIVED"/>
<call-service service-name="updateReturnHeader" in-map-name="retStCtx"/>
@@ -57,7 +57,7 @@ under the License.
<call-service service-name="createWorkEffort" in-map-name="shipWorkEffortMap">
<result-to-field result-name="workEffortId" field-name="newEntity.estimatedShipWorkEffId"/>
</call-service>
<if-not-empty field-name="partyIdFrom" map-name="newEntity">
<if-not-empty field="newEntity.partyIdFrom">
<set from-field="newEntity.estimatedShipWorkEffId" field="assignPartyToWorkEffortShip.workEffortId"/>
<set from-field="newEntity.partyIdFrom" field="assignPartyToWorkEffortShip.partyId"/>
<set value="CAL_ATTENDEE" field="assignPartyToWorkEffortShip.roleTypeId"/>
@@ -77,7 +77,7 @@ under the License.
<call-service service-name="createWorkEffort" in-map-name="arrivalWorkEffortMap">
<result-to-field result-name="workEffortId" field-name="newEntity.estimatedArrivalWorkEffId"/>
</call-service>
<if-not-empty field-name="partyIdTo" map-name="newEntity">
<if-not-empty field="newEntity.partyIdTo">
<set from-field="newEntity.estimatedArrivalWorkEffId" field="assignPartyToWorkEffortArrival.workEffortId"/>
<set from-field="newEntity.partyIdTo" field="assignPartyToWorkEffortArrival.partyId"/>
<set value="CAL_ATTENDEE" field="assignPartyToWorkEffortArrival.roleTypeId"/>
@@ -89,7 +89,7 @@ under the License.
<create-value value-name="newEntity"/>
<!-- get the ShipmentStatus history started -->
<if-not-empty field-name="statusId" map-name="newEntity">
<if-not-empty field="newEntity.statusId">
<make-value entity-name="ShipmentStatus" value-name="newStatusValue"/>
<set from-field="newEntity.statusId" field="newStatusValue.statusId"/>
<set from-field="newEntity.shipmentId" field="newStatusValue.shipmentId"/>
@@ -111,14 +111,14 @@ under the License.
<!-- put the type in return map so that service consumer knows what type of shipment was updated -->
<field-to-result field-name="lookedUpValue.shipmentTypeId" result-name="shipmentTypeId"/>
<if-not-empty field-name="parameters.statusId">
<if-compare-field field-name="parameters.statusId" operator="not-equals" to-field-name="lookedUpValue.statusId">
<if-not-empty field="parameters.statusId">
<if-compare-field field="parameters.statusId" to-field="lookedUpValue.statusId" operator="not-equals">
<!-- make sure a StatusValidChange record exists, if not return error -->
<entity-one entity-name="StatusValidChange" value-name="checkStatusValidChange" auto-field-map="false">
<field-map env-name="lookedUpValue.statusId" field-name="statusId"/>
<field-map env-name="parameters.statusId" field-name="statusIdTo"/>
</entity-one>
<if-empty field-name="checkStatusValidChange">
<if-empty field="checkStatusValidChange">
<string-to-list string="ERROR: Changing the status from ${lookedUpValue.statusId} to ${parameters.statusId} is not allowed." list-name="error_list"/>
</if-empty>
@@ -139,12 +139,12 @@ under the License.
<condition>
<or>
<and>
<not><if-empty field-name="parameters.estimatedShipDate"/></not>
<if-compare-field field-name="parameters.estimatedShipDate" operator="not-equals" to-field-name="lookedUpValue.estimatedShipDate"/>
<not><if-empty field="parameters.estimatedShipDate"/></not>
<if-compare-field field="parameters.estimatedShipDate" to-field="lookedUpValue.estimatedShipDate" operator="not-equals"/>
</and>
<and>
<not><if-empty field-name="originFacilityId" map-name="parameters"/></not>
<if-compare-field field-name="parameters.originFacilityId" operator="not-equals" to-field-name="lookedUpValue.originFacilityId"/>
<not><if-empty field="parameters.originFacilityId"/></not>
<if-compare-field field="parameters.originFacilityId" to-field="lookedUpValue.originFacilityId" operator="not-equals"/>
</and>
</or>
</condition>
@@ -163,12 +163,12 @@ under the License.
<condition>
<or>
<and>
<not><if-empty field-name="estimatedArrivalDate" map-name="parameters"/></not>
<if-compare-field field-name="parameters.estimatedArrivalDate" operator="not-equals" to-field-name="lookedUpValue.estimatedArrivalDate"/>
<not><if-empty field="parameters.estimatedArrivalDate"/></not>
<if-compare-field field="parameters.estimatedArrivalDate" to-field="lookedUpValue.estimatedArrivalDate" operator="not-equals"/>
</and>
<and>
<not><if-empty field-name="destinationFacilityId" map-name="parameters"/></not>
<if-compare-field field-name="parameters.destinationFacilityId" operator="not-equals" to-field-name="lookedUpValue.destinationFacilityId"/>
<not><if-empty field="parameters.destinationFacilityId"/></not>
<if-compare-field field="parameters.destinationFacilityId" to-field="lookedUpValue.destinationFacilityId" operator="not-equals"/>
</and>
</or>
</condition>
@@ -188,9 +188,9 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="parameters.partyIdFrom"/></not>
<if-compare-field field-name="parameters.partyIdFrom" operator="not-equals" to-field-name="lookedUpValue.partyIdFrom"/>
<not><if-empty field-name="lookedUpValue.estimatedShipWorkEffId"/></not>
<not><if-empty field="parameters.partyIdFrom"/></not>
<if-compare-field field="parameters.partyIdFrom" to-field="lookedUpValue.partyIdFrom" operator="not-equals"/>
<not><if-empty field="lookedUpValue.estimatedShipWorkEffId"/></not>
</and>
</condition>
<then>
@@ -198,7 +198,7 @@ under the License.
<set field="assignPartyToWorkEffortShip.partyId" from-field="parameters.partyIdFrom"/>
<find-by-and entity-name="WorkEffortPartyAssignment" list-name="existingShipWepas" map-name="assignPartyToWorkEffortShip"/>
<filter-list-by-date list-name="existingShipWepas"/>
<if-empty field-name="existingShipWepas">
<if-empty field="existingShipWepas">
<set field="assignPartyToWorkEffortShip.roleTypeId" value="CAL_ATTENDEE"/>
<set field="assignPartyToWorkEffortShip.statusId" value="CAL_SENT"/>
<call-service service-name="assignPartyToWorkEffort" in-map-name="assignPartyToWorkEffortShip"/>
@@ -208,9 +208,9 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="parameters.partyIdTo"/></not>
<if-compare-field field-name="parameters.partyIdTo" operator="not-equals" to-field-name="lookedUpValue.partyIdTo"/>
<not><if-empty field-name="lookedUpValue.estimatedArrivalWorkEffId"/></not>
<not><if-empty field="parameters.partyIdTo"/></not>
<if-compare-field field="parameters.partyIdTo" to-field="lookedUpValue.partyIdTo" operator="not-equals"/>
<not><if-empty field="lookedUpValue.estimatedArrivalWorkEffId"/></not>
</and>
</condition>
<then>
@@ -218,7 +218,7 @@ under the License.
<set field="assignPartyToWorkEffortArrival.partyId" from-field="parameters.partyIdTo"/>
<find-by-and entity-name="WorkEffortPartyAssignment" list-name="existingArrivalWepas" map-name="assignPartyToWorkEffortArrival"/>
<filter-list-by-date list-name="existingArrivalWepas"/>
<if-empty field-name="existingArrivalWepas">
<if-empty field="existingArrivalWepas">
<set field="assignPartyToWorkEffortArrival.roleTypeId" value="CAL_ATTENDEE"/>
<set field="assignPartyToWorkEffortArrival.statusId" value="CAL_SENT"/>
<call-service service-name="assignPartyToWorkEffort" in-map-name="assignPartyToWorkEffortArrival"/>
@@ -262,7 +262,7 @@ under the License.
<set from-field="returnHeader.destinationFacilityId" field="shipmentCtx.destinationFacilityId"/>
<!-- later different behavior for customer vs. returns would happen here -->
<if-compare value="CUSTOMER_RETURN" field-name="returnHeader.returnHeaderTypeId" operator="equals">
<if-compare value="CUSTOMER_RETURN" field="returnHeader.returnHeaderTypeId" operator="equals">
<set value="SALES_RETURN" field="shipmentCtx.shipmentTypeId"/>
<set value="PURCH_SHIP_CREATED" field="shipmentCtx.statusId"/> <!-- we may later need different status codes for return shipments -->
<else>
@@ -293,14 +293,14 @@ under the License.
<!-- on Shipment set partyIdFrom, partyIdTo (vendorPartyId), originContactMechId, destinationContactMechId, estimatedShipCost -->
<entity-one entity-name="Shipment" value-name="shipment"/>
<if-empty field-name="shipment.primaryOrderId">
<if-empty field="shipment.primaryOrderId">
<!-- No primaryOrderId specified, don't do anything -->
<log level="info" message="Not running setShipmentSettingsFromPrimaryOrder, primaryOrderId is empty for shipmentId [${shipment.shipmentId}]"/>
<return response-code="success"/>
</if-empty>
<!-- TODO: we may not want to check this if, for example, Purchase Orders don't have any OrderItemShipGroups -->
<if-empty field-name="shipment.primaryShipGroupSeqId">
<if-empty field="shipment.primaryShipGroupSeqId">
<!-- No primaryShipGroupSeqId specified, don't do anything -->
<log level="info" message="Not running setShipmentSettingsFromPrimaryOrder, primaryShipGroupSeqId is empty for shipmentId [${parameters.shipmentId}]"/>
<return response-code="success"/>
@@ -309,18 +309,18 @@ under the License.
<entity-one entity-name="OrderHeader" value-name="orderHeader" auto-field-map="false">
<field-map field-name="orderId" env-name="shipment.primaryOrderId"/>
</entity-one>
<if-not-empty field-name="shipment.primaryShipGroupSeqId">
<if-not-empty field="shipment.primaryShipGroupSeqId">
<entity-one entity-name="OrderItemShipGroup" value-name="orderItemShipGroup" auto-field-map="false">
<field-map field-name="orderId" env-name="shipment.primaryOrderId"/>
<field-map field-name="shipGroupSeqId" env-name="shipment.primaryShipGroupSeqId"/>
</entity-one>
</if-not-empty>
<if-compare field-name="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER">
<if-compare field="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER">
<set value="SALES_SHIPMENT" field="shipment.shipmentTypeId"/>
</if-compare>
<if-compare field-name="orderHeader.orderTypeId" operator="equals" value="PURCHASE_ORDER">
<if-compare field-name="shipment.shipmentTypeId" operator="not-equals" value="DROP_SHIPMENT">
<if-compare field="orderHeader.orderTypeId" operator="equals" value="PURCHASE_ORDER">
<if-compare field="shipment.shipmentTypeId" operator="not-equals" value="DROP_SHIPMENT">
<set value="PURCHASE_SHIPMENT" field="shipment.shipmentTypeId"/>
</if-compare>
</if-compare>
@@ -329,16 +329,16 @@ under the License.
<if>
<condition>
<and>
<if-empty field-name="shipment.originFacilityId"/>
<if-compare field-name="shipment.shipmentTypeId" operator="equals" value="SALES_SHIPMENT"/>
<not><if-empty field-name="orderHeader.productStoreId"/></not>
<if-empty field="shipment.originFacilityId"/>
<if-compare field="shipment.shipmentTypeId" operator="equals" value="SALES_SHIPMENT"/>
<not><if-empty field="orderHeader.productStoreId"/></not>
</and>
</condition>
<then>
<entity-one entity-name="ProductStore" value-name="productStore" auto-field-map="false">
<field-map field-name="productStoreId" env-name="orderHeader.productStoreId"/>
</entity-one>
<if-compare field-name="productStore.oneInventoryFacility" operator="equals" value="Y">
<if-compare field="productStore.oneInventoryFacility" operator="equals" value="Y">
<set from-field="productStore.inventoryFacilityId" field="shipment.originFacilityId"/>
</if-compare>
</then>
@@ -351,42 +351,42 @@ under the License.
</entity-and>
<!-- From: SHIP_FROM_VENDOR -->
<if-empty field-name="partyIdFrom" map-name="shipment">
<if-empty field="shipment.partyIdFrom">
<set value="SHIP_FROM_VENDOR" field="limitRoleMap.roleTypeId"/>
<filter-list-by-and list-name="orderRoles" map-name="limitRoleMap" to-list-name="limitOrderRoles"/>
<first-from-list entry-name="limitOrderRole" list-name="limitOrderRoles"/>
<if-not-empty field-name="limitOrderRole">
<if-not-empty field="limitOrderRole">
<set from-field="limitOrderRole.partyId" field="shipment.partyIdFrom"/>
</if-not-empty>
<clear-field field-name="limitRoleMap"/><clear-field field-name="limitOrderRoles"/><clear-field field-name="limitOrderRole"/>
</if-empty>
<!-- From: VENDOR -->
<if-empty field-name="partyIdFrom" map-name="shipment">
<if-empty field="shipment.partyIdFrom">
<set value="VENDOR" field="limitRoleMap.roleTypeId"/>
<filter-list-by-and list-name="orderRoles" map-name="limitRoleMap" to-list-name="limitOrderRoles"/>
<first-from-list entry-name="limitOrderRole" list-name="limitOrderRoles"/>
<if-not-empty field-name="limitOrderRole">
<if-not-empty field="limitOrderRole">
<set from-field="limitOrderRole.partyId" field="shipment.partyIdFrom"/>
</if-not-empty>
<clear-field field-name="limitRoleMap"/><clear-field field-name="limitOrderRoles"/><clear-field field-name="limitOrderRole"/>
</if-empty>
<!-- To: SHIP_TO_CUSTOMER -->
<if-empty field-name="partyIdTo" map-name="shipment">
<if-empty field="shipment.partyIdTo">
<set value="SHIP_TO_CUSTOMER" field="limitRoleMap.roleTypeId"/>
<filter-list-by-and list-name="orderRoles" map-name="limitRoleMap" to-list-name="limitOrderRoles"/>
<first-from-list entry-name="limitOrderRole" list-name="limitOrderRoles"/>
<if-not-empty field-name="limitOrderRole">
<if-not-empty field="limitOrderRole">
<set from-field="limitOrderRole.partyId" field="shipment.partyIdTo"/>
</if-not-empty>
<clear-field field-name="limitRoleMap"/><clear-field field-name="limitOrderRoles"/><clear-field field-name="limitOrderRole"/>
</if-empty>
<!-- To: CUSTOMER -->
<if-empty field-name="partyIdTo" map-name="shipment">
<if-empty field="shipment.partyIdTo">
<set value="CUSTOMER" field="limitRoleMap.roleTypeId"/>
<filter-list-by-and list-name="orderRoles" map-name="limitRoleMap" to-list-name="limitOrderRoles"/>
<first-from-list entry-name="limitOrderRole" list-name="limitOrderRoles"/>
<if-not-empty field-name="limitOrderRole">
<if-not-empty field="limitOrderRole">
<set from-field="limitOrderRole.partyId" field="shipment.partyIdTo"/>
</if-not-empty>
<clear-field field-name="limitRoleMap"/><clear-field field-name="limitOrderRoles"/><clear-field field-name="limitOrderRole"/>
@@ -396,12 +396,12 @@ under the License.
<field-map field-name="orderId" env-name="shipment.primaryOrderId"/>
</entity-and>
<!-- destinationContactMechId -->
<if-empty field-name="shipment.destinationContactMechId">
<if-empty field="shipment.destinationContactMechId">
<!-- first try from orderContactMechs -->
<set value="SHIPPING_LOCATION" field="destinationContactMap.contactMechPurposeTypeId"/>
<filter-list-by-and list-name="orderContactMechs" map-name="destinationContactMap" to-list-name="destinationOrderContactMechs"/>
<first-from-list entry-name="destinationOrderContactMech" list-name="destinationOrderContactMechs"/>
<if-not-empty field-name="destinationOrderContactMech">
<if-not-empty field="destinationOrderContactMech">
<set from-field="destinationOrderContactMech.contactMechId" field="shipment.destinationContactMechId"/>
<else>
<log level="warning" message="Cannot find a shipping destination address for ${shipment.primaryOrderId}"/>
@@ -409,12 +409,12 @@ under the License.
</if-not-empty>
</if-empty>
<!-- originContactMechId. Only do this if it is not a purchase shipment -->
<if-compare field-name="shipmentTypeId" map-name="shipment" operator="not-equals" value="PURCHASE_SHIPMENT">
<if-empty field-name="shipment.originContactMechId">
<if-compare field="shipment.shipmentTypeId" operator="not-equals" value="PURCHASE_SHIPMENT">
<if-empty field="shipment.originContactMechId">
<set value="SHIP_ORIG_LOCATION" field="originContactMap.contactMechPurposeTypeId"/>
<filter-list-by-and list-name="orderContactMechs" map-name="originContactMap" to-list-name="originOrderContactMechs"/>
<first-from-list entry-name="originOrderContactMech" list-name="originOrderContactMechs"/>
<if-not-empty field-name="originOrderContactMech">
<if-not-empty field="originOrderContactMech">
<set from-field="originOrderContactMech.contactMechId" field="shipment.originContactMechId"/>
<else>
<log level="warning" message="Cannot find a shipping origin address for ${shipment.primaryOrderId}"/>
@@ -424,11 +424,11 @@ under the License.
</if-compare>
<!-- destinationTelecomNumberId -->
<if-empty field-name="shipment.destinationTelecomNumberId">
<if-empty field="shipment.destinationTelecomNumberId">
<set value="PHONE_SHIPPING" field="destTelecomOrderContactMechMap.contactMechPurposeTypeId"/>
<filter-list-by-and list-name="orderContactMechs" map-name="destTelecomOrderContactMechMap" to-list-name="destTelecomOrderContactMechs"/>
<first-from-list entry-name="destTelecomOrderContactMech" list-name="destTelecomOrderContactMechs"/>
<if-not-empty field-name="destTelecomOrderContactMech">
<if-not-empty field="destTelecomOrderContactMech">
<set from-field="destTelecomOrderContactMech.contactMechId" field="shipment.destinationTelecomNumberId"/>
<else>
<!-- use the first unexpired phone number of the shipment partyIdTo -->
@@ -437,7 +437,7 @@ under the License.
</entity-and>
<filter-list-by-date list-name="phoneNumbers"/>
<first-from-list entry-name="phoneNumber" list-name="phoneNumbers"/>
<if-not-empty field-name="phoneNumber">
<if-not-empty field="phoneNumber">
<set from-field="phoneNumber.contactMechId" field="shipment.destinationTelecomNumberId"/>
<else>
<log level="warning" message="Cannot find a shipping destination phone number for ${shipment.primaryOrderId}"/>
@@ -447,11 +447,11 @@ under the License.
</if-not-empty>
</if-empty>
<!-- originTelecomNumberId -->
<if-empty field-name="shipment.originTelecomNumberId">
<if-empty field="shipment.originTelecomNumberId">
<set value="PHONE_SHIP_ORIG" field="originTelecomOrderContactMechMap.contactMechPurposeTypeId"/>
<filter-list-by-and list-name="orderContactMechs" map-name="originTelecomOrderContactMechMap" to-list-name="originTelecomOrderContactMechs"/>
<first-from-list entry-name="originTelecomOrderContactMech" list-name="originTelecomOrderContactMechs"/>
<if-not-empty field-name="originTelecomOrderContactMech">
<if-not-empty field="originTelecomOrderContactMech">
<set from-field="originTelecomOrderContactMech.contactMechId" field="shipment.originTelecomNumberId"/>
<else>
<log level="warning" message="Cannot find a shipping origin phone number for ${shipment.primaryOrderId}"/>
@@ -460,8 +460,8 @@ under the License.
</if-empty>
<!-- set the destination facility if it is a purchase order -->
<if-empty field-name="originFacilityId" map-name="shipment">
<if-compare field-name="shipmentTypeId" map-name="shipment" operator="equals" value="PURCHASE_SHIPMENT">
<if-empty field="shipment.originFacilityId">
<if-compare field="shipment.shipmentTypeId" operator="equals" value="PURCHASE_SHIPMENT">
<set from-field="shipment.destinationContactMechId" field="facilityLookup.contactMechId"/>
<find-by-and entity-name="FacilityContactMech" map-name="facilityLookup" list-name="facilities"/>
<first-from-list list-name="facilities" entry-name="destinationFacility"/>
@@ -472,18 +472,18 @@ under the License.
<!-- NOTE: use new place to find source/destination location/addresses for new OrderItemShipGroup.contactMechId (destination address for sales orders, source address for purchase orders) -->
<!-- do this second so it will override the orderContactMech -->
<!-- TODO: maybe we should add a new entity for OrderItemShipGroup ContactMechs? -->
<if-not-empty field-name="orderItemShipGroup">
<if-compare field-name="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER">
<if-empty field-name="shipment.destinationContactMechId">
<if-not-empty field="orderItemShipGroup">
<if-compare field="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER">
<if-empty field="shipment.destinationContactMechId">
<set from-field="orderItemShipGroup.contactMechId" field="shipment.destinationContactMechId"/>
</if-empty>
<if-empty field-name="shipment.destinationTelecomNumberId">
<if-empty field="shipment.destinationTelecomNumberId">
<set from-field="orderItemShipGroup.telecomContactMechId" field="shipment.destinationTelecomNumberId"/>
</if-empty>
</if-compare>
</if-not-empty>
<if-empty field-name="estimatedShipCost" map-name="shipment">
<if-empty field="shipment.estimatedShipCost">
<call-bsh><![CDATA[
import java.math.BigDecimal;
import org.ofbiz.order.order.OrderReadHelper;
@@ -505,7 +505,7 @@ under the License.
and from OrderItemShipGroup shipmentMethodTypeId, carrierPartyId, etc -->
<set from-field="shipment.shipmentId" field="shipmentRouteSegmentMap.shipmentId"/>
<find-by-and entity-name="ShipmentRouteSegment" map-name="shipmentRouteSegmentMap" list-name="shipmentRouteSegments"/>
<if-empty field-name="shipmentRouteSegments">
<if-empty field="shipmentRouteSegments">
<!-- estimatedShipDate, estimatedArrivalDate -->
<set from-field="shipment.estimatedShipDate" field="shipmentRouteSegmentMap.estimatedStartDate"/>
<set from-field="shipment.estimatedArrivalDate" field="shipmentRouteSegmentMap.estimatedArrivalDate"/>
@@ -521,7 +521,7 @@ under the License.
<field-map field-name="orderId" env-name="shipment.primaryOrderId"/>
<field-map field-name="shipGroupSeqId" env-name="shipment.primaryShipGroupSeqId"/>
</entity-one>
<if-not-empty field-name="orderItemShipGroup">
<if-not-empty field="orderItemShipGroup">
<set from-field="orderItemShipGroup.carrierPartyId" field="shipmentRouteSegmentMap.carrierPartyId"/>
<set from-field="orderItemShipGroup.shipmentMethodTypeId" field="shipmentRouteSegmentMap.shipmentMethodTypeId"/>
</if-not-empty>
@@ -548,8 +548,8 @@ under the License.
<clone-value value-name="shipment" new-value-name="shipmentCopy"/>
<string-to-list string="-fromDate" list-name="descendingFromDateOrder"/>
<if-not-empty field-name="shipment.originFacilityId">
<if-empty field-name="shipment.originContactMechId">
<if-not-empty field="shipment.originFacilityId">
<if-empty field="shipment.originContactMechId">
<set from-field="shipment.originFacilityId" field="findFcmpMap.facilityId"/>
<set value="SHIP_ORIG_LOCATION" field="findFcmpMap.contactMechPurposeTypeId"/>
<find-by-and entity-name="FacilityContactMechPurpose" map-name="findFcmpMap" order-by-list-name="descendingFromDateOrder" list-name="facilityContactMechPurposes"/>
@@ -557,7 +557,7 @@ under the License.
<first-from-list entry-name="facilityContactMechPurpose" list-name="facilityContactMechPurposes"/>
<set from-field="facilityContactMechPurpose.contactMechId" field="shipment.originContactMechId"/>
</if-empty>
<if-empty field-name="shipment.originTelecomNumberId">
<if-empty field="shipment.originTelecomNumberId">
<set from-field="shipment.originFacilityId" field="findFcmpMap.facilityId"/>
<set value="PHONE_SHIP_ORIG" field="findFcmpMap.contactMechPurposeTypeId"/>
<find-by-and entity-name="FacilityContactMechPurpose" map-name="findFcmpMap" order-by-list-name="descendingFromDateOrder" list-name="facilityContactMechPurposes"/>
@@ -566,8 +566,8 @@ under the License.
<set from-field="facilityContactMechPurpose.contactMechId" field="shipment.originTelecomNumberId"/>
</if-empty>
</if-not-empty>
<if-not-empty field-name="shipment.destinationFacilityId">
<if-empty field-name="shipment.destinationContactMechId">
<if-not-empty field="shipment.destinationFacilityId">
<if-empty field="shipment.destinationContactMechId">
<set from-field="shipment.destinationFacilityId" field="findFcmpMap.facilityId"/>
<set value="SHIPPING_LOCATION" field="findFcmpMap.contactMechPurposeTypeId"/>
<find-by-and entity-name="FacilityContactMechPurpose" map-name="findFcmpMap" order-by-list-name="descendingFromDateOrder" list-name="facilityContactMechPurposes"/>
@@ -575,21 +575,21 @@ under the License.
<first-from-list entry-name="facilityContactMechPurpose" list-name="facilityContactMechPurposes"/>
<set from-field="facilityContactMechPurpose.contactMechId" field="shipment.destinationContactMechId"/>
</if-empty>
<if-empty field-name="shipment.destinationTelecomNumberId">
<if-empty field="shipment.destinationTelecomNumberId">
<set from-field="shipment.destinationFacilityId" field="findFcmpMap.facilityId"/>
<set value="PHONE_SHIPPING" field="findFcmpMap.contactMechPurposeTypeId"/>
<find-by-and entity-name="FacilityContactMechPurpose" map-name="findFcmpMap" order-by-list-name="descendingFromDateOrder" list-name="facilityContactMechPurposes"/>
<filter-list-by-date list-name="facilityContactMechPurposes"/>
<!-- This check is necessary or some random contactMechId might be filled in by minilang, possibly from another call earlier, if facilityContactMechPurpoess is indeed null.
It should probably be implemented for all of the above but I have not had a chance to test it. (Si) -->
<if-not-empty field-name="facilityContactMechPurposes">
<if-not-empty field="facilityContactMechPurposes">
<first-from-list entry-name="facilityContactMechPurpose" list-name="facilityContactMechPurposes"/>
<set from-field="facilityContactMechPurpose.contactMechId" field="shipment.destinationTelecomNumberId"/>
</if-not-empty>
</if-empty>
</if-not-empty>
<if-compare-field field-name="shipment" operator="not-equals" to-field-name="shipmentCopy">
<if-compare-field field="shipment" to-field="shipmentCopy" operator="not-equals">
<set-service-fields service-name="updateShipment" map-name="shipment" to-map-name="shipmentUpdateMap"/>
<call-service service-name="updateShipment" in-map-name="shipmentUpdateMap"/>
</if-compare-field>
@@ -640,7 +640,7 @@ under the License.
<!-- set subject, contentType, templateName, templateData -->
<set value="Scheduled Notification for Shipment ${shipment.shipmentId}" field="sendEmailMap.subject"/>
<if-not-empty field-name="shipment.primaryOrderId">
<if-not-empty field="shipment.primaryOrderId">
<string-append string=" for Primary Order ${shipment.primaryOrderId}" field-name="sendEmailMap.subject"/>
</if-not-empty>
<set value="text/html" field="sendEmailMap.contentType"/>
@@ -652,8 +652,8 @@ under the License.
<if>
<condition>
<and>
<not><if-empty field-name="sendTo" map-name="sendEmailMap"/></not>
<not><if-empty field-name="sendFrom" map-name="sendEmailMap"/></not>
<not><if-empty field="sendEmailMap.sendTo"/></not>
<not><if-empty field="sendEmailMap.sendFrom"/></not>
</and>
</condition>
<then>
@@ -770,8 +770,8 @@ under the License.
<set field="orderShipmentQuantityLeft" from-field="parameters.newItemQuantity"/>
<iterate entry-name="itemOrderShipment" list-name="itemOrderShipmentList">
<if-compare field-name="orderShipmentQuantityLeft" operator="greater" value="0" type="Double">
<if-compare-field field-name="itemOrderShipment.quantity" operator="greater" to-field-name="orderShipmentQuantityLeft" type="Double">
<if-compare field="orderShipmentQuantityLeft" operator="greater" value="0" type="Double">
<if-compare-field field="itemOrderShipment.quantity" to-field="orderShipmentQuantityLeft" operator="greater" type="Double">
<!-- there is enough in this OrderShipment record, so just adjust it and move on -->
<clear-field field-name="updateOrderShipmentMap"/>
<set-service-fields service-name="updateOrderShipment" map-name="itemOrderShipment" to-map-name="updateOrderShipmentMap"/>
@@ -832,7 +832,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-compare value="New" operator="equals" field-name="shipmentPackageSeqId" map-name="newEntity">
<if-compare value="New" operator="equals" field="newEntity.shipmentPackageSeqId">
<clear-field field-name="shipmentPackageSeqId" map-name="newEntity"/>
</if-compare>
@@ -889,7 +889,7 @@ under the License.
<field-map field-name="shipmentRouteSegmentId" env-name="shipmentRouteSegment.shipmentRouteSegmentId"/>
</entity-one>
<if-empty field-name="checkShipmentPackageRouteSeg">
<if-empty field="checkShipmentPackageRouteSeg">
<set field="checkShipmentPackageRouteSegMap.shipmentRouteSegmentId" from-field="shipmentRouteSegment.shipmentRouteSegmentId"/>
<set field="checkShipmentPackageRouteSegMap.shipmentPackageSeqId" from-field="shipmentPackageSeqId"/>
<set field="checkShipmentPackageRouteSegMap.shipmentId" from-field="shipmentId"/>
@@ -953,7 +953,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<find-by-primary-key value-name="shipmentPackageContent" map-name="newEntity"/>
<log level="verbose" message="In addShipmentContentToPackage trying values: ${newEntity}"/>
<if-empty field-name="shipmentPackageContent">
<if-empty field="shipmentPackageContent">
<set-service-fields service-name="createShipmentPackageContent" map-name="parameters" to-map-name="createSPCMap"/>
<call-service service-name="createShipmentPackageContent" in-map-name="createSPCMap">
<result-to-field result-name="shipmentPackageSeqId" field-name="newEntity.shipmentPackageSeqId"/>
@@ -1066,7 +1066,7 @@ under the License.
<make-next-seq-id value-name="newEntity" seq-field-name="shipmentRouteSegmentId"/>
<field-to-result field-name="shipmentRouteSegmentId" map-name="newEntity" result-name="shipmentRouteSegmentId"/>
<if-empty field-name="carrierServiceStatusId" map-name="newEntity">
<if-empty field="newEntity.carrierServiceStatusId">
<set value="SHRSCS_NOT_STARTED" field="newEntity.carrierServiceStatusId"/>
</if-empty>
@@ -1087,7 +1087,7 @@ under the License.
<entity-one entity-name="ShipmentRouteSegment" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<if-empty field-name="newEntity.carrierServiceStatusId">
<if-empty field="newEntity.carrierServiceStatusId">
<set value="SHRSCS_NOT_STARTED" field="newEntity.carrierServiceStatusId"/>
</if-empty>
@@ -1121,7 +1121,7 @@ under the License.
<field-map field-name="shipmentRouteSegmentId" env-name="shipmentRouteSegmentId"/>
<field-map field-name="shipmentPackageSeqId" env-name="shipmentPackage.shipmentPackageSeqId"/>
</entity-one>
<if-empty field-name="checkShipmentPackageRouteSeg">
<if-empty field="checkShipmentPackageRouteSeg">
<set field="createShipmentPackageRouteSegMap.shipmentId" from-field="shipmentId"/>
<set field="createShipmentPackageRouteSegMap.shipmentRouteSegmentId" from-field="shipmentRouteSegmentId"/>
<set field="createShipmentPackageRouteSegMap.shipmentPackageSeqId" from-field="shipmentPackage.shipmentPackageSeqId"/>
@@ -1150,27 +1150,27 @@ under the License.
<or>
<and>
<or>
<if-empty field-name="fromStatusId"/>
<if-compare field-name="fromStatusId" operator="equals" value="SHIPMENT_PACKED"/>
<if-empty field="fromStatusId"/>
<if-compare field="fromStatusId" operator="equals" value="SHIPMENT_PACKED"/>
</or>
<if-compare field-name="testShipment.statusId" operator="equals" value="SHIPMENT_PACKED"/>
<if-compare field="testShipment.statusId" operator="equals" value="SHIPMENT_PACKED"/>
</and>
<and>
<or>
<if-compare field-name="fromStatusId" operator="equals" value="SHIPMENT_PACKED"/>
<if-compare field-name="fromStatusId" operator="equals" value="SHIPMENT_SHIPPED"/>
<if-compare field="fromStatusId" operator="equals" value="SHIPMENT_PACKED"/>
<if-compare field="fromStatusId" operator="equals" value="SHIPMENT_SHIPPED"/>
</or>
<if-compare field-name="testShipment.statusId" operator="equals" value="SHIPMENT_SHIPPED"/>
<if-compare field="testShipment.statusId" operator="equals" value="SHIPMENT_SHIPPED"/>
</and>
<and>
<or>
<if-compare field-name="fromStatusId" operator="equals" value="SHIPMENT_PACKED"/>
<if-compare field-name="fromStatusId" operator="equals" value="SHIPMENT_SHIPPED"/>
<if-compare field-name="fromStatusId" operator="equals" value="SHIPMENT_DELIVERED"/>
<if-compare field="fromStatusId" operator="equals" value="SHIPMENT_PACKED"/>
<if-compare field="fromStatusId" operator="equals" value="SHIPMENT_SHIPPED"/>
<if-compare field="fromStatusId" operator="equals" value="SHIPMENT_DELIVERED"/>
</or>
<if-compare field-name="testShipment.statusId" operator="equals" value="SHIPMENT_DELIVERED"/>
<if-compare field="testShipment.statusId" operator="equals" value="SHIPMENT_DELIVERED"/>
</and>
<if-compare field-name="testShipment.statusId" operator="equals" value="SHIPMENT_CANCELLED"/>
<if-compare field="testShipment.statusId" operator="equals" value="SHIPMENT_CANCELLED"/>
</or>
</condition>
<then>
@@ -1217,7 +1217,7 @@ under the License.
<simple-method method-name="quickShipEntireOrder" short-description="Quick ships an entire order from multiple facilities">
<!-- first get the order header; make sure we have a product store -->
<entity-one entity-name="OrderHeader" value-name="orderHeader"/>
<if-empty field-name="productStoreId" map-name="orderHeader">
<if-empty field="orderHeader.productStoreId">
<!-- no store cannot use quick ship; throw error -->
<add-error><fail-message message="No ProductStore associated with order; cannot use Quick Ship"/></add-error>
<check-errors/>
@@ -1228,11 +1228,11 @@ under the License.
<field-map field-name="productStoreId" env-name="orderHeader.productStoreId"/>
</entity-one>
<if-compare field-name="reserveInventory" map-name="productStore" operator="not-equals" value="Y">
<if-compare field="productStore.reserveInventory" operator="not-equals" value="Y">
<!-- no reservations; no shipment; cannot use quick ship -->
<add-error><fail-message message="ProductStore [${productStore.productStoreId}] does not reserve inventory; cannot use Quick Ship for Multiple Facilities"/></add-error>
</if-compare>
<if-compare field-name="explodeOrderItems" map-name="productStore" operator="equals" value="Y">
<if-compare field="productStore.explodeOrderItems" operator="equals" value="Y">
<!-- can't insert duplicate rows in shipmentPackageContent -->
<add-error><fail-message message="ProductStore [${productStore.productStoreId}] explodes order items; cannot use Quick Ship for Multiple Facilities"/></add-error>
</if-compare>
@@ -1245,7 +1245,7 @@ under the License.
</entity-condition>
<iterate list-name="orderItemAndShipGrpInvResAndItemList" entry-name="orderItemAndShipGrpInvResAndItem">
<if>
<condition><not><if-compare-field field-name="orderItemShipGrpInvResFacilityIds" operator="contains" to-field-name="orderItemAndShipGrpInvResAndItem.facilityId"/></not></condition>
<condition><not><if-compare-field field="orderItemShipGrpInvResFacilityIds" to-field="orderItemAndShipGrpInvResAndItem.facilityId" operator="contains"/></not></condition>
<then><field-to-list field-name="orderItemAndShipGrpInvResAndItem.facilityId" list-name="orderItemShipGrpInvResFacilityIds"/></then>
</if>
</iterate>
@@ -1267,7 +1267,7 @@ under the License.
<field-to-result field-name="shipmentShipGroupFacilityList"/>
<field-to-result field-name="successMessageList"/>
<if-empty field-name="shipmentShipGroupFacilityList">
<if-empty field="shipmentShipGroupFacilityList">
<add-error><fail-message message="Warning: no shipments created; could not find anything ready and needing to be shipped."/></add-error>
</if-empty>
<check-errors/>
@@ -1312,7 +1312,7 @@ under the License.
<field-map field-name="toOrderItemSeqId" env-name="orderItem.orderItemSeqId"/>
<field-map field-name="orderItemAssocTypeId" value="DROP_SHIPMENT"/>
</entity-and>
<if-not-empty field-name="orderItemAssocs">
<if-not-empty field="orderItemAssocs">
<iterate entry-name="orderItemAssoc" list-name="orderItemAssocs">
<set field="itemStatusContext.orderId" from-field="orderItemAssoc.orderId"/>
<set field="itemStatusContext.orderItemSeqId" from-field="orderItemAssoc.orderItemSeqId"/>
@@ -1340,7 +1340,7 @@ under the License.
</entity-and>
<!-- make sure we have something to ship -->
<if-empty field-name="orderItemAndShipGroupAssocList">
<if-empty field="orderItemAndShipGroupAssocList">
<add-error><fail-message message="No items available to ship at this time"/></add-error>
<check-errors/>
</if-empty>
@@ -1368,7 +1368,7 @@ under the License.
<set from-field="orderItemListByShGrpMap.${orderItemShipGroup.shipGroupSeqId}" field="perShipGroupItemList"/>
<!-- make sure we have something to ship -->
<if-empty field-name="perShipGroupItemList">
<if-empty field="perShipGroupItemList">
<string-to-list string="No items available to ship at this time for ship group ID [${orderItemShipGroup.shipGroupSeqId}]" list-name="successMessageList"/>
<else>
<!-- create the shipment for this facility and ship group combination -->
@@ -1376,7 +1376,7 @@ under the License.
<set from-field="orderItemShipGroup.shipGroupSeqId" field="shipmentContext.primaryShipGroupSeqId"/>
<!-- for Sales Shipment, order items' reservation facilityId is the originFacilityId, and the initial status is "INPUT"
for Purchase Shipment, the facilityId parameter is the destinationFacilityId, and the initial status is "CREATED" -->
<if><condition><if-compare field-name="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER"/></condition>
<if><condition><if-compare field="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER"/></condition>
<then>
<set from-field="orderItemShipGrpInvResFacilityId" field="shipmentContext.originFacilityId"/>
<set value="SHIPMENT_INPUT" field="shipmentContext.statusId"/>
@@ -1391,7 +1391,7 @@ under the License.
</call-service>
<find-by-primary-key entity-name="Shipment" map-name="shipmentLookupMap" value-name="shipment"/>
<if><condition><if-compare field-name="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER"/></condition>
<if><condition><if-compare field="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER"/></condition>
<then>
<iterate list-name="perShipGroupItemList" entry-name="orderItemAndShipGroupAssoc">
<!-- just get the OrderItemShipGrpInvResAndItem records for this facility and this ship group, since that is what this shipment is for -->
@@ -1443,7 +1443,7 @@ under the License.
</call-service>
</iterate>
<if><condition><if-compare field-name="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER"/></condition>
<if><condition><if-compare field="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER"/></condition>
<then>
<!-- update the shipment status to packed -->
<set from-field="shipment.shipmentId" field="packedContext.shipmentId"/>
@@ -1476,7 +1476,7 @@ under the License.
<simple-method method-name="createOrderShipmentPlan" short-description="Create Shipment, ShipmentItems and OrderShipment">
<!-- first get the order header; make sure we have a product store -->
<entity-one entity-name="OrderHeader" value-name="orderHeader"/>
<if-empty field-name="productStoreId" map-name="orderHeader">
<if-empty field="orderHeader.productStoreId">
<!-- no store cannot use quick ship; throw error -->
<add-error><fail-message message="No ProductStore associated with order; cannot use Quick Ship"/></add-error>
<check-errors/>
@@ -1507,9 +1507,9 @@ under the License.
</entity-one>
<!-- make sure the OrderItem is for a Product that has a ProductType with isPhysical=Y -->
<if-not-empty field-name="itemProduct">
<if-not-empty field="itemProduct">
<get-related-one value-name="itemProduct" relation-name="ProductType" to-value-name="itemProductType" use-cache="true"/>
<if-compare field-name="itemProductType.isPhysical" operator="equals" value="Y">
<if-compare field="itemProductType.isPhysical" operator="equals" value="Y">
<!-- Create shipment item -->
<clear-field field-name="addOrderShipmentToShipmentCtx"/>
<set field="addOrderShipmentToShipmentCtx.orderId" from-field="orderHeader.orderId"/>
@@ -1531,12 +1531,12 @@ under the License.
<!-- If serialNumber exist then run reserveAnInventoryItem for serialisedInventory.There is no need to check
this condition for the non-serialized inventory (Non serialized Inventory will directly issued).
-->
<if-not-empty field-name="parameters.serialNumber">
<if-not-empty field="parameters.serialNumber">
<make-value entity-name="OrderItemShipGrpInvRes" value-name="orderItemShipGrpInvResLookupPk"/>
<set-pk-fields value-name="orderItemShipGrpInvResLookupPk" map-name="parameters"/>
<find-by-primary-key entity-name="OrderItemShipGrpInvRes" map-name="orderItemShipGrpInvResLookupPk" value-name="orderItemShipGrpInvRes"/>
<get-related-one to-value-name="inventoryItem" relation-name="InventoryItem" value-name="orderItemShipGrpInvRes"/>
<if-compare-field operator="not-equals" field-name="inventoryItem.serialNumber" to-field-name="parameters.serialNumber">
<if-compare-field operator="not-equals" field="inventoryItem.serialNumber" to-field="parameters.serialNumber">
<!-- The inventory that we have reserved is not what we shipped. Lets reReserve, this time we'll get what we want -->
<set-service-fields map-name="parameters" to-map-name="reserveAnInventoryItemCtx" service-name="reserveAnInventoryItem"/>
<call-service service-name="reserveAnInventoryItem" in-map-name="reserveAnInventoryItemCtx">
@@ -1563,14 +1563,14 @@ under the License.
</entity-one>
<clear-field field-name="shipItemContext"/>
<set from-field="parameters.shipmentPackageSeqId" field="shipItemContext.shipmentPackageSeqId"/>
<if-empty field-name="shipItemContext.shipmentPackageSeqId">
<if-empty field="shipItemContext.shipmentPackageSeqId">
<set value="New" field="shipItemContext.shipmentPackageSeqId"/>
</if-empty>
<log level="info" message="Package SeqID : ${shipItemContext.shipmentPackageSeqId}"/>
<make-value entity-name="ShipmentPackage" value-name="shipmentPackageLookupPk"/>
<set-pk-fields value-name="shipmentPackageLookupPk" map-name="parameters"/>
<find-by-primary-key entity-name="ShipmentPackage" map-name="shipmentPackageLookupPk" value-name="shipmentPackage"/>
<if-empty field-name="shipmentPackage">
<if-empty field="shipmentPackage">
<set from-field="itemIssuance.shipmentId" field="shipPackageContext.shipmentId"/>
<set from-field="shipItemContext.shipmentPackageSeqId" field="shipPackageContext.shipmentPackageSeqId"/>
<call-service service-name="createShipmentPackage" in-map-name="shipPackageContext"/>
@@ -1584,20 +1584,20 @@ under the License.
<result-to-field result-name="shipmentPackageSeqId" map-name="routeSegLookup"/>
</call-service>
<if-not-empty field-name="shipmentPackageSeqId" map-name="routeSegLookup">
<if-not-empty field="routeSegLookup.shipmentPackageSeqId">
<set from-field="itemIssuance.shipmentId" field="routeSegLookup.shipmentId"/>
<!-- quick ship orders should only have one route segment -->
<set value="00001" field="routeSegLookup.shipmentRouteSegmentId"/>
<find-by-primary-key entity-name="ShipmentPackageRouteSeg" map-name="routeSegLookup" value-name="packageRouteSegment"/>
<if-not-empty field-name="packageRouteSegment">
<if-not-empty field="packageRouteSegment">
<set from-field="parameters.trackingNum" field="packageRouteSegment.trackingCode"/>
<store-value value-name="packageRouteSegment"/>
</if-not-empty>
<if-empty field-name="packageRouteSegment">
<if-empty field="packageRouteSegment">
<log level="warning" message="No route segment found : ${routeSegLookup}"/>
</if-empty>
</if-not-empty>
<if-empty field-name="routeSegLookup.shipmentPackageSeqId">
<if-empty field="routeSegLookup.shipmentPackageSeqId">
<log level="warning" message="No shipment package ID found; cannot update RouteSegment"/>
</if-empty>
@@ -1609,7 +1609,7 @@ under the License.
<set value="SHIPMENT_PACKED" field="packedContext.statusId"/>
<call-service service-name="updateShipment" in-map-name="packedContext"/>
<!--update the shipment status to shipped -->
<if-empty field-name="parameters.setPackedOnly">
<if-empty field="parameters.setPackedOnly">
<set from-field="parameters.shipmentId" field="packedContext.shipmentId"/>
<set value="SHIPMENT_SHIPPED" field="packedContext.statusId"/>
<call-service service-name="updateShipment" in-map-name="packedContext"/>
@@ -1625,27 +1625,27 @@ under the License.
<!-- first get the order header; make sure we have a product store -->
<entity-one entity-name="OrderHeader" value-name="orderHeader"/>
<if-empty field-name="parameters.originFacilityId">
<if-empty field-name="orderHeader.productStoreId">
<if-empty field="parameters.originFacilityId">
<if-empty field="orderHeader.productStoreId">
<!-- no store cannot use quick ship; throw error -->
<add-error><fail-message message="No ProductStore associated with order; cannot use Quick Ship"/></add-error>
<check-errors/>
</if-empty>
<if-not-empty field-name="orderHeader.productStoreId">
<if-not-empty field="orderHeader.productStoreId">
<!-- get the product store entity -->
<entity-one entity-name="ProductStore" value-name="productStore">
<field-map field-name="productStoreId" env-name="orderHeader.productStoreId"/>
</entity-one>
<if-compare field-name="productStore.reserveInventory" operator="not-equals" value="Y">
<if-compare field="productStore.reserveInventory" operator="not-equals" value="Y">
<!-- no reservations; no shipment; cannot use quick ship -->
<add-error><fail-message message="ProductStore [${productStore.productStoreId}] does not reserve inventory; cannot use Quick Ship"/></add-error>
</if-compare>
<if-compare field-name="productStore.oneInventoryFacility" operator="not-equals" value="Y">
<if-compare field="productStore.oneInventoryFacility" operator="not-equals" value="Y">
<!-- if we allow multiple facilities we cannot use quick ship; throw error -->
<add-error><fail-message message="ProductStore [${productStore.productStoreId}] allows multiple facilities; cannot use Quick Ship"/></add-error>
</if-compare>
<if-empty field-name="productStore.inventoryFacilityId">
<if-empty field="productStore.inventoryFacilityId">
<!-- if no inventoryFacility is defined we cannot use quick ship; throw error -->
<add-error><fail-message message="No inventory facility associated with ProductStore [${productStore.productStoreId}]; cannot use Quick Ship"/></add-error>
</if-empty>
@@ -1654,7 +1654,7 @@ under the License.
</if-empty>
<!-- make sure we have items to issue -->
<if-empty field-name="parameters.itemShipList">
<if-empty field="parameters.itemShipList">
<add-error><fail-message message="No items available to ship at this time"/></add-error>
<check-errors/>
</if-empty>
@@ -1663,7 +1663,7 @@ under the License.
<set from-field="parameters.itemShipList" field="itemMapList"/>
<!-- we are all good to go; create the shipment -->
<if-not-empty field-name="parameters.originFacilityId">
<if-not-empty field="parameters.originFacilityId">
<set from-field="parameters.originFacilityId" field="shipmentContext.originFacilityId"/>
</if-not-empty>
<set from-field="parameters.orderId" field="shipmentContext.primaryOrderId"/>
@@ -1700,7 +1700,7 @@ under the License.
<clear-field field-name="shipItemContext"/>
<set from-field="packageMap.${itemMap.trackingNum}" field="shipItemContext.shipmentPackageSeqId"/>
<if-empty field-name="shipItemContext.shipmentPackageSeqId">
<if-empty field="shipItemContext.shipmentPackageSeqId">
<set value="New" field="shipItemContext.shipmentPackageSeqId"/>
</if-empty>
<log level="info" message="Package SeqID : ${shipItemContext.shipmentPackageSeqId}"/>
@@ -1713,21 +1713,21 @@ under the License.
<result-to-field result-name="shipmentPackageSeqId" map-name="routeSegLookup"/>
</call-service>
<if-not-empty field-name="shipmentPackageSeqId" map-name="routeSegLookup">
<if-not-empty field="routeSegLookup.shipmentPackageSeqId">
<set from-field="itemIssuance.shipmentId" field="routeSegLookup.shipmentId"/>
<!-- quick ship orders should only have one route segment -->
<set value="00001" field="routeSegLookup.shipmentRouteSegmentId"/>
<find-by-primary-key entity-name="ShipmentPackageRouteSeg" map-name="routeSegLookup" value-name="packageRouteSegment"/>
<if-not-empty field-name="packageRouteSegment">
<if-not-empty field="packageRouteSegment">
<set from-field="itemMap.trackingNum" field="packageRouteSegment.trackingCode"/>
<store-value value-name="packageRouteSegment"/>
</if-not-empty>
<if-empty field-name="packageRouteSegment">
<if-empty field="packageRouteSegment">
<log level="warning" message="No route segment found : ${routeSegLookup}"/>
</if-empty>
</if-not-empty>
<if-empty field-name="routeSegLookup.shipmentPackageSeqId">
<if-empty field="routeSegLookup.shipmentPackageSeqId">
<log level="warning" message="No shipment package ID found; cannot update RouteSegment"/>
</if-empty>
</iterate>
@@ -1738,7 +1738,7 @@ under the License.
<call-service service-name="updateShipment" in-map-name="packedContext"/>
<!-- update the shipment status to shipped -->
<if-empty field-name="parameters.setPackedOnly">
<if-empty field="parameters.setPackedOnly">
<set from-field="shipment.shipmentId" field="packedContext.shipmentId"/>
<set value="SHIPMENT_SHIPPED" field="packedContext.statusId"/>
<call-service service-name="updateShipment" in-map-name="packedContext"/>
@@ -1776,7 +1776,7 @@ under the License.
</calcop>
</calculate>
<clear-field field-name="inMap"/>
<if-compare field-name="shipmentItem.quantity" operator="greater" value="0.0" type="Double">
<if-compare field="shipmentItem.quantity" operator="greater" value="0.0" type="Double">
<set from-field="parameters.userLogin" field="inMap.userLogin"/>
<set from-field="parameters.shipmentId" field="inMap.shipmentId"/>
<set from-field="parameters.shipmentItemSeqId" field="inMap.shipmentItemSeqId"/>
@@ -1803,7 +1803,7 @@ under the License.
</check-permission>
<!-- if quantity is greater than 0 we add or update the ShipmentPlan -->
<if-compare field-name="parameters.quantity" operator="greater" value="0" type="Double">
<if-compare field="parameters.quantity" operator="greater" value="0" type="Double">
<!-- get orderHeader -->
<make-value entity-name="OrderHeader" value-name="orderHeaderLookupPk"/>
@@ -1811,7 +1811,7 @@ under the License.
<find-by-primary-key map-name="orderHeaderLookupPk" value-name="orderHeader"/>
<!-- make sure the order is of orderTypeId: SALES_ORDER -->
<if-compare field-name="orderTypeId" map-name="orderHeader" operator="not-equals" value="SALES_ORDER">
<if-compare field="orderHeader.orderTypeId" operator="not-equals" value="SALES_ORDER">
<string-to-list string="Not adding Order Item to plan for shipment [${parameters.shipmentId}] because the order is not a Sales Order for order [${parameters.orderId}] order item [${parameters.orderItemSeqId}]" list-name="error_list"/>
</if-compare>
@@ -1824,7 +1824,7 @@ under the License.
<make-value entity-name="OrderShipment" value-name="orderShipmentLookup"/>
<set-pk-fields value-name="orderShipmentLookup" map-name="parameters"/>
<find-by-and entity-name="OrderShipment" map-name="orderShipmentLookup" list-name="existingOrderShipments"/>
<if-not-empty field-name="existingOrderShipments">
<if-not-empty field="existingOrderShipments">
<string-to-list string="Not adding Order Item to plan for shipment [${parameters.shipmentId}] because the order item is already in the shipment (order [${parameters.orderId}], order item [${parameters.orderItemSeqId}])" list-name="error_list"/>
</if-not-empty>
@@ -1834,7 +1834,7 @@ under the License.
<result-to-field result-name="remainingQuantity" field-name="remainingQuantity"/>
</call-service>
<if-compare-field field-name="parameters.quantity" operator="greater" to-field-name="remainingQuantity" type="Double">
<if-compare-field field="parameters.quantity" to-field="remainingQuantity" operator="greater" type="Double">
<string-to-list string="Not adding Order Item to plan for shipment [${parameters.shipmentId}] because the quantity is greater than the remaining quantity (order [${parameters.orderId}], order item [${parameters.orderItemSeqId}])" list-name="error_list"/>
</if-compare-field>
<check-errors/>
@@ -1952,9 +1952,9 @@ under the License.
<field-map field-name="shipmentRouteSegmentId" env-name="routeSegMap.shipmentRouteSegmentId"/>
</entity-one>
<assert>
<not><if-empty field-name="shipmentRouteSegment"/></not>
<if-compare-field field-name="shipmentRouteSegment.shipmentId" operator="equals" to-field-name="shipRouteSegMap.shipmentId"/>
<if-compare-field field-name="shipmentRouteSegment.shipmentRouteSegmentId" operator="equals" to-field-name="routeSegMap.shipmentRouteSegmentId"/>
<not><if-empty field="shipmentRouteSegment"/></not>
<if-compare-field field="shipmentRouteSegment.shipmentId" to-field="shipRouteSegMap.shipmentId" operator="equals"/>
<if-compare-field field="shipmentRouteSegment.shipmentRouteSegmentId" to-field="routeSegMap.shipmentRouteSegmentId" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
@@ -77,8 +77,8 @@ under the License.
</entity-one>
<assert>
<not><if-empty field-name="shipment"/></not>
<if-compare-field field-name="shipment.shipmentId" operator="equals" to-field-name="completePackOutMap.shipmentId"/>
<not><if-empty field="shipment"/></not>
<if-compare-field field="shipment.shipmentId" to-field="completePackOutMap.shipmentId" operator="equals"/>
</assert>
<check-errors/>
@@ -97,7 +97,7 @@ under the License.
</entity-one>
<assert>
<not><if-empty field-name="invoice"/></not>
<not><if-empty field="invoice"/></not>
</assert>
<check-errors/>
</iterate>
@@ -136,9 +136,9 @@ under the License.
</entity-one>
<assert>
<not><if-empty field-name="shipment"/></not>
<if-compare-field field-name="shipment.shipmentId" operator="equals" to-field-name="updateShipmentOutMap.shipmentId"/>
<if-compare-field field-name="shipment.statusId" operator="equals" to-field-name="updateShipmentInMap.statusId"/>
<not><if-empty field="shipment"/></not>
<if-compare-field field="shipment.shipmentId" to-field="updateShipmentOutMap.shipmentId" operator="equals"/>
<if-compare-field field="shipment.statusId" to-field="updateShipmentInMap.statusId" operator="equals"/>
</assert>
<check-errors/>
@@ -190,4 +190,4 @@ under the License.
</assert>
<check-errors/>
</simple-method>
</simple-methods>
</simple-methods>
@@ -36,7 +36,7 @@ under the License.
<result-to-field result-name="updatedUserLogin" field-name="updatedUserLogin"/>
</call-service>
<session-to-field field-name="userLogin"/>
<if-compare-field map-name="userLogin" field-name="userLoginId" operator="equals" to-map-name="updatedUserLogin" to-field-name="userLoginId">
<if-compare-field field="userLogin.userLoginId" operator="equals" to-field="updatedUserLogin.userLoginId">
<field-to-session field-name="updatedUserLogin" session-name="userLogin"/>
</if-compare-field>
</simple-method>
@@ -98,7 +98,7 @@ under the License.
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="fromDate" map-name="newEntity">
<if-empty field="newEntity.fromDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<set from-field="nowTimestamp" field="newEntity.fromDate"/>
</if-empty>
@@ -32,7 +32,7 @@ under the License.
<if>
<condition>
<not>
<if-compare field-name="hasPermission" value="true" operator="equals"/>
<if-compare field="hasPermission" value="true" operator="equals"/>
</not>
</condition>
<then>
@@ -42,16 +42,16 @@ under the License.
<call-simple-method method-name="genericBasePermissionCheck" xml-resource="org/ofbiz/common/permission/CommonPermissionServices.xml"/>
<if>
<condition>
<if-compare field-name="hasPermission" value="true" operator="equals"/>
<if-compare field="hasPermission" value="true" operator="equals"/>
</condition>
<then>
<log level="info" message="User has ROLE permission, now checking if user is in required ROLE "></log>
<if>
<condition>
<and>
<if-compare field-name="mainAction" value="CREATE" operator="equals"/>
<if-compare field="mainAction" value="CREATE" operator="equals"/>
<not>
<if-empty field-name="parameters.workEffortParentId"/>
<if-empty field="parameters.workEffortParentId"/>
</not>
</and>
</condition>
@@ -63,7 +63,7 @@ under the License.
<else-if>
<!-- Processing UPDATE permission check -->
<condition>
<if-compare field-name="mainAction" value="UPDATE" operator="equals"/>
<if-compare field="mainAction" value="UPDATE" operator="equals"/>
</condition>
<then>
<!-- make sure we have role permission to update THIS workeffort -->
@@ -76,9 +76,9 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="hasPermission" value="true" operator="equals"/>
<not><if-empty field-name="parameters.workEffortParentId"/></not>
<if-compare-field field-name="parameters.workEffortParentId" operator="not-equals" to-field-name="workEffort.workEffortParentId"/>
<if-compare field="hasPermission" value="true" operator="equals"/>
<not><if-empty field="parameters.workEffortParentId"/></not>
<if-compare-field field="parameters.workEffortParentId" to-field="workEffort.workEffortParentId" operator="not-equals"/>
</and>
</condition>
<then>
@@ -92,7 +92,7 @@ under the License.
<if>
<condition>
<not>
<if-compare field-name="hasPermission" value="true" operator="equals"/>
<if-compare field="hasPermission" value="true" operator="equals"/>
</not>
</condition>
<then>
@@ -102,9 +102,9 @@ under the License.
<if>
<condition>
<and>
<if-compare field-name="hasPermission" value="true" operator="equals"/>
<not><if-empty field-name="parameters.workEffortParentId"/></not>
<if-compare-field field-name="parameters.workEffortParentId" operator="not-equals" to-field-name="workEffort.workEffortParentId"/>
<if-compare field="hasPermission" value="true" operator="equals"/>
<not><if-empty field="parameters.workEffortParentId"/></not>
<if-compare-field field="parameters.workEffortParentId" to-field="workEffort.workEffortParentId" operator="not-equals"/>
</and>
</condition>
<then>
@@ -125,11 +125,11 @@ under the License.
</simple-method>
<simple-method method-name="workEffortPartyOwnerRolePermission" short-description="Check if Party is in CAL_OWNER or CAL_DELEGATE role with WorkEffort">
<if-empty field-name="workEffortId">
<if-empty field="workEffortId">
<!-- This should be case of create WorkEffort -->
<set field="workEffortId" from-field="parameters.workEffortParentId"/>
</if-empty>
<while><condition><not><if-empty field-name="workEffortId"></if-empty></not></condition>
<while><condition><not><if-empty field="workEffortId"></if-empty></not></condition>
<then>
<!-- if the case is of new workEffort with Parent workEffort Id,
then lookup the parent workEffort and check if user is in any OWNER role with WorkEffort -->
@@ -142,14 +142,14 @@ under the License.
<filter-list-by-date list-name="roleParties"/>
<log level="always" message="Found role parties: ${roleParties}"/>
<if-empty field-name="roleParties">
<if-empty field="roleParties">
<log level="info" message="Party ${userLogin.partyId} is not in ${roleTypeId} role with workEffort: ${workEffortId}"/>
<set value="CAL_DELEGATE" field="lookupRoleWorkEffortMap.roleTypeId"/>
<find-by-and entity-name="WorkEffortPartyAssignment" map-name="lookupRoleWorkEffortMap" list-name="roleParties"/>
</if-empty>
<filter-list-by-date list-name="roleParties"/>
<if-not-empty field-name="roleParties">
<if-not-empty field="roleParties">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
<log level="info" message="Party ${userLogin.partyId} is in ${lookupRoleWorkEffortMap.roleTypeId} role with workEffort: ${workEffortId}"/>
@@ -166,7 +166,7 @@ under the License.
<set field="workEffortLookUpMap.workEffortId" from-field="workEffortId"/>
<find-by-primary-key entity-name="WorkEffort" map-name="workEffortLookUpMap" value-name="workEffortParent"/>
<set from-field="workEffortParent.workEffortParentId" field="workEffortId"/>
<if-empty field-name="workEffortParent.workEffortParentId">
<if-empty field="workEffortParent.workEffortParentId">
<clear-field field-name="workEffortId"/>
</if-empty>
</else>
@@ -177,11 +177,11 @@ under the License.
</simple-method>
<simple-method method-name="workEffortPartyAnyRolePermission" short-description="Check if Party is in ANY role with WorkEffort">
<if-empty field-name="workEffortId">
<if-empty field="workEffortId">
<!-- This should be case of create WorkEffort -->
<set field="workEffortId" from-field="parameters.workEffortParentId"/>
</if-empty>
<while><condition><not><if-empty field-name="workEffortId"></if-empty></not></condition>
<while><condition><not><if-empty field="workEffortId"></if-empty></not></condition>
<then>
<!-- if the case is of new workEffort with Parent workEffort Id,
then lookup the parent workEffort and check if user is in any role with WorkEffort -->
@@ -190,7 +190,7 @@ under the License.
<find-by-and entity-name="WorkEffortPartyAssignment" map-name="lookupRoleWorkEffortMap" list-name="roleParties"/>
<filter-list-by-date list-name="roleParties"/>
<if-not-empty field-name="roleParties">
<if-not-empty field="roleParties">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
<log level="info" message="Party ${userLogin.partyId} is associated with workEffort: ${workEffortId}"/>
@@ -207,7 +207,7 @@ under the License.
<set field="workEffortLookUpMap.workEffortId" from-field="workEffortId"/>
<find-by-primary-key entity-name="WorkEffort" map-name="workEffortLookUpMap" value-name="workEffortParent"/>
<set from-field="workEffortParent.workEffortParentId" field="workEffortId"/>
<if-empty field-name="workEffortParent.workEffortParentId">
<if-empty field="workEffortParent.workEffortParentId">
<clear-field field-name="workEffortId"/>
</if-empty>
</else>
@@ -221,18 +221,18 @@ under the License.
<set field="parameters.mainAction" value="UPDATE"/>
<call-simple-method method-name="workEffortGenericPermission"/>
<check-errors/>
<if-compare-field operator="not-equals" field-name="parameters.partyId" to-field-name="userLogin.partyId">
<if-compare-field operator="not-equals" field="parameters.partyId" to-field="userLogin.partyId">
<property-to-field resource="WorkEffortUiLabels" property="WorkEffortTimeSheetNotInRolePermissionError" field-name="failMessage"/>
<set field="hasPermission" type="Boolean" value="false"/>
<field-to-result field-name="hasPermission"/>
<field-to-result field-name="failMessage"/>
</if-compare-field>
<if-not-empty field-name="workEffortId">
<if-not-empty field="workEffortId">
<set from-field="workEffortId" field="lookupRoleWorkEffortMap.workEffortId"/>
<set from-field="userLogin.partyId" field="lookupRoleWorkEffortMap.partyId"/>
<find-by-and entity-name="WorkEffortPartyAssignByRole" map-name="lookupRoleWorkEffortMap" list-name="roleParties"/>
<filter-list-by-date list-name="roleParties"/>
<if-empty field-name="roleParties">
<if-empty field="roleParties">
<property-to-field resource="WorkEffortUiLabels" property="WorkEffortTimeSheetNotInRolePermissionError" field-name="failMessage"/>
<set field="hasPermission" type="Boolean" value="false"/>
<field-to-result field-name="hasPermission"/>
@@ -244,11 +244,11 @@ under the License.
<!-- check for party groups -->
<!-- Get list of Party Groups in CAL_OWNER or CAL_DELEGATE with WorkEffort or its parents -->
<simple-method method-name="workEffortPartyGroupRolePermission" short-description="Check if Party is party member of PartyGroup that is in CAL_OWNER or CAL_DELEGATE role with WorkEffort">
<if-empty field-name="workEffortId">
<if-empty field="workEffortId">
<!-- This should be case of create WorkEffort -->
<set field="workEffortId" from-field="parameters.workEffortParentId"/>
</if-empty>
<while><condition><not><if-empty field-name="workEffortId"></if-empty></not></condition>
<while><condition><not><if-empty field="workEffortId"></if-empty></not></condition>
<then>
<!-- Get list of Parties of Type PartyGroup in CAL_OWNER or CAL_DELEGATE with WorkEffort -->
<set from-field="workEffortId" field="lookupPartyRoleWorkEffortMap.workEffortId"/>
@@ -260,13 +260,13 @@ under the License.
<filter-list-by-date list-name="rolePartyGroups"/>
<log level="always" message="Found role parties Group: ${rolePartyGroups}"/>
<if-empty field-name="rolePartyGroups">
<if-empty field="rolePartyGroups">
<log level="info" message="No Party Group found in CAL_OWNER role with workEffort: ${workEffortId}"/>
<set value="CAL_DELEGATE" field="lookupRoleWorkEffortMap.roleTypeId"/>
<find-by-and entity-name="WorkEffortPartyAssignView" map-name="lookupRoleWorkEffortMap" list-name="rolePartyGroups"/>
</if-empty>
<filter-list-by-date list-name="rolePartyGroups"/>
<if-not-empty field-name="rolePartyGroups">
<if-not-empty field="rolePartyGroups">
<!-- Check to see if User is member of any of these Party groups -->
<iterate entry-name="rolePartyGroup" list-name="rolePartyGroups">
<!-- check current party is the member of party group-->
@@ -277,7 +277,7 @@ under the License.
<log level="always" message="Conditions: ${lookupPartyRoleMap}"/>
<find-by-and entity-name="PartyRelationship" map-name="lookupPartyRoleMap" list-name="partyGroupRelationships"/>
<log level="always" message="Found role parties relations: ${partyGroupRelationships}"/>
<if-not-empty field-name="partyGroupRelationships">
<if-not-empty field="partyGroupRelationships">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field-name="hasPermission"/>
<log level="info" message="Party ${userLogin.partyId} is associated with workEffort: ${workEffortId}"/>
@@ -294,7 +294,7 @@ under the License.
<set field="workEffortLookUpMap.workEffortId" from-field="workEffortId"/>
<find-by-primary-key entity-name="WorkEffort" map-name="workEffortLookUpMap" value-name="workEffortParent"/>
<set from-field="workEffortParent.workEffortParentId" field="workEffortId"/>
<if-empty field-name="workEffortParent.workEffortParentId">
<if-empty field="workEffortParent.workEffortParentId">
<clear-field field-name="workEffortId"/>
</if-empty>
</else>
@@ -27,7 +27,7 @@ under the License.
<check-errors/>
<make-value value-name="newEntity" entity-name="PartyRate"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<call-simple-method method-name="checkOtherDefaultRate"/>
<create-value value-name="newEntity"/>
@@ -41,12 +41,12 @@ under the License.
<store-value value-name="newEntity"/>
</simple-method>
<simple-method method-name="checkOtherDefaultRate" short-description="remove an other defaultRate flag">
<if-compare field-name="newEntity.defaultRate" value="Y" operator="equals">
<if-compare field="newEntity.defaultRate" value="Y" operator="equals">
<entity-and entity-name="PartyRate" list-name="rates" filter-by-date="true">
<field-map field-name="partyId" env-name="newEntity.partyId"/>
<field-map field-name="defaultRate" value="Y"/>
</entity-and>
<if-not-empty field-name="rates">
<if-not-empty field="rates">
<first-from-list entry-name="rate" list-name="rates"/>
<set field="rate.defaultRate" value="N"/>
<store-value value-name="rate"/>
@@ -68,7 +68,7 @@ under the License.
<make-value value-name="newEntity" entity-name="WorkEffortAssignmentRate"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<create-value value-name="newEntity"/>
</simple-method>
@@ -28,7 +28,7 @@ under the License.
<field-to-result field-name="newEntity.timesheetId" result-name="timesheetId"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.statusId">
<if-empty field="newEntity.statusId">
<set field="newEntity.statusId" value="TIMESHEET_IN_PROCESS"/>
</if-empty>
<create-value value-name="newEntity"/>
@@ -48,7 +48,7 @@ under the License.
<remove-value value-name="timesheet"/>
</simple-method>
<simple-method method-name="createTimesheetForThisWeek" short-description="Create Timesheet For This Week of no date provided, otherwise for a specific week">
<if-empty field-name="parameters.requiredDate">
<if-empty field="parameters.requiredDate">
<now-timestamp-to-env env-name="nowTimestamp"/>
<else>
<set field="nowTimestamp" from-field="parameters.requiredDate"/>
@@ -66,7 +66,7 @@ under the License.
<field-map field-name="fromDate" env-name="parameters.fromDate"/>
<field-map field-name="thruDate" env-name="parameters.thruDate"/>
</entity-and>
<if-empty field-name="timesheets">
<if-empty field="timesheets">
<call-simple-method method-name="createTimesheet"/>
<else>
<add-error><fail-message message="Time sheet already exist, not created an other one."/></add-error>
@@ -88,7 +88,7 @@ under the License.
<entity-one entity-name="Timesheet" value-name="timesheet"/>
<get-related value-name="timesheet" relation-name="TimeEntry" list-name="timeEntryList"/>
<if-empty field-name="parameters.invoiceId">
<if-empty field="parameters.invoiceId">
<set-service-fields service-name="createInvoice" map-name="parameters" to-map-name="createInvoiceMap"/>
<set field="createInvoiceMap.invoiceTypeId" value="SALES_INVOICE"/>
<set field="createInvoiceMap.statusId" value="INVOICE_IN_PROCESS"/>
@@ -102,7 +102,7 @@ under the License.
</if-empty>
<entity-one entity-name="Invoice" value-name="invoice"/>
<if-empty field-name="invoice">
<if-empty field="invoice">
<add-error><fail-message message="Could not find invoice with ID [${invoiceId}], not adding Timesheet Entries to it."/></add-error>
<check-errors/>
</if-empty>
@@ -116,7 +116,7 @@ under the License.
<entity-one entity-name="WorkEffort" value-name="workEffort"/>
<get-related value-name="workEffort" relation-name="TimeEntry" list-name="timeEntryList"/>
<if-empty field-name="parameters.invoiceId">
<if-empty field="parameters.invoiceId">
<set-service-fields service-name="createInvoice" map-name="parameters" to-map-name="createInvoiceMap"/>
<set field="createInvoiceMap.invoiceTypeId" value="SALES_INVOICE"/>
<set field="createInvoiceMap.statusId" value="INVOICE_IN_PROCESS"/>
@@ -130,7 +130,7 @@ under the License.
</if-empty>
<entity-one entity-name="Invoice" value-name="invoice"/>
<if-empty field-name="invoice">
<if-empty field="invoice">
<add-error><fail-message message="Could not find invoice with ID [${invoiceId}], not adding Timesheet Entries to it."/></add-error>
<check-errors/>
</if-empty>
@@ -140,7 +140,7 @@ under the License.
<simple-method method-name="createTimeEntryInvoiceItemsInline" short-description="createTimeEntryInvoiceItemsInline">
<iterate entry-name="timeEntry" list-name="timeEntryList">
<!-- only add to invoice if it is not already on an invoice; may want to make this smarter in the future to see if invoice cancelled or some such -->
<if-empty field-name="timeEntry.invoiceId">
<if-empty field="timeEntry.invoiceId">
<clear-field field-name="createInvoiceItemMap"/>
<clear-field field-name="getTimeEntryRate"/>
<clear-field field-name="rateAmount"/>
@@ -196,7 +196,7 @@ under the License.
<field-to-result field-name="newEntity.timeEntryId" result-name="timeEntryId"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<if-empty field-name="newEntity.fromDate">
<if-empty field="newEntity.fromDate">
<call-class-method class-name="org.ofbiz.base.util.UtilDateTime" method-name="getDayStart" ret-field-name="newEntity.fromDate">
<field field-name="nowTimestamp" type="java.sql.Timestamp"/>
</call-class-method>
@@ -227,7 +227,7 @@ under the License.
<entity-one entity-name="TimeEntry" value-name="timeEntry"/>
<!-- first try the WorkEffortAssignmentRate -->
<if-not-empty field-name="timeEntry.workEffortId">
<if-not-empty field="timeEntry.workEffortId">
<entity-condition entity-name="WorkEffortAssignmentRate" list-name="workEffortAssignmentRateList">
<condition-list combine="and">
<condition-expr field-name="workEffortId" env-name="timeEntry.workEffortId"/>
@@ -238,13 +238,13 @@ under the License.
</entity-condition>
<filter-list-by-date list-name="workEffortAssignmentRateList" all-same="true"/>
<first-from-list entry-name="workEffortAssignmentRate" list-name="workEffortAssignmentRateList"/>
<if-not-empty field-name="workEffortAssignmentRate">
<if-not-empty field="workEffortAssignmentRate">
<set field="rateAmount" from-field="workEffortAssignmentRate.rate"/>
</if-not-empty>
</if-not-empty>
<!-- no rateAmount yet, try PartyRate -->
<if-empty field-name="rateAmount">
<if-empty field="rateAmount">
<entity-condition entity-name="PartyRate" list-name="partyRateList">
<condition-list combine="and">
<condition-expr field-name="partyId" env-name="timeEntry.partyId"/>
@@ -254,7 +254,7 @@ under the License.
</entity-condition>
<filter-list-by-date list-name="partyRateList" all-same="true"/>
<first-from-list entry-name="partyRate" list-name="partyRateList"/>
<if-not-empty field-name="partyRate">
<if-not-empty field="partyRate">
<set field="rateAmount" from-field="partyRate.rate"/>
</if-not-empty>
</if-empty>
@@ -267,22 +267,22 @@ under the License.
<if>
<condition>
<or>
<not><if-empty field-name="parameters.timesheetId"/></not>
<not><if-empty field-name="lookedUpValue.timesheetId"/></not>
<not><if-empty field="parameters.timesheetId"/></not>
<not><if-empty field="lookedUpValue.timesheetId"/></not>
</or>
</condition>
<then>
<if-empty field-name="parameters.timesheetId">
<if-empty field="parameters.timesheetId">
<set field="parameters.timesheetId" from-field="lookedUpValue.timesheetId"/>
</if-empty>
<entity-one entity-name="Timesheet" value-name="timesheet"/>
<if-empty field-name="timesheet">
<if-empty field="timesheet">
<add-error><fail-message message="Timesheet could not be found, timesheetId: ${parameters.timesheetId}"/></add-error>
<log level="info" message="Timesheet not found, timesheet: ${parameters.timesheetId}"/>
<check-errors/>
</if-empty>
<!-- check if the status is in progress... -->
<if-compare field-name="timesheet.statusId" value="TIMESHEET_IN_PROCESS" operator="not-equals">
<if-compare field="timesheet.statusId" value="TIMESHEET_IN_PROCESS" operator="not-equals">
<get-related-one value-name="timesheet" relation-name="StatusItem" to-value-name="statusItem"/>
<add-error><fail-message message="Can only update Timesheet, when status is in-process...current status: ${statusItem.description}"/></add-error>
<log level="info" message="Can only update Timesheet, when status is in-process...is now: ${timesheet.statusId}"/>

Some files were not shown because too many files have changed in this diff Show More