Selection of a Policy from a Set of Applicable Policies (INFRAAuthorizedPolicies)

The Selection of a Policy from a Set of Applicable Policies opening computes the policy to be used when creating an object of a given type.

You do not need to use this business rule if you intend to use the platform in baseline behavior mode: baseline behavior provides a set of out of the box policies and the default business rules that select the right policies for the right objects.

If you decide to implement your own policies using MQL to have your own maturity graphs or your own security schemes, you must customize these particular business rules for the different types of objects you will have to implement this business rule for the types that will be governed by this policy.

To overwrite the out of the box business rules, it is mandatory to associate your business rule to each type where an out of the box business rule is defined. The out of the box business rules are delivered as CATRule files in win_b64\resources\knowledge\scripts\ENOAP_*.CATRule. The association of the business rules with the opening ID and the type are delivered in win_b64\resources\knowledge\scripts\ENOAP_*.CATRuleExit.

This opening is used in a unified typing context only in addition to the policy definition for a given set of types made through mql. Its objective is to select the policy to apply for a given type of objects.
Note: Business rules dealing with policy choice can be used with public types only (documented in the dictionary). When working with private types, policy association must be described in the policy chooser.

This page discusses:

Environment: On premises only

General Information

This opening ID is invoked:

  • When creating objects in native apps (for example in New > Content, but also at any time when an object is created).
  • When importing an object from a briefcase (in native apps).
The decision is based on the type and on the project. It cannot be based on attribute values.

When importing data from a briefcase, you can choose the policy depending on some attribute values for a restricted set of modelers that require a different decision based on particular attribute values. The "document modeler" is an example because the same type is used for modeling authoring documents and their historization.

Compute the Policy Choice Depending on an Extension Type

When creating an extended object in one transaction (it happens in PLM New where some extension types are proposed (Robot, …) for creation), you can use a business rule to choose the policy to assign to the object, basing the choice on the type of the extension.

  • If the business rule based on the extension type returns a policy, this policy is the one chosen for the object.
  • If there is no business rule on the extension, the policy is computed on the type.

Note: Extensions can be added to an existing object later. In such a case, the policy has already been chosen and cannot be changed.

Compute the Policy at Import/Policy choice based on attribute values at import

Some modelers (for example the document modeler) use the same type of object for two purposes and you may need to differentiate the policy to use for those objects depending on your needs.

When importing such an object from a briefcase, you can trigger the policy choice on the object itself and not on the type. This way, you can access the attribute values in the business rule to make a choice.

As you need to differentiate the creation case from the Import case, you can use the OperationId parameter in the business rule. This parameter indicates if the business rules is invoked at creation or at import.

The business rule below handles a DOCUMENTS type.

Parameters->SetAttributeString("PolicyName","PolicyRefDoc1")
if (Parameters->GetAttributeString("OperationId") == "Import" and ThisObject."Is Version Object"=="True")
{
	Parameters->SetAttributeString("PolicyName","PolicyRefDoc2")
}

Note: very few objects support this particular behaviour by default, the business rules will still be triggered on the type instead of the object. Thus accessing attribute values is impossible (and meaningless). The objects of type “DOCUMENTS” support this particular behaviour. We identify the types that support this behaviour by the fact that they have the keyword PolicyChoiceDependsOnAttributeValue=”Yes” set in the metadata files. (or the property IPML.PolicyChoiceDependsOnAttributeValue if they have been defined using MQL).
Compute the Policy Choice based Depending on the Object Aggregation Capability
Some types (for example, PLM Parameter) enable to create independent objects or aggregated objects. You must therefore select a different policy for aggregated and independent objects. Two input parameters are available to select the policy: AggregatingReference and PolicyOfAggregatingReference.
  • The most fitted rule is selectedAggregatingReference contains the aggregated reference if any. If the object is created without aggregator, it is empty.
  • PolicyOfAggregatingReference contains the name of the policy of the aggregated reference. If the object is created without aggregator, it is.

This criterion lets you choose different policies whether the object is created, aggregated, or not aggregated.

AggregatingReferencePolicyOfAggregatingReference
Independent object (not aggregated)NULL""
Aggregated objectAggregating objectName of the policy of the aggregating object

As the PolicyOfAggregatingReference input parameter is a criterion, you can declare a CATRuleExit to determine the choice depending on the value of this parameter.

<Scripts>
   <Script OpeningID="INFRAAuthorizedPolicies" Type="PLMParameter" ScriptName="RuleChoosingPolicyStandalone">
   </Script>
   <Script OpeningID="INFRAAuthorizedPolicies" Type="PLMParameter" ScriptName="RuleChoosingPolicyAggregated">
   </Script>
</Scripts>
Note: PolicyOfAggregatingReference is available on the client side only.

Priority Business Rules

When you want to override default (installed) baseline behavior customization, because of business rules logic (choosing the rule for the most precise type), you must create a resource set entry almost for each baseline behavior entry. You can use has priority over non priority business rules or CATRule files, whatever the type. To set a business rule to "priority", use the following syntax: /* -- HASPRIORITY -- */

The most fitted rule is selected:

  • first among priority business rules first (best type, then best condition when considering criteria),
  • then among basic business rules and CATRule files (best type, then best condition).
Notes:
  • This priority rule is not restricted to policy opening IDs.
  • Priority CATRules do not exist.

The table below provides you with information related to the definition of the opening ID.

Opening ID: INFRAAuthorizedPolicies
Customization intent: Computation
Execution context:Native/Web

Input Objects

  • ThisObject is most of the time an empty proxy object that corresponds to the object that is going to be created. Its attributes are empty. The only information on which the business rule can be based is its type. In the particular case of import of documents, ThisObject is the object to be imported. Its attributes are filled.
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter NameTypeRead/WriteComments
PossiblePoliciesListReadNot currently used. Systematically empty.
OtherPoliciesListWriteNot currently used. List of other authorized policies for ThisObject type.
OperationIdStringReadImport (in the case of an import) or Default (in other cases).
AggregatingReferenceBusinessTypeReadContains the aggregated reference if any. If the object is created without aggregator, it will be empty.
IsAggregatedBooleanReadIs 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.

AggregatingReferenceIsAggregated
Independent object (not aggregated)NULLfalse
Aggregated objectAggregating objecttrue
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

  1. Create a business rule that computes the policy for a PlmParameter: Parameters->SetAttributeString("PolicyName","PolicyRef2").
  2. Associate this business rule to the INFRAAuthorizedPolicies opening for the type PlmParameter under the condition that IsAggregated=true.
  3. Create a business rule that computes the policy for a PlmParameter: Parameters->SetAttributeString("PolicyName","PolicyRef1").
  4. 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")