How to Implement the PLMAuthoringDefaultPropagationScope business logic?

Technical Article

Abstract

This article details how you can implement the PLMAuthoringDefaultPropagationScope Business Logic based on the knowledge scripting technology.

Business Logic Intent

The PLMAuthoringDefaultPropagationScope Business Logic (BL) allows you to define if an operation could be applied on a data according a context. This BL is integrated in "advanced duplicate" command.

Advanced duplicate behavior according BL execution:

The PLMAuthoringDefaultPropagationScope business logic enables customer to specify if a data needs to be duplicated or reinstantiated. The reference is duplicated if the BL execution return true otherwise the reference is reinstanciated.

PLM Opening Definition

This section describes the objects defining the PLM opening: its global information, its kind of input objects, its context object parameters.

General Information

PLM Opening ID PLMAuthoringDefaultPropagationScope
Customization Intent Computation
Execution Context Client

Input Objects

The Business Logic can be invoked for at least the listed PLM Component types. It means that your implementation can safely use the PLM attributes of the default PLM Component.

PLM Component Class Types
PLMCoreReference
PLMCoreRepReference

Since the knowledge scripting technology supports inheritance, the actual component type may be any type that derives from this PLM core type. Hence additional attributes defined by the inheriting types may be accessed depending on the operation context.

Context Object Parameters

Parameter Names Types Read/Write Comments
OperationId string Read Parameter used to identify the context execution . Only "Cloning" value is vavailable:
  • "Cloning" for any duplication operation. Look at the dedicated OperationDetail for details.
OperationDetail string Read

For OperationId = "Cloning", the possible OperationDetail values are:

  • "None" for Advanced duplicate operation.
  • "WorkspaceCreation" for workspace creation.
 RootContext PLMCoreReference Read Context of operation
Propagate boolean Write Result of BL execution to say if operation should be propagated or not.

Implementation Sample

Let's implement the following rule: the duplication of an object whose PLM type is MySampleType is allowed if data project is the same as the root context.

The figure hereafter illustrates both conclusive situations:

To achieve this particular Business Logic implementation, a CATRuleExit file, known as family, declares the script to run everytime the advanced duplication is launched on a PLM reference whose PLM type is MySampleType:

<Scripts>
    <Script OpeningID="PLMAuthoringDefaultPropagationScope"
            Type="MySampleType"
            ScriptName="MyDuplicationCheckRule" />
</Scripts>

This family tells to run the script MyDuplicationCheckRule whenever the 'Advanced duplicate' operations are launched on a PLM object whose PLM type is MySampleType. This script is a

 

 Let RootContext(PLMProductDS)
Let ProjectIntent(STRING)
Let ProjectObject(STRING)

ProjectIntent=""

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)
}
   

CATRule file that contains the following Business Logic implementation:

Since this is a check purpose Business Logic, the Validation variable must be valuated during the script execution to return the check result.

Recommendations

None

References

History

Version: 1 [June 2009] Document created