GenerateComments
Attach GenerateComments rule to any level activity (Plan/Policy/Client) to add comments to any entity. The ObjectArray defined in transaction math contains all of the field data for the comment, and the target entity for the comment.
Some system generated fixed fields can be available in the transaction math. Identify those fixed fields, which values you can not override (Such as: UpdatedGMT, UpdatedBy, CreatedGMT, CreatedBy, any auto generated GUID).
A BigText field in Activity allows you to draft the comments and passes that into the comment object in Math. BigText data types are saved as CLOB in the DB but they are limited to 4000 characters. The comment text is Varchar2 also set to 4000 characters.
| Element/Tag | Attributes | Parent Element | Description | Element/Attribute Values |
|---|---|---|---|---|
|
<GenerateComments> |
|
Required: The opening and closing elements of the business rule. |
||
|
<GenerateComment> |
|
<GenerateComments> |
Required, Repeatable: This element defines the comment to add to an entity. |
|
|
|
TYPE |
<GenerateComment> |
Required: The attribute defines the entity to add comments. It can be a literal, code value or a math variable that contains a code value. The appropriate code values are derived from AsCodeEntity. |
Code Value |
|
|
GUID |
<GenerateComment> |
Required: The attribute provides the entity’s GUID to add comments. It is a math variablecontaining GUID value. |
Guide |
|
<CommentsArray> |
|
<GenerateComment> |
Required: This element references a math variable of data type TextArea. The variables content is the comment’s text. |
Math Variable |
XML Schema
<GenerateComments>
<GenerateComment TYPE="[code value]" GUID="[guid]">
<CommentsArray>[Math variable]</CommentsArray>
</GenerateComment>
<GenerateComment>...</GenerateComment>
</GenerateComments>
XML Examples
Configuration to geneate a Single Comment
<GenerateComments>
<GenerateComment TYPE="ENTITYMV" GUID="ENTITYGUIDMV">
<CommentsArray>CommentsArray</CommentsArray>
</GenerateComment>
</GenerateComments>
Configuration to generate Multiple Comments
<GenerateComments TYPE="ENTITYMV" GUID="ENTITYGUIDMV">
<CommentsArray>CommentsArray</CommentsArray>
</GenerateComments>
Example conguration to generate comments by a transaction
<MathVariable VARIABLENAME="CommentsArray" TYPE="OBJECTARRAY" OPERATION="CREATE" DATATYPE="OBJECT">0</MathVariable>
<MathVariable VARIABLENAME="CommentsIterations" TYPE="VALUE" DATATYPE="INTEGER">1</MathVariable>
-loop through to create the number of comments
<MathLoop VARIABLENAME="CommentsLoop" TYPE="FOR" ITERATIONS="CommentsIterations">
<MathVariable VARIABLENAME="CommentObject" TYPE="OBJECT" OBJECTNAME="CommentMV" OPERATION="CREATE" DATATYPE="OBJECT"></MathVariable>
<MathVariable VARIABLENAME="CommentObject" TYPE="OBJECT" OPERATION="SETVALUE" FIELDNAME="Comments" DATATYPE="TEXT">Activity:Comments</MathVariable>
<MathVariable VARIABLENAME="CommentObject" TYPE="OBJECT" OPERATION="SETVALUE" FIELDNAME="Hidden" DATATYPE="TEXT">'N'</MathVariable>
<MathVariable VARIABLENAME="CommentObject" TYPE="OBJECT" OPERATION="SETVALUE" FIELDNAME="HiddenCommentReason" DATATYPE="TEXT">'Y'</MathVariable>
<MathVariable VARIABLENAME="CommentObject" TYPE="OBJECT" OPERATION="SETVALUE" FIELDNAME="PolicyCommentField" DATATYPE="TEXT">Activity:PolicyCommentField</MathVariable>
<MathVariable VARIABLENAME="CommentObject" TYPE="OBJECT" OPERATION="SETVALUE" FIELDNAME="Category" DATATYPE="TEXT">Activity:Category</MathVariable>
<MathVariable VARIABLENAME="CommentObject" TYPE="OBJECT" OPERATION="SETVALUE" FIELDNAME="FunctionalDepartment" DATATYPE="TEXT">Activity:FunctionalDept</MathVariable>
<MathVariable VARIABLENAME="CommentsArray" TYPE="OBJECTARRAY" OPERATION="APPEND" SOURCEARRAY="CommentsArray" DATATYPE="OBJECT">CommentObject</MathVariable>
</MathLoop>