Collection Functions

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Process wizard > Business Rules > Bizagi Functions > Data Access through XPath > XPath Functions >

Collection Functions

FUNCTION

DESCRIPTION

SYNTAX

New collection item

 

Allows the inclusion of a new item (record) to a collection. The item is initially included as a blank entry. You can assign a variable to set values to the new record.

Me.newCollectionItem("XPath")

 

The XPath must be a collection

Attach collection item

Allows to attach ONE item (record) from one collection to another collection. The item is not duplicated, it is shared by both collections.

Both collections must belong (be related) to the same entity.

Me.attachCollectionItem("XPath", item)

 

The XPath must be the collection that will receive the item.

The item is the XPath of the record that will be attached.

Attach collection items

Allows to attach one or more items (records)  from one collection to another collection. The items are not duplicated, they are shared by both collections.

Both collections must belong (be related) to the same entity.

Me.attachCollectionItems("XPath", items)

 

The XPath must be the collection that will receive the items.

The items are the Xpaths of the records that will be attached.

Detach collection item

Allows detaching (disconnecting) ONE item (record) from a collection. The item will no longer be a part of the collection but it will not be deleted from the database.  

 

Me.detachCollectionItem("XPath", item)

 

The XPath must be the collection that will lose the item.

The item is the XPath of the record that will be detached.

Detach collection items

Allows detaching (disconnecting) one or more items (records) from a collection. The items will no longer be a part of the collection but they will not be deleted from the database.  

Me.detachCollectionItems("XPath", items)

 

The XPath must be the collection that will lose the items.

The items are the Xpaths of the records that will be detached.

Detach all collection items

Allows detaching (disconnecting) ALL items (records) from a collection. The items will no longer be a part of the collection but they will not be deleted from the database.  

Me.detachAllCollectionItems("XPath")

 

The XPath must be the collection that will lose the items.

Delete one collection item

Allows the complete deletion of ONE item (record) of a collection. The item will be deleted from the collection and from the database.

Me.deleteCollectionItem("XPath", item)

 

The XPath must be a collection, and the item ONE record of the collection. This item must be ONE and only ONE. If not, the function will fail.

Delete collection items

Allows the complete deletion of one or more items (records) of a collection. The items will be deleted from the collection and from the database.

Me.deleteCollectionItems("XPath", item)

 

The XPath must be a collection, and the items one or more records of the collection

Delete all collection items

Allows the complete deletion of ALL items (records) of a collection. The items will be deleted from the collection and from the database.

Me.deleteAllCollectionItems("XPath")

 

The XPath must be a collection.

Distinct-values

Returns the a list (not a collection) with non repeated values of a specific attribute, from a collection. It is necessary to indicate the attribute to find the distinct values from. The list with the non repeated values will be entries of this attribute.

<distinct-values(XPath)>

The XPath must be a collection, that navigates util reaching an attribute of the collection that can be used to find non repeated values.

Get value as collection

Transforms a list of values stored as a text chain into an array list. In some cases it is necessary to handle Collections in expressions without using the Iterate over XPath functionality to allow a complete manipulation of the code.

CHelper.GetValueAsCollection(<XPath>)

 

The XPath must be a collection

Sort

Sorts the records of a collection in ascending order according to an attribute. It is possible to sort using an integer, float, date or string attribute. The method receives a collection, and returns the collection sorted by the attribute’s value.

<sort(XPath,'attribute')>;

 

The XPath must be a collection


Last Updated 1/6/2022 11:33:56 AM