Context Object Parameters
Parameter Names |
Types | Read/Write | Comments |
---|
OperationId |
String | Read |
Parameter used to identify the context execution. Available values are:
- "
Cloning " for Duplicate, Advanced Duplicate, or New
Branch operations.
- "
Delete " for Delete operation.
For more information, see the OperationDetail row
below. |
OperationDetail |
String | Read |
For OperationId = "Cloning" , the possible OperationDetail
values are:
- "
None " for Duplicate operation.
- "
None " for Advanced Duplicate operation.
- "
NewEvolution " for New Branch operation.
For OperationId = "Delete" , the possible OperationDetail value is “None”.
|
RootContext | PLMCoreReference | Read | For each object, the parent of the highest level among the selected
objects. |
Propagate | Boolean | Write | The result of opening ID execution. If true ,
the object is copied or deleted. If false , the object is kept
(reused, or not deleted). |
Policy | String | Read | Policy name. |
Sample
The following sample shows how to implement the copying or deletion of an object whose type is
MySampleType
is allowed if the content collaborative space is the same as
the root context. To achieve this particular Business Logic implementation, a
CATRuleExit
file, known as family, declares the script to run each time
the advanced duplication or delete is launched on a reference whose type is
MySampleType
:
<Scripts>
<Script OpeningID="PLMAuthoringDefaultPropagationScope"
Type="MySampleType"
ScriptName="MyPropagationCheckRule" />
</Scripts>
This family tells to run the script MyPropagationCheckRule
whenever the Duplicate Advanced or Delete operations are launched on an object whose type is MySampleType
.
Let RootContext(STRING)
Let ProjectIntent(STRING)
Let ProjectObject(STRING)
Let OperationId(STRING)
Let OperationDetail(STRING)
ProjectIntent=""
OperationId=Parameters->GetAttributeString("OperationId")
OperationDetail =Parameters->GetAttributeString("OperationDetail")
if OperationId =="Cloning" and OperationDetail =="None"
{
if ( Parameters->HasAttribute("RootContext") == true ) {
set RootContext=Parameters->GetAttributeObject("RootContext")
}
if ( RootContext<>NULL)
{
if ( RootContext->HasAttribute("V_project") ==true )
{
ProjectIntent=RootContext->GetAttributeString("V_project")
}
}
ProjectObject=ThisObject.V_project
if ( ProjectObject <> ProjectIntent )
{
Parameters->SetAttributeBoolean("Propagate",false)
}
else
{
Parameters->SetAttributeBoolean("Propagate",true)
}else
{
Parameters->SetAttributeBoolean("Propagate",true)
}