All product information in wiki.bizagi.com is only valid for Bizagi BPM Suite 9.1.X.
For newer Bizagi BPM Suite versions (10.X and up) please visit the User Guide.
 

RemoveRelation

From Business Process Management, BPM and Workflow Automation Wiki | BizAgi BPMS

Jump to: navigation, search

<keywords content="keywords"> remove, removerelation, remove relation, adddeletedentities </keywords>

removeRelation

The removeRelation function allows deletion of elements from a relationship and also to determine if these elements must be deleted from the database. Here is the syntax:


Me.removeRelation(xpath, del);

Me.Context.removeRelation(xpath, del);


xpath: Indicates the XPath of the element, or elements, to be removed.

del: Specifies if the element should be deleted or not from the database. If it is True the element will be eliminated from the relationship and from the DB; if it is False it will be removed from the relationship, but still exist in the DB.

Example

Here are different combinations and their corresponding result. All examples are based on this data model:

In this model there is a collection, that is a one-to-may relationship (or FACT) named Guarantees between the Business Entity CreditRequest and RequestGuarantees. In RequestGuarantees exists a Boolean attribute, Constituted, used to mark the constituted guarantees.


Example
Result
Me.removeRelation(“CreditRequest.Guarantees”, true);
Removes all elements from the relationship and also from the DB.
Me.removeRelation(“CreditRequest.Guarantees[Constituted=true]”, true);
Removes all constituted guarantees from the relationship Guarantees and deletes these records from the DB.
Me.removeRelation(“CreditRequest.Guarantees[Constituted=false]”, false);
Removes all not constituted guarantees from the relationship but not the records from the DB.
This will allow associating these guarantees to another credit.


Deletion using NULL

Earlier version of Bizagi supported removing relationships using an expression like this:

<xpath> = null;

This now is deprecated and should not be used; this expression must be replaced with a removeRelation instruction.

<comments />