skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : Replace element(s)
 

Try Corticon Now

Replace element(s)

SYNTAX

<Collection1> = <Collection2>
<Collection> = <Entity>

DESCRIPTION

Replaces all elements in <Collection1> with the elements in <Collection2>, provided the association between the two is permitted by the Business Vocabulary. In the second syntax, <Entity> is associated with <Collection>, replacing the <Entity> already associated, when the association between the two is one-to-one in the Business Vocabulary. All collections must be expressed as unique aliases.

USAGE RESTRICTIONS

The Operators row in the table of Summary Table of Vocabulary Usage Restriction does not apply. Special exceptions: replace elements may only be used in Action Rows (section 5 in Sections of Rulesheet that correlate with usage restrictions).

RULESHEET EXAMPLE

This sample Rulesheet uses the replace element operator to add Entity3 to collection1 if its boolean1 value is true. Note the use of unique alias collection1 to represent the collection of Entity3 elements associated with Entity2. Recall from the generic Business Vocabulary, shown in Vocabulary used in this Language Guide, that the association between Entity2 and Entity3 has a cardinality of one-to-one. This means that if multiple Entity3 are present, only one will be added to collection1.

SAMPLE TEST

Four sample tests provide scenarios of two elements which share a one-to-one association. Input and Output panels are illustrated below: