General Information
Input ObjectsInput objects must be of the following types:
Context Object Parameters
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)
| |||||||||||||||||||||||||||||||||||||||||||||||||||