Copy Functions
Copy function can be used to get the required column value of any existing entity in ORMB system. This function will invoke the Business Object (BO) or Business Service (BS) that is provided as parameter value i.e. “SERVICE_NAME” and get the required column or list block i.e. “OUTPUT_XPATH” from its returned XML data payload.
COPY functions can be used in only FIELD TRANSFORMATION section but not in HEADER and FOOTER TRANSFORMATION.
COPY with BO – To invoke BO, parameter SERVICE_TYPE value must be BO. This function will require an input of primary key of a primary table defined in its corresponding Maintenance Object (MO) meta-.
COPY with BS – To invoke BS, parameter SERVICE_TYPE value must be BS. This function can have any of those possible inputs defined in BS HEADER schema.
Function:
COPY(SERVICE_TYPE, SERVICE_NAME, OUTPUT_XPATH, SET_OPERATION,
INPUT[ELEMENT_XPATH=INPUT_VALUE], PREPROCESS[OPERATION], POSTPROCESS[OPERATION],
FILTER[ELEMENT_XPATH=INPUT_VALUE], UPD[ELEMENT_XPATH=INPUT_VALUE])
INPUT Parameter details:
SERVICE_TYPE
Type of Service to be invoked. It can have either of this two values “BO” or “BS”.
SERVICE_NAME
ORMB “BO” or “BS” service names that is to be invoked for copying.
OUTPUT_XPATH
COPY function will be getting the response in XML form.So, this will be theXPATH of that element whose value we want to map from the response XML. This XPATH can be either of an individual element or the list block in the response XML.
List Block XPATH will allow to copy the complete list block from the response XML to the input payload.
Example:
COPY(BO,C1-AccountBO,C1-AccountBO/accountAutopay,
FILTER[C1-AccountBO/accountAutopay/endDate=''],UPD[AUTO PAY EXPIRES ON= '2020-12-31',
C1-AccountBO/accountAutopay/endDate=AUTO PAY EXPIRY])
In this above COPY function example, we are mapping the “C1-AccountBO/accountAutopay” list block from the copied entity to the input service payload.
COPY for list block retrieval will be invoked with having service payload XML as an input. This service payload must have the required primary key inputs for the BO to be invoked.
If we are invoking BO ‘C1-AccountBO’, then, this input service payload must have ‘C1-AccountBO/accountId’ element value i.e. Primary key value of primary table defined in Account MO.
SET_OPERATION
This can have a BOOLEAN value.
If TRUE - Reset operation configured at service level.
If FALSE - Validate the fetch function output i.e. Throws error if returns NULL or multiple records.
If NULL – Will do nothing but only throw an error if function return multiple records.
INPUT [ELEMENT_XPATH=INPUT_VALUE]
This is an optional input parameter block. Applicable only if we want to get the individual element value i.e. not the list block from response XML.
This block can have multiple comma-separated inputs.
-
ELEMENT_XPATH – XPATH of the input element i.e. key XPATH in the BO/BS to be invoked
-
INPUT_VALUE – Input element i.e. key value. This will be used to invoke theBO/BS
Input values can have LITERAL values i.e. static values enclosed in single quotes or the CONSTANT values i.e. ”:BUS_DATE, :BUS_DTTM , :STD_DATE, :STD_DTTM, :SYSDATE, :SYS_DTTM, :CHAR_DATE, :FILENAME, :FILE_ID“ or those configured FIELD names in DATA TRANSFORMATION corresponding to its section i.e. HEADER or FOOTER or FIELD TRANSFORMATION whose mapped value will be referred.
Example:
COPY(BO,CM-TaxRates,CM-TaxRates/lookupValue,true,INPUT[CM-TaxRates/bo=BUS_OBJ_CD,CM-TaxRates/lookupValue=LOOKUPKEY])
PREPROCESS [OPERATION]
This is an optional parameter block. This can be used to perform the required pre-processing and then processing the actual record.
-
OPERATION – This is optional parameter. It can have NULL value. If NULL, then, it will have the operation value that is configured in FRT at service level.
-
INPUT block is mandatory for PREPROCESS and POSTPROCESS. Multiple records can be added or updated using FETCH function in the INPUT block. Same applies to POSTPROCESS.
Example: COPY(BO,C1_PERSON_BO,C1_PERSON_BO/personPerson,INPUT[PARENT_PER_ID=FETCH(PER_RELATION[PER_ID1,null,CHILD_PER_ID,null,null,:BUS_DATE,false])],PREPROCESS[UPD],FILTER[CHILD_PER_ID=CHILD_PER_ID && C1_PERSON_BO/personPerson/endDate='' && C1_PERSON_BO/personPerson/personId1!=PARENT_PER_ID || CHILD_PER_ID=CHILD_PER_ID && C1_PERSON_BO/personPerson/endDate.ISAFTER(:BUS_DATE) && C1_PERSON_BO/personPerson/personId1!=PARENT_PER_ID],UPD[C1_PERSON_BO/personPerson/endDate=END_DATE_UPD])
POSTPROCESS [OPERATION]
It is an optional parameter block. This can be used to perform the required post-processing and then processing the actual record.
-
OPERATION – This is optional parameter. It can have NULL value. If NULL, then, it will have the operation value that is configured in FRT at service level.
FILTER [ELEMENT_XPATH=INPUT_VALUE]
It is an optional parameter block. These can be used if we want to apply filter and get only the specific element value from the possible list of blocks in response XML.
-
ELEMENT_XPATH - XPATH of the filter element i.e. filter key XPATH in the response XML.
-
INPUT_VALUE - Filter condition value i.e. key value. This will be used to filter the value from response XML.
Input values can have LITERAL values i.e. static values enclosed in single quotes or the CONSTANT values i.e. ”:BUS_DATE, :BUS_DTTM , :STD_DATE, :STD_DTTM, :SYSDATE, :SYS_DTTM, :CHAR_DATE, :FILENAME, :FILE_ID“ or those configured FIELD names in DATA TRANSFORMATION corresponding to its section i.e. HEADER or FOOTER or FIELD TRANSFORMATION whose mapped value will be referred.
Filter criteria can be defined using an expression using supported conditional and logical operators.
Example: COPY(BO,C1_PERSON_BO,C1_PERSON_BO/personPerson,INPUT[PARENT_PER_ID=FETCH(PER_RELATION[PER_ID1,null,CHILD_PER_ID,null,null,:BUS_DATE,false])],PREPROCESS[UPD], FILTER [CHILD_PER_ID=CHILD_PER_ID && C1_PERSON_BO/personPerson/endDate='' && C1_PERSON_BO/personPerson/personId1!=PARENT_PER_ID || CHILD_PER_ID=CHILD_PER_ID && C1_PERSON_BO/personPerson/endDate.ISAFTER(:BUS_DATE) && C1_PERSON_BO/personPerson/personId1!=PARENT_PER_ID],UPD[C1_PERSON_BO/personPerson/endDate=END_DATE_UPD])
Equality, Relational, and Conditional Operators
The equality and relational operators determine if one operand is greater than, less than, equal to, or not equal to another operand.
List of Operators:
Operator | Description | Supported Data Type |
---|---|---|
= | Equal to | CHAR, NUMBER |
!= | Not Equal to | CHAR, NUMBER |
< | Less than | NUMBER |
<= | Less than or Equal to | NUMBER |
> | Greater than | NUMBER |
>= | Greater than or Equal to | NUMBER |
ISBEFORE | Less than | DATE |
ISBEFOREOREQUAL | Less than or Equal to | DATE |
ISAFTER | Greater than | DATE |
ISAFTEROREQUAL | Greater than or Equal to | DATE |
ISEQUAL | Equal to | DATE |
ISNOTEQUAL | Not Equal to | DATE |
Logical Operators:
The && and || operators perform Conditional-AND and Conditional-OR operations on two boolean expressions. These operators exhibit "short-circuiting" behavior, which means that the second operand is evaluated only if needed.
List of Logical Operators:
Operator | Description |
&& | AND |
|| | OR |
UPD[ELEMENT_XPATH=INPUT_VALUE]
This is an optional input parameter. These can be used to update the element value in the copied XML block.
Multiple element values can be updated in a copied XML block having the multiple comma-separated element key values.
-
ELEMENT_XPATH - XPATH of the element in the copied XML response for which the value is to be updated.
-
INPUT_VALUE - Input element i.e. key value. This will be used to update the element value in the copied XML block.
Input values can have LITERAL values i.e. static values enclosed in single quotes or the CONSTANT values i.e. ”:BUS_DATE, :BUS_DTTM , :STD_DATE, :STD_DTTM, :SYSDATE, :SYS_DTTM, :CHAR_DATE, :FILENAME, :FILE_ID,:REMOVE,:REMOVE_FLD“ or those configured FIELD names in DATA TRANSFORMATION corresponding to its section i.e. HEADER or FOOTER or FIELD TRANSFORMATION whose mapped value will be referred.
Example: COPY(BO,C1-AccountBO,C1-AccountBO/accountAutopay,FILTER[C1-AccountBO/accountAutopay/endDate=''],UPD[AUTO PAY EXPIRES ON= '2020-12-31',C1-AccountBO/accountAutopay/endDate=AUTO PAY EXPIRY])