You specify constraints and validation tests in Majic using the object definition metalanguage.
Note: For information, see the Technical Reference Guide.
Constraints defined in Majic closely resemble an SQL WHERE clause, with the following exceptions:
@root.att_name
For example, specifying @root.location refers to the location ID of the current contact.
You specify joins with a specification of the following form, where foreign-key is the Majic name of the SREL attribute in the table for which you are writing the data partition constraint, and attribute-in-referenced-table is the Majic name of the attribute in the table being joined:
foreign-key.attribute-in-referenced-table
For example, to refer to the maintenance vendor of the asset associated with an incident report, specify the following:
resource.vendor_repair
This specification is recursive. For example, you could refer to the name of the vendor with the following:
resource.vendor_repair.name
The following table contains examples of valid constraints to use for the Change_Request table, used to store change order information:
Constraint Type |
Code and Description |
View |
assignee.organization = @root.organization Specifies the user can only view change orders where the assignee’s organization is the same as the user’s organization. |
Pre-Update |
requestor = @root.id Specifies the user can only update the change orders where he is the caller or requester. |
However, you cannot write a constraint that uses joins on both sides of the expression, as shown in the following example:
assignee.org = requestor.org
Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |