Context Object Parameters
Table 1. Business Object Standard Parameters
| Parameter Name |
Type |
Read or Write |
Comments |
EVENT |
String |
Read |
Any of the supported events. |
NAME |
String |
Read |
Business object name |
ORGANIZATION |
String |
Read |
The organization that owns the business object
|
OWNER |
String |
Read |
The owner of the business object |
PHYSICALID |
String |
Read |
The physical ID for the business object |
POLICY |
String |
Read |
The business object policy |
PROJECT |
String |
Read |
The project (collaborative space) that owns the
business object |
REVISION |
String |
Read |
Business object revision |
TYPE |
String |
Read |
Business object type |
Table 2. Additional Parameters for addinterface
| Parameter Name |
Type |
Read or Write |
Comments |
NEWINTERFACE |
String |
Read |
The name of the interface that has been added. |
AuditTags |
List |
Read |
Logging event of the transaction. |
Sample 1: Only Allows Interfaces Named test
In the following sample, the rule allows the addition of an interface only if the interface
name is test. Otherwise, the rule blocks the action and issues an error
message. The trace line provides logging for
debugging.
Let interfaceName(String)
Trace(1, "Execution MyCATRule on ", ThisObject.PLM_ExternalID )
Set interfaceName = Parameters.Macros.GetString("NEWINTERFACE")
if (interfaceName == "test")
Validation = true
else
{
ReportUXMessage("add interface forbidden: " + interfaceName)
Validation = false
}
Sample 2: Only Allows Replacements When Interfaces Are Named
test
In the following sample, the rule uses AuditTags to allow the replacement
of an interface only if the name of the new interface is test. Otherwise,
the rule blocks the action and issues an error message. The trace line provides logging for
debugging.
Let interfaceName(String)
Let lTags(List)
Let aTag(EKLAuditTag)
Let tagName(String)
Validation = false
Trace(1, "Execution MyCATRule on ", ThisObject.PLM_ExternalID )
lTags = Parameters.AuditTags.GetValue(ThisObject)
aTag = lTags.GetItem(1)
if (NULL <> aTag)
{
tagName = aTag.name()
Trace(1, "Tag: " + tagName)
if (tagName == "REPLACE")
{
Set interfaceName = Parameters.Macros.GetString("NEWINTERFACE")
if (interfaceName == "test")
Validation = true
}
}
if (Validation == false)
ReportUXMessage("add interface forbidden: " + interfaceName)