MaintainComments
MaintainComments rule allow a copy-to functionality to update the entity comments. CopyToCommentsFields are used for this purpose. Specify the target entity in the rule. OIPA creates the comment in an object array, so the entity gets defined in the math when the comment object is initiated.
COMMENTS, STATUSCODE, and all dynamic fields are updatable. GUIDS and system-generated fields are not updatable.
| Element/Tag | Parent Element | Attributes | Description | Element/Attribute Values |
|---|---|---|---|---|
|
<MaintainComments> |
|
Required: The opening and closing elements of the business rule. |
||
|
<CopyToCommentsFields> |
<MaintainComments> |
|
Required: This element identifies the comment and field to update with its new value. |
|
|
<Fields> |
<CopyToCommentsFields> |
|
Required: This element contains collection of fields to update with their new data. |
|
|
<Field> |
<Fields> |
|
Required, Repeatable: This element identifies a single field to update with it's new data. |
|
|
<FromCollection> |
<Field> |
|
Required: This element references a Math Variable that contains a collection of key/value pairs, where CommentGUIDs are the keys, and updated data are the values for the Comment fields to be updated. |
MathVariable |
| <To> | <Field> |
Required: This element is the name of the field, that to be updated with the data in the collection. |
Literal | |
| <OptionTextCollection> | <Field> |
Optional element: Specifies a collection of key-value pairs, where the key is an Entity GUID and the value is a supported value for the OPTIONTEXT for field defined in the <To> element. This element can only be paired with the <FromCollection> element. Note: This element and the <OptionText> element are mutually exclusive. This element is also mutually exclusive with the <From> element. |
MathVariable | |
| <OptionText> | <Field> |
Optional element: Identifies the source of the data that will update the OptionText for the field defined in the <To> element. Note: This element and the <OptionTextCollection> element are mutually exclusive. |
MathVariable |
XML Schema
<MaintainComments>
<CopyToCommentsFields TYPE="[code value]" GUID="[guid]">
<Fields>
<Field>
<FromCollection>[collection]</FromCollection>
<To>[field name]</To>
<OptionTextCollection>[MathVariable]</OptionTextCollection>
</Field>
<Field>...</Field>
</Fields>
</CopyToCommentsFields>
</MaintainComments>
XML Examples
MaintainComments with Single Comments
<MaintainComments COMMENTSGUID="CommentsGUIDMV">
<CopyToCommentsFields>
<Fields>
<Field>
<From>Activity:Comments</From>
<To>Comments</To>
<OptionText>CommentsOptionText</OptionText>
</Field>
</Fields>
</CopyToCommentsFields>
</MaintainComments>
MaintainComments with multiple Comments (the Comments are defined in the collections as a key-value pair)
<MaintainComments>
<CopyToCommentsFields>
<Fields>
<Field>
<FromCollection>NewCommentsCollection</From>
<To>Comments</To>
<OptionTextCollection>NewCommentsCollectionOptionText</OptionTextCollection>
</Field>
</Fields>
</CopyToCommentsFields>
</MaintainComments>
Example 2
<MaintainComments>
<CopyToCommentsFields>
<Fields>
<Field>
<FromCollection>NewCommentsCollection</From>
<To>Status</To>
</Field>
</Fields>
</CopyToCommentsFields>
</MaintainComments>
Example configuration to create a collection in an activity
<MathVariable VARIABLENAME="NewCommentsCollection" TYPE="COLLECTION" OPERATION="CREATE" DATATYPE="MAP"></MathVariable>
<MathVariable VARIABLENAME="NewCommentsCollection" TYPE="COLLECTION" OPERATION="SETVALUE" DATATYPE="TEXT" KEY="NewCommentsGUID1">NewCommentsMV</MathVariable>
<MathVariable VARIABLENAME="NewCommentsCollection" TYPE="COLLECTION" OPERATION="SETVALUE" DATATYPE="TEXT" KEY="NewCommentsGUID1">NewCommentsMV</MathVariable>