Validate Attribute Value Modification (PPRSpreadsheetAttributeValidation_ID)

An opening ID is an entry point used to customize business logic. Validate Attribute Value Modification specifies the opening ID run to allow attribute value modification.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

General Information

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

Definition Description
PLM Opening ID PPRSpreadsheetAttributeValidation_ID
Customization Intent Execution
Execution Context Client

Input Objects

Input objects must be of the following type:

ThisObject: item, system, or operation reference.

Context Object Parameters

Parameter Name Type Read or Write Comments
AttributeID String Read Attribute ID on which to modify the attribute value.
AttributeValueString String Read Attribute value in units of a given magnitude in dictionary.
AttrRealValue Real Read Attribute value in units of a given magnitude in dictionary.
AttributeValueMKS Real Read Attribute value in MKS.
ReturnMessage String Write

Sample

/* ----------------- */
/* Declare Variables */
/* ----------------- */
Let strAttrValue(String)
Let strAttributeID(String)
Let ReturnMessage(String)
Let Value(Real)
Let AttrRealValue(Real)
Let AttrMKSValue(Real)
Let Diameter(Real)
Let Depth(Real)
Let ItemReference(DELFmiFunctionReference)

Validation = true
ReturnMessage = ""
/* ------------------------ */
/* Get the inputs to the BL */
/* ------------------------ */
strAttributeID = Parameters->GetAttributeString("AttributeID")
strAttrValue = Parameters->GetAttributeString("AttributeValueString")
AttrRealValue = Parameters->GetAttributeReal("AttributeValueReal")
AttrMKSValue = Parameters->GetAttributeReal("AttributeValueMKS")

ItemReference = ThisObject

if (strAttributeID == "V_description")
{      
	if (strAttrValue == "Yes")
	{
		Validation = true
		ReturnMessage = "The business logic allow edition"			 
	}
	else
	{
		Validation = false
		ReturnMessage = "The business logic does not allow edition"		
	}	
}
/*         All kinds of Holes          */
/* Diameter and depth must be positive */
else if (strAttributeID == "V_DiameterOfFeature"  OR strAttributeID == "V_DepthOfFeature")
{
	if (AttrRealValue <= 0)
	{
		Validation = false	
		ReturnMessage = strAttributeID+" Must Be Positive"
	}
}	
/*       COUNTERSUNK                    */
/* CSAngle > 0 and < 180 deg */
else if (strAttributeID == "V_CSAngle")
{	
	if (AttrMKSValue <= 0 OR AttrMKSValue > PI)
	{		
		Validation = false
		ReturnMessage = strAttributeID+" Must Be Between Zero And PI"
	}
}
/*           TAPERED          */
/* V_TAngle > 0 and < 180 deg */
else if (strAttributeID == "V_TAngle")
{	
	if (AttrMKSValue <= 0 OR AttrMKSValue > PI)
	{
		Validation = false
		ReturnMessage = strAttributeID+" Must Be Between Zero And PI"
	}
}
/*           BOTTOM ANGLE          */
/* V_BottomAngle > 0 and < 180 deg */
else if (strAttributeID == "V_BottomAngle")
{	
	if (AttrMKSValue <= 0 OR AttrMKSValue > PI)
	{
		Validation = false
		ReturnMessage = strAttributeID+" MustBeBetweenZeroAndPI"
	}
}
/*           THREADED                    */
/* V_THPitch  must be positive           */
/* V_THDiameter must be greater than Diameter, V_THDepth must be greater than Depth */
else if (strAttributeID == "V_THDiameter" OR strAttributeID == "V_THDepth" OR strAttributeID == "V_THPitch")
{	
	if  (ItemReference <> NULL) 
	{
		set Diameter = ItemReference.GetAttributeReal ("V_DiameterOfFeature" )
		set Depth = ItemReference.GetAttributeReal ("V_DepthOfFeature" )
	}
	
	if (AttrRealValue < 0 AND (strAttributeID == "V_THPitch" OR strAttributeID == "V_THDepth"))
	{	
		Validation = false	
		ReturnMessage = strAttributeID+" Must Be Positive"
	}

	if (strAttributeID == "V_THDiameter" AND Value <= Diameter)
	{
		Validation = false
	   ReturnMessage = strAttributeID+"MustBeGreaterThanDiameter"
	}
	
	if (strAttributeID == "V_THDepth" AND Value > Depth)
	{
		Validation = false
	   ReturnMessage = strAttributeID+" Must Be Lower Than Depth"
	}
}		
else
{
 	ReturnMessage = "no rules for attribute"			 
}

Parameters.SetAttributeString("Message",ReturnMessage)
Parameters.SetAttributeBoolean("oAttributeValidation" , Validation)