Question


Tata Consultancy Services
IN
Last activity: 25 Jun 2024 4:47 EDT
What are Append,Current,Insert and prepend.
How we can use APPEND, CURRENT, INSERT, LAST, and PREPEND ?
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 25 Jun 2024 3:43 EDT


Eclatprime Digital Private Limited
IN
@MonikaS9010 Hi , You can visit this link to know more about the Pega append and other details . symbiolic index pega


Maantic Inc
IN
These keywords are used on indexes of aggregate properties:
APPEND: To add an element to the end (highest index value) a Value List
or Page List
property, use the <APPEND>
index keyword: .Months(<APPEND>)
CURRENT: The use of the <CURRENT>
keyword differs depending on where it is used.
Activities and data transforms
When <CURRENT> is used as a subscript rather than a standalone reference, the following apply.
These keywords are used on indexes of aggregate properties:
APPEND: To add an element to the end (highest index value) a Value List
or Page List
property, use the <APPEND>
index keyword: .Months(<APPEND>)
CURRENT: The use of the <CURRENT>
keyword differs depending on where it is used.
Activities and data transforms
When <CURRENT> is used as a subscript rather than a standalone reference, the following apply.
<CURRENT>
can be used within a repeat block to refer to the current repeat element.- For a repeat type of For Each Embedded List, <CURRENT> refers to the
ClipboardPage
of the current iteration: for example, when used in an RUF call that takes aClipboardPage
parameter or on the right side of a property set when the target is a page (when you add to a page list using.list(<append>)
). <CURRENT>
can be used within the precondition and transition elements of a step that also includes a repeat element to evaluate the current element of the repeat block.- Within a nested step that does not have a repeat element,
<CURRENT>
inherits the semantics of its parent step that does have a repeat element. <CURRENT>
can appear in the Expression Builder for the Target field of a Property-Set (within a repeat block); the keyword will refer to the current element’s property so that it can receive the new value.- For the Property-Set-Messages activity method,
<CURRENT>
is equivalent to myStepPage. <CURRENT>
can appear in the Expression Builder for the Source field of the Property-Ref activity method.
When <CURRENT> is used as a index or superscript, the index of the current element of a For Each Element in a Value List or For Each Element in a Value Group or For Each Embedded Page.
Parameters in Rule-Utility-Function
<CURRENT>
cannot be used with a formal parameter of ClipboardProperty.<CURRENT>
can be used with a formal parameter of ClipboardPage to pass the current clipboard page of an iteration over (embedded) pages<CURRENT>
can be used with a formal parameter of typeString
to pass the current value of a scalar property when iterating over a value list or group or the subscript of the current iteration element.
ClipboardProperty references
- Using the keyword
<PARENT>
or<TOP>
with the<CURRENT>
keyword is especially useful in, but not limited to, declarative rules, such as Rule-Declare-Expression. - You can use
<CURRENT>
in declarative rules (specifically when there is a declarative target present).
INSERT: Use the <INSERT>
keyword followed by an integer to insert a new element and its value into a Value List
or Page List
property at a numeric index position. Any elements with the same or higher index value are "pushed down" by one: .Months(<INSERT>>2),.Months(<INSERT>MyPage.myCounter
LAST: To set or retrieve an element value from the end (highest index value) of a Value List
or Page List
property, use the <LAST>
index keyword: .Months(<LAST>)
PREPEND: Use the <PREPEND>
keyword to insert a new element and its value into a Value List
or Page List
property as the first element. All existing elements are "pushed down" by one.
This keyword can only be used in target property references, not expressions.
This keyword can be used only as a index or superscript.


Infosys
IN
The keywords APPEND, CURRENT, INSERT, LAST, and PREPEND are used for manipulating value lists and value groups.
APPEND: Adds a new element to the end of a value list or value group. Value List: When working with a value list, APPEND adds a new item at the end of the list. Value Group: When working with a value group, APPEND is used to add a new keyed element. Example: PropertyName(<APPEND>) = "NewValue"
CURRENT: Refers to the current element in a loop when iterating through a value list or value group. Typically used in a loop context to refer to the current item being processed. Example: For each embedded page in .PageList: .PageList(<CURRENT>) = "UpdatedValue"
INSERT: Inserts a new element at a specific position in a value list. Value List: Inserts an item at the specified index. Existing items are shifted to accommodate the new item. Value Group: Not commonly used with value groups since they are typically keyed collections. Example: PropertyName(<INSERT>, 2) = "InsertedValue"
The keywords APPEND, CURRENT, INSERT, LAST, and PREPEND are used for manipulating value lists and value groups.
APPEND: Adds a new element to the end of a value list or value group. Value List: When working with a value list, APPEND adds a new item at the end of the list. Value Group: When working with a value group, APPEND is used to add a new keyed element. Example: PropertyName(<APPEND>) = "NewValue"
CURRENT: Refers to the current element in a loop when iterating through a value list or value group. Typically used in a loop context to refer to the current item being processed. Example: For each embedded page in .PageList: .PageList(<CURRENT>) = "UpdatedValue"
INSERT: Inserts a new element at a specific position in a value list. Value List: Inserts an item at the specified index. Existing items are shifted to accommodate the new item. Value Group: Not commonly used with value groups since they are typically keyed collections. Example: PropertyName(<INSERT>, 2) = "InsertedValue"
LAST: Refers to the last element of a value list or value group. Can be used to access or modify the last item in a collection. Example: PropertyName(<LAST>) = "LastValue"
PREPEND: Adds a new element to the beginning of a value list or value group. Value List: Adds an item at the start of the list, shifting existing items down. Value Group: Similar to APPEND but adds the new item at the beginning. Example: PropertyName(<PREPEND>) = "FirstValue"
Regards,
Sai G
Accepted Solution
Updated: 25 Jun 2024 3:43 EDT


Eclatprime Digital Private Limited
IN
@MonikaS9010 Hi , You can visit this link to know more about the Pega append and other details . symbiolic index pega


Ernst & Young
MT
Append : Will add the page to the existing pages .
Example : If we are having EmployeeList having 2 pages and if you use Append it will 3rd Page Employee List.
CURRENT : If you are looping the pagelist Employee List and if you want to set Name of the current loop value then go for this.
LAST : In the same page if you want to add another property we will go for Last
Example : EmployeeList(<APPEND>).Name - Will add the new page to existing page (EmployeeList(3)-New Page) EmployeeList(<LAST>).Age - On same page will add age property (EmployeeList(3)-New Field in the same Page)
PREPEND : Will add page before the existing List .
Example: If we are having employee(2) but you want to add the Employee (1) Page .
INSERT : Value List: Inserts an item at the specified index. Existing items are shifted to accommodate the new item.


Eclatprime Digital Private Limited
IN
These keywords are used on indexes of aggregate properties:
APPEND: To add an element to the end (highest index value) a Value List
or Page List
property, use the <APPEND>
index keyword: .Months(<APPEND>)
CURRENT: The use of the <CURRENT>
keyword differs depending on where it is used.
Activities and data transforms
When <CURRENT> is used as a subscript rather than a standalone reference, the following apply.
These keywords are used on indexes of aggregate properties:
APPEND: To add an element to the end (highest index value) a Value List
or Page List
property, use the <APPEND>
index keyword: .Months(<APPEND>)
CURRENT: The use of the <CURRENT>
keyword differs depending on where it is used.
Activities and data transforms
When <CURRENT> is used as a subscript rather than a standalone reference, the following apply.
<CURRENT>
can be used within a repeat block to refer to the current repeat element.- For a repeat type of For Each Embedded List, <CURRENT> refers to the
ClipboardPage
of the current iteration: for example, when used in an RUF call that takes aClipboardPage
parameter or on the right side of a property set when the target is a page (when you add to a page list using.list(<append>)
). <CURRENT>
can be used within the precondition and transition elements of a step that also includes a repeat element to evaluate the current element of the repeat block.- Within a nested step that does not have a repeat element,
<CURRENT>
inherits the semantics of its parent step that does have a repeat element. <CURRENT>
can appear in the Expression Builder for the Target field of a Property-Set (within a repeat block); the keyword will refer to the current element’s property so that it can receive the new value.- For the Property-Set-Messages activity method,
<CURRENT>
is equivalent to myStepPage. <CURRENT>
can appear in the Expression Builder for the Source field of the Property-Ref activity method.
When <CURRENT> is used as a index or superscript, the index of the current element of a For Each Element in a Value List or For Each Element in a Value Group or For Each Embedded Page.
Parameters in Rule-Utility-Function
<CURRENT>
cannot be used with a formal parameter of ClipboardProperty.<CURRENT>
can be used with a formal parameter of ClipboardPage to pass the current clipboard page of an iteration over (embedded) pages<CURRENT>
can be used with a formal parameter of typeString
to pass the current value of a scalar property when iterating over a value list or group or the subscript of the current iteration element.
ClipboardProperty references
- Using the keyword
<PARENT>
or<TOP>
with the<CURRENT>
keyword is especially useful in, but not limited to, declarative rules, such as Rule-Declare-Expression. - You can use
<CURRENT>
in declarative rules (specifically when there is a declarative target present).
INSERT: Use the <INSERT>
keyword followed by an integer to insert a new element and its value into a Value List
or Page List
property at a numeric index position. Any elements with the same or higher index value are "pushed down" by one: .Months(<INSERT>>2),.Months(<INSERT>MyPage.myCounter
LAST: To set or retrieve an element value from the end (highest index value) of a Value List
or Page List
property, use the <LAST>
index keyword: .Months(<LAST>)
PREPEND: Use the <PREPEND>
keyword to insert a new element and its value into a Value List
or Page List
property as the first element. All existing elements are "pushed down" by one.
This keyword can only be used in target property references, not expressions.
This keyword can be used only as a index or superscript.