Context Object Parameters
| Parameter Name |
Type |
Read or Write |
Comments |
OperationId |
String |
Read |
The opening ID is invoked only if you specify this operation ID:
ExportWithDelegationAndWaive |
CurrentEditionTokenStatus |
String |
Read |
The current Edit Token Status of the object (for example,
LOCAL). |
Policy |
String |
Read |
The policy of the object. |
NextEditionTokenState |
String |
Write |
The required Edit Token Status for the object after export, to
specify whether delegation or waive is performed during the export. Possible
values depend on the current status of the object :
Current Status (CurrentEditionTokenStatus) |
Required Status After Export
(NextEditionTokenState) |
Operation Performed During the Export |
| LOCAL or EXCHANGED |
DELEGATOR |
Delegation |
| DELEGATED |
FORWARD |
Delegation |
| DELEGATED |
DISTANT |
Waive |
| Keep current status |
NONE |
None |
|
Sample
The following sample explains how to specify whether Delegation or Waive operations are
applied during the export to 3DXML.
- Create a .CATRuleExit file in
resources/knowledge/scripts.<Scripts>
<Script OpeningID="PLMEditionTokenChange" Type="Feature" ScriptName="NotifyObjectsForDelegationWaive">
<Condition Attribute="OperationId" Value="ExportWithDelegationAndWaive"/>
</Script>
</Scripts>
with the following elements:
OpeningID: always PLMEditionTokenExchange
Type: Feature to invoke the business logic for
all object types, or the name of the specific object type you want to call the
business logic for (for example, VPMReference).
ScriptName: The name of the CATRule file implementing the
business logic.
- Condition Attribute="OperationId": always
ExportWithDelegationAndWaive
- Create a .CATRule file containing the details of the business logic in
resources/knowledge/scripts. Name the file according to the
ScriptName element you specified in the .CATRuleExit file (here: NotifyObjectsForDelegationWaive.CATRule).
- To apply a Delegation operation:
Let OperationIdType(string)
Let CurrentEditionTokenStatus(string)
Let vExternalId(string)
Let vV_Name(string)
vExternalId=""
vV_Name=""
OperationIdType = Parameters->GetAttributeString("OperationId")
CurrentEditionTokenStatus = Parameters->GetAttributeString("CurrentEditionTokenStatus")
if( ThisObject->HasAttribute("V_Name") == true )
{
vV_Name = ThisObject->GetAttributeString("V_Name")
}
if( ThisObject->HasAttribute("PLM_ExternalID") == true )
{
vExternalId = ThisObject->GetAttributeString("PLM_ExternalID")
}
if( OperationIdType == "ExportWithDelegationAndWaive" )
{
if((CurrentEditionTokenStatus == "Local"))
{
if(vV_Name == "ChildProduct_001")
{
Parameters->SetAttributeString("NextEditionTokenState","Delegator")
}
else if(vExternalId == "ChildProduct_001.1")
{
Parameters->SetAttributeString("NextEditionTokenState","Delegator")
} }
}
- To apply a Waive operation:
Let OperationIdType(string)
Let CurrentEditionTokenStatus(string)
Let vExternalId(string)
Let vV_Name(string)
vExternalId=""
vV_Name=""
OperationIdType = Parameters->GetAttributeString("OperationId")
CurrentEditionTokenStatus = Parameters->GetAttributeString("CurrentEditionTokenStatus")
if( ThisObject->HasAttribute("V_Name") == true )
{
vV_Name = ThisObject->GetAttributeString("V_Name")
}
if( ThisObject->HasAttribute("PLM_ExternalID") == true )
{
vExternalId = ThisObject->GetAttributeString("PLM_ExternalID")
}
if( OperationIdType == "ExportWithDelegationAndWaive" )
{
if((CurrentEditionTokenStatus == "Delegated"))
{
if(vV_Name == "ChildProduct_002")
{
Parameters->SetAttributeString("NextEditionTokenState","Distant")
}
else if(vExternalId == "ChildProduct_002.1")
{
Parameters->SetAttributeString("NextEditionTokenState","Distant")
} }
}