Environment: On premises only
Context Object Parameters
| Parameter Name |
Type |
Read/Write |
Comments |
PossiblePolicies |
List |
Read |
Not currently used. Systematically empty. |
OtherPolicies |
List |
Write |
Not currently used. List of other authorized policies for
ThisObject type. |
OperationId |
String |
Read |
Import (in the case of an import) or Default (in other
cases). |
AggregatingReference |
BusinessType |
Read |
Contains the aggregated reference if any. If the object is
created without aggregator, it will be empty. |
IsAggregated |
Boolean |
Read |
Is true if the object is aggregated and false if it is not. This
parameter can be used as a criterion in the Data Setup
app. Using the criterion, it is easy to choose
different policies based on the fact that the object is created aggregated or
not. |
Two input parameters are good indicators for knowing if an object is aggregated or not.
|
AggregatingReference |
IsAggregated |
| Independent object (not aggregated) |
NULL |
false |
| Aggregated object |
Aggregating object |
true |
As the
IsAggregated input parameter is a criterion, you can simply
associate two different business rules in Data Set Up Application depending on the value of
this parameter.
Sample 1: Computing the Policy on a Type
Parameters->SetAttributeString("PolicyName","DefinitionPolicy")
Sample 2: Computing the Policy on an Extension Type
In output of the rule, the objective is to compute the name of the policy to assign to the
object.
Parameters->SetAttributeString("PolicyName","PolicyRef1")
Sample 3: Computing the Policy at Import
When importing particular objects (from a briefcase), the same business rule opening is
used. The difference is that the parameter OperationId that is available on
the Parameters of the business rule is valuated with “Import” as opposed to “Default”. In
the content of the rule, for particular objects, you will be able to access the attribute
values of the
object
Parameters->SetAttributeString("PolicyName","PolicyRefDoc1")
if (Parameters->GetAttributeString("OperationId") == "Import" and ThisObject."Is Version Object"=="True")
{
Parameters->SetAttributeString("PolicyName","PolicyRefDoc2")
}
Note:
Few objects support this behavior by default. The business rules are triggered on the
type and not on the object. The object of DOCUMENTS type support this
behavior.
Sample 4: Policy choice based on the fact that the object is aggregated or not
- A server where two policies are defined on the “PlmParameter” type: PolicyRef1 and
PolicyRef2
-
- Create a business rule that computes the policy for a PlmParameter:
Parameters->SetAttributeString("PolicyName","PolicyRef2").
- Associate this business rule to the
INFRAAuthorizedPolicies opening for the type PlmParameter
under the condition that
IsAggregated=true.
- Create a business rule that computes the policy for a PlmParameter:
Parameters->SetAttributeString("PolicyName","PolicyRef1").
- Associate this business rule to the
INFRAAuthorizedPolicies
opening for the type PlmParameter under no condition.
- A server where two policies are defined on the “PlmParameter” type: PolicyRef1 and
PolicyRef2
-
- Create a business rule that computes the policy for a
PlmParameter.
Let x(PLMEntity)
x = Parameters->GetAttributeObject(“AggregatingReference”)
if (x <>NULL and x.policy==”VPLM_SMB”)
Parameters->SetAttributeString("PolicyName"," PolicyRef2")
else
Parameters->SetAttributeString("PolicyName"," PolicyRef1")