Context Object Parameters
Parameter Names | Types | Read/Write | Comments |
---|
ThisObject | PLMEntity | Write | This is a PLM proxy object with the same top modeler type and custo type as the PLM entity to create on which attribute valuation is requested. During BatchV4V6 migration, its attributes can be modified by the rule defined in the scripts. |
OperationId | string | Read | Parameter used to identify the context of usage of the BL. Authorized values is: BatchV4V6 for BatchV4V6 migration command only for the moment. |
IdString | string | Read | Parameter used to pre-evaluate the identifier attribute. This information comes from UI (Tools>Options). Can be interpreted as a prefix for instance. May be not used by the Business Logic. |
OriginalRepRefPropertiesModel | PLMEntity | Read | Parameter valuated when OperationId="BatchV4V6" . This parameter is used to retrieve the list of the attributes of the original representation reference with the V4 model to migrate inside. The content of this list depends on the modeller type to which the proxy (OriginalRepRefPropertiesModel ) belongs. |
MigrationProperties | feature | Read | Parameter valuated when OperationId="BatchV4V6" . This parameter is used to retrieve the list of user’s migration properties. In the list, there are two kinds of information. First, is the information about the migration option like migration structure option, the proposed name of the new component, the second kind of information are about the V4 entity properties like, from which V4 model, from which Workspace etc. |
Policy | String | Read | Policy name. |
Note:
If PLMMigrationAttributesValuation
is available, a deployment extension can be added by BL. If BL is not available a default extension will be added to proxy. The modeler explicit-factory creates the component using the proxy..
Sample
The following sample shows how to:
- Initialize the naming of a Representation Reference from the proposed
name in
MigrationProperties
feature. (V_Name
attribute is suffixed by a time stamp) - Initialize the description attribute of a Reference from the migration structure
option in
OriginalRepRefPropertiesModel
PLMEntity. - Add deployment extension
DeploymentExt1
. This is an example, please verify the actual extension(s) available.
To achieve this particular business logic implementation, a CATRuleExit file,
known as family, declares the script to run each time a BatchV4V6
command is started:
<Scripts>
<Script OpeningID="PLMMigrationAttributesValuation"
Type="VPMReference"
ScriptName="MigrationAttributesValuation_Reference">
<Condition Attribute="OperationId" Value="BatchV4V6" />
</Script>
<Script OpeningID="PLMMigrationAttributesValuation"
Type="VPMRepReference"
ScriptName="MigrationAttributesValuation_RepReference">
<Condition Attribute="OperationId" Value=" BatchV4V6" />
<Script OpeningID="PLMMigrationAttributesValuation"
Type="VPMReference"
ScriptName="MigrationAttributesValuation_Reference_DExt">
<Condition Attribute="OperationId" Value=" BatchV4V6" />
</Scripts>
This family references the script that contains the business logic implementation,
which looks like the following CATRule
file:
MigrationAttributesValuation_RepReference.CATRule
: The script is based on a user knowledge package which provides a function DateFormat
to get a time stamp.
Let MigrPropFeat(PLMEntity)
Let Name(string)
if(Parameters->HasAttribute("MigrationProperties")== true)
{
MigrPropFeat = Parameters->GetAttributeObject("MigrationProperties")
if(MigrPropFeat <>NULL and MigrPropFeat->HasAttribute("ProposedName") == true)
Name = MigrPropFeat->GetAttributeString("ProposedName")
else
Name = “No name proposed!”
}
if(Name <> "")
{
if ( ThisObject->HasAttribute("V_Name") == true )
ThisObject.V_Name= Name + "_" + DateFormat("%Y-%m-%d_%Hh%M")
}
MigrationAttributesValuation_Reference.CATRule
:
Let OriginalRefRef(PLMEntity)
Let Discription(string)
if(Parameters->HasAttribute("OriginalRepRefPropertiesModel")== true)
{
OriginalRefRef = Parameters->GetAttributeObject("OriginalRepRefPropertiesModel")
if(OriginalRefRef<>NULL and OriginalRefRef->HasAttribute("OptionStructration ") == true)
Discription = OriginalRefRef->GetAttributeString("OptionStructration")
else
Discription = “Error, no structraion option!”
}
if(Discription <> "")
{
if ( ThisObject->HasAttribute("V_description") == true )
ThisObject->SetAttributeString("V_description",Description)
}
MigrationAttributesValuation_Reference_DExt.CATRule
:
Let DExt (string)
DExt = “DeploymentExt1”
ThisObject->AddExtension("DICIRPC2Deployment")
Recommendations
Before using an input parameter, you have to check its value.
For example, to check if the OperationId
parameter is valuated or not, use the following code sequence:
...
if (Parameters->HasAttribute("OperationId")== true)
OPId = Parameters->GetAttributeString("OperationId")
if(OPId <> "")
{
...
A typical usage of the IdString
parameter is to interpret it as a prefix.