Instance Type Selection (INFRAInstanceTypeSelection)

An opening ID is an entry point used to customize business logic. The Instance Type Selection (INFRAInstanceTypeSelection) opening ID lets either choose the type of an instance to use when inserting an object, or lets you extend the instance with the customer and deployment extensions defined in the rule. This business rule is invoked when inserting an object under another one. The consequence of the insertion is the creation of an object called “instance”. You do not need to implement this business rule because, by default, a given instance type will be chosen based on rules defined by applications. You can implement it if you want to choose particular instance types (or if you want to extend the instance with extensions) depending on the object to insert or the object where it is inserted.

Notes:
  • You can statically define the instance type to choose for an object of a specialized type. To know more, see Specialize Data Model: Creating and Editing a Specialization Type. . By implementing the business rule, you can overwrite this behavior .
  • In processes that consist in duplicating objects, the deployment and the customer extensions are usually kept. No business rule is launched. For an instance type, the Instance Type Selection opening is triggered to choose the instance type and to extend the instance with the customer extension.
  • It is recommended that you use the Instance Type Selection opening for instance types and not the Deployment Extension Choice opening.

When editing the object properties, the customer extensions are available in different tabs and the attributes of the deployment extensions added to the object appear as if they were the attributes of the object type.

This is also true for web applications.

This page discusses:

General Information

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

Opening ID: INFRAInstanceTypeSelection
Customization intent:Computation
Execution context:
  • On the cloud: Client
  • On premises: Client/Server

Input Objects

  • ThisObject is the reference to insert. As it is the fact, it lets users choose between different business rules depending on the reference type.
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter NameTypeRead/WriteComments
InstanceTypeNameStringWriteString in output of the opening. This rule lets you enter the instance type name required by the instance. If the rule returns an empty value (or if no rule is defined), the natural default instance type is used:
  • The natural instance type is defined by DS apps.
  • For a specialization type, it can be defined by the user using the Model Customization tool.
  • If the business rule returns an instance type name, it must be a sub type of the natural instance type. If not, the business rule fails.
DeploymentExtensionNameStringWriteThe rule lets you indicate the name of the deployment extension type to add to the instance object. If the rule returns an empty value (or if no rule is defined), the object is not extended with a deployment extension.
PolicyStringReadContains the name of the policy of the reference to insert. It enables to define different rules for different policies
CustomerExtensionsToAddListWriteThe rule lets you provide the list of customer extension or deployment extension names required by the instance object. If the rule returns an empty list (or if no rule is defined), the object is not extended with additional deployment extensions or customer extensions.
AggregatingReferenceFeatureReadObject corresponding to the aggregating reference where the instance is to be inserted. It is an input of the opening. In the rule, the user can choose different instance types or extensions based on this information.

Sample

let l(List)
/* access the list of extensions in output */
 	l = Parameters->GetAttributeObject("CustomerExtensionsToAdd") 
 	l.Append("MyDeploymentInstanceExtension2") /* You could add more than one extension */
/* don’t forget to update the list */
Parameters->SetAttributeObject("CustomerExtensionsToAdd",l)
Parameters>SetAttributeString("DeploymentExtensionName","MyDeploymentInstanceExtension1")
Parameters>SetAttributeString("InstanceTypeName","MySpecializationInstance1")