Replace by Alternate (DELMA_ReplaceByAlternate_Validation_ID)

An opening ID is an entry point used to customize business logic. This opening ID is executed to prevent the replacement of unvalidated alternates/substitutes when the Replace by Alternate command is launched from the Manage Alternates Substitutes panel. It returns the authorization status, and, according to this, the replacement either proceeds or is restricted.

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

This page discusses:

General Information

Definition Description
PLM Opening ID DELMA_ReplaceByAlternate_Validation_ID
Customization intent Execution
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: Manufactured item occurrence
  • Parameters: Corresponds to the context object

Context Object Parameters

Parameter Name Type Read or Write Comments
iChosenReplaceItemReference Object (DelFmiFunctionReference) Read Reference of the chosen replacer Manufactured Item from the Manage Alternates Substitutes panel.
iPartofChosenReplaceItemReference Object (VPMReference) Read Reference of the part corresponding to the chosen replacer Manufactured Item from the Manage Alternates Substitutes panel.
iAlternateQualificationState String Read EBOM alternate qualification status.

May be:

  • Proposed
  • Qualified
  • Obsolete.

iEBOMAlternateRelationType String Read EBOM alternate relation type.

May be:

  • Alternate
  • Reference Substitute
  • Instance Substitute.

iRelationType String Read Relation type between the chosen Manufactured Item occurrence and its corresponding part (iPartofChosenReplaceItemReference).

May be:

  • Scope
  • Resulting Product.

iInstanceSubstituteContext Object (ProductOccurrence) Read Context of the EBOM alternate (iEBOMAlternateRelationType), in case of instance substitute.
Note: The value of this attribute is NULL in case of reference substitute or alternate.
iReferenceSubstituteContext Object (VPMReference) Read Context of the EBOM alternate (iEBOMAlternateRelationType), in case of reference substitute.
Note: The value of this attribute is NULL in case of instance substitute or alternate.
oReplaceValidationStatus String Write The validation status returned to check if the replacer Manufactured Item selected from the Manage Alternates Substitutes panel list view is authorized or forbidden for the replacement. The possible values are Yes, or No.

Sample

/* **DISCLAIMER NOTE: THIS IS A SAMPLE BUSINESS LOGIC USED ONLY FOR INTERNAL PURPOSE** */
/*     
Name : DELMA_ReplaceByAlternate_Validation_ID
Mode : Execution
Function : Opening to validate the authorization of replace by alternate from the Alternates Substitutes panel
 
This Sample BL returns the validation status based on the Alternate Qualification status attribute of the EBOM alternate.
 
ThisObject =  Current Mfg Item occurrence [on which Alt-Sub panel is launched].
 
Input arguments :
iChosenReplaceItemReference (IN) [Object]       = Reference of the replacing Manufactured Item choosen from alt-sub list view.
iPartofChosenReplaceItemReference (IN) [Object] = Reference of the Part corresponding to the choosen Mfg item for Replace. 
iAlternateQualificationState[IN][String]        =  EBOM Alternate Qualification status.
iEBOMAlternateRelationType [IN][String]          =  EBOM Alternate relation type.
 
Output argument:
 
oReplaceValidationStatus[OUT][String]   = Validation status of BL opening run. Output must be of a 'String' type 
                                                                     and accepted values: "Yes" or "No"
*/
 
/*----- local variables ----*/
Let CurrentManufacturedItem(MfgProcessOccurrence)
Let CurrentItemReference(DELFmiFunctionReference)
Let ReplacerItemReference(DELFmiFunctionReference)
let ProductOfReplacerItem(VPMReference)
Let iAlternateQualificationStatus(string)
Let iAlternateRelationType(string)
 
Let oValidationStatus(String)
oValidationStatus = "No"
 
set CurrentManufacturedItem = ThisObject
/* ----------- INPUT PARAMETERS -------- */
 
/* ---- Occurrence of the Current Mfg Item [Item on which panel is launched] ---- */
if (NULL <> CurrentManufacturedItem)
{    
	set CurrentItemReference = CurrentManufacturedItem.Reference
 
	if(NULL <> CurrentItemReference)
	{
		/*User defined Business logic*/
	}    
}
 
/* ---- Reference of the Replacer Mfg Item [Choosen from listview] ---- */
if (true == Parameters.HasAttribute("iChosenReplaceItemReference") ) 
{
	set ReplacerItemReference = Parameters->GetAttributeObject("iChosenReplaceItemReference")
	if(NULL <> ReplacerItemReference)
	{
		/*User defined Business logic*/
	}    
}
 
/* ---- Reference of the Part corresponding to the Replacer Mfg Item [choosen from list view]---- */
if (true == Parameters.HasAttribute("iPartofChosenReplaceItemReference") ) 
{
	set ProductOfReplacerItem = Parameters->GetAttributeObject("iPartofChosenReplaceItemReference")
 
	if(NULL <> ProductOfReplacerItem)
	{
		/*User defined Business logic*/
	}
}
 
 
/* ---- Alternate Qualification Status [Proposed\Qualified\Obsolete] ---- */
if (true == Parameters.HasAttribute("iAlternateQualificationState") ) 
{    
	set iAlternateQualificationStatus = Parameters->GetAttributeString("iAlternateQualificationState")
	if (iAlternateQualificationStatus == "Qualified")
	{        
		set oValidationStatus = "yes"    
	}
}
 
/* ---- Alternate Relation Type ---- */
if (true == Parameters.HasAttribute("iEBOMAlternateRelationType") ) 
{    
	set iAlternateRelationType = Parameters->GetAttributeString("iEBOMAlternateRelationType")
		/*User defined Business logic*/
		/*if (iAlternateRelationType == "Alternate")
		{
		 
		}
		else if (iAlternateRelationType == "Instance Substitute")
		{
		}
		else if(iAlternateRelationType == "Reference Substitute")
		{
		}*/            
}
 
/* ---- FILL OUTPUT PARAMETERS ---- */
Parameters.SetAttributeString("oReplaceValidationStatus" ,oValidationStatus)