Validates Allocation (Sys3D_ValidateAllocation)

An opening ID is an entry point used to customize business logic. The Validates Allocation is used to validate actions related to allocation connection.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked for any action related to allocation connection.

This opening ID is used to validate:

  • The creation of allocation connection between a system and 3D elements
  • The deletion of allocation connection between a system and 3D elements
  • The change of the context for an allocation connection

Definition Description
PLM Opening ID Sys3D_ValidateAllocation
Customization intent Validate
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: Occurrence of the volume, for which allocation connection is to be validated (ProductOccurrence).
  • Parameters corresponds to the context object.
  • Validation:
    • If the rule succeeds and validates the action, the modification is be performed on the allocation connection.
    • If the rule execution fails or returns false, the action is not be performed.
    • If the rule is not found, the actions will be performed based on defined criteria.

Context Object Parameters

Parameter Name Type Read or Write Comments
FactType Any EKL type Type of ThisObject in the business rule body.
ActionID String Write Indicate the action to be done on allocation. The Possible values are:
  • Creation
  • ChangeContext
  • Deletion
VolumePorts List Write Lists the pathway connection points in the ThisObject.
SystemComponents List Write Lists the system components for which a validation is needed.
SystemPorts List Write Lists the ports or interfaces in the system components.
CurrentAllocationContext VPMReference Write Indicates the product reference containing the allocation connection.
SelectedAllocationContext VPMReference Write Indicates the product reference in which the allocation connections must be moved. If the ActionID is not ChangeContext, it will be NULL.

Sample

/* CATRule signature (do not edit) : (ThisObject : #In ProductOccurrence, Parameters : #In RuleContext, Validation : #Out Boolean) : VoidType */

let sActionID (STRING)
let sDescription (STRING)
let sDescriptionComp (STRING)
let listVolumePorts (LIST)
let listSystemComponents (LIST)
let listSystemPorts (LIST)
let volInstance (Sys3D_ComponentVolumeInst)
let compOccurrence (LogicalOccurrence)
let compInstance(RFLVPMLogicalInstance)
let index (INTEGER)


// by default all the actions are allowed
set Validation = true
set volInstance = ThisObject.Instance
if(NULL <> volInstance)
{
	set sDescription = volInstance.GetAttributeString("V_description")
	set listVolumePorts = Parameters.GetAttributeObject("VolumePorts")
	set listSystemComponents = Parameters.GetAttributeObject("SystemComponents")
	set listSystemPorts = Parameters.GetAttributeObject("SystemPorts")
	set sActionID = Parameters.GetAttributeString("ActionID")
	if(sActionID == "Creation")
	{
		// check if the instance description of all  the components in list matches with description of volume
		// if decription of any of the component is different, forbid creation of connection
		set index = 1
		for index while index <= listSystemComponents.Size()
		{
			set compOccurrence = listSystemComponents.GetItem(index)
			set compInstance = listSystemComponents.GetItem(index)
			if(NULL <> compOccurrence)
			{
				set compInstance = compOccurrence.Instance
			}
			if(NULL <> compInstance)
			{
				set sDescriptionComp = compInstance.V_description
				if(sDescriptionComp <> sDescription)
				{
					set Validation = false
					Parameters.Message = "Some System component cannot be connected to this volume"
					Parameters.Severity = 1
					break
				}
			}
			else
			{
				set Validation = false
				Parameters.Message = "System component not found from list so this connection is forbidden"
				Parameters.Severity = 2
				break
			}
		}
	}
	else if ((sActionID == "ChangeContext") and (sDescription == "ContextChangeForbidden"))
	{
		set Validation = false
		Parameters.Message = "Context change not allowed for connection of this volume"
		Parameters.Severity = 1
	}
	else if( (sActionID == "Deletion") and (sDescription == "DeletionForbidden"))
	{
		set Validation = false
		Parameters.Message = "Context change not allowed for connection of this volume"
		Parameters.Severity = 1
	}
}