Get Item Reference To Use (DELMA_GetMfgItemReferenceToUse_ID)

An opening ID is an entry point used to customize business logic. This opening ID is run to retrieve the item reference to use for a given product.

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

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

PLM Opening ID: DELMIA_GetMfgItemReferenceToUse_ID
Customization intent: Execution
Execution context: Client

Input Objects

Input objects must be of the following types:

  • ThisObject: Product or part on which the test is done.
  • ThisObject: Occurrence of part on which the test is done (ProductOccurrence).
  • Parameters: Corresponds to the context object.

Context Object Parameters

Parameter Name Type Read/Write Comments
oMfgItemReference DELFmiFunctionReference Write ObjectType, reference of the Item to use (may be NULL).
iMfgItemContext String Read

Working context of the Item to use.

May be:

  • "Assembly"
  • "Fabrication"
  • "Service"
oMfgItemType String Write Type of the Item to create, if a oMfgItemReference is not returned.

May be:

  • "Provide" for Provided Part
  • "ElementaryEndItem" for Manufactured Part
  • "CreateAssembly" for Manufacturing Assembly
  • "CreateMaterial" for Manufacturing Material
  • "CreateKit" for Kit
  • "ProcessContinuousProvide" for Continuous Provided Material
  • "ProcessContinuousCreateMaterial" for Continuous Manufactured Material
oMfgItemMagnitude Integer Write

Magnitude of the Item to create, if a oMfgItemReference is not returned.

Note: Only required if the type is a sort of continuous.

May be:

  • 0: Each (not continuous item)
  • 1: Length
  • 2: Weight
  • 3: Surface
  • 4: Volume

Sample

The following sample retrieves the Item reference to use for a given product.

let ThisRef(VPMReference)
let PrcsScopeList(List)
let PrcsOcc(MfgProcessOccurrence)
Let oMfgItemReference(DELFmiFunctionReference)
let tmpList(List)

set ThisRef = ThisObject.Reference
oMfgItemReference = NULL

if ThisRef.IsSupporting("Fastener")
{
	/* Fastener case, we want to let the system handle the Fasten reference to use. */
	oMfgItemReference = NULL
}
else
{
	/* Other types of products, we handle assemblies and parts using the same logic. */
	PrcsScopeList = GetProcessOfEachScope(ThisRef)
	if (PrcsScopeList.Size() == 0)
	{
		/* OK, no process scoped found in session, looking in the database now - do not forget to export variable DELMIA_EBOM_IN_PRD*/
		PrcsScopeList = ThisRef.NavigateFromPartOrPrdToProcessThroughScopeLink()
		if (PrcsScopeList.Size() == 0)
		{
			/* Case where product isn't scoped at all. New reference must be created */
			tmpList = ThisRef.Query("VPMReference","")
			/*if (ThisRef.V_isTerminal) --> Method not valid with certain old data used for demos. */
			if (tmpList.Size()==0)
			{
				/* Case where the product is a leaf node. Better method can be provided based on custom logic.*/
				/* oMfgItemReference = new("Provide",ThisRef.V_Name,NULL)ElementaryEndItem */
				oMfgItemReference = new("ElementaryEndItem",ThisRef.V_Name,NULL)
				oMfgItemReference.CreateProductProcessScope(ThisRef)
			}
			else
			{
				/*We're sure it's an assembly. Here we could still create a provide or another specific type depending on customer requirement */
				oMfgItemReference = new("CreateAssembly",ThisRef.V_Name,NULL)
				oMfgItemReference.CreateProductProcessScope(ThisRef)
			}
		} 
		else
		{
			/* Case where product is already scoped by process in DB */
			set oMfgItemReference = PrcsScopeList.GetItem(1)
		}
	} 	
	else
	{
		/* Case where product is already scoped by process in session */
		set oMfgItemReference = PrcsScopeList.GetItem(1)
	}
}

 Parameters.SetAttributeObject("oMfgItemReference" , oMfgItemReference)

Sample

The following sample retrieves the item reference to use for a given product or type.


let ThisRef(VPMReference)
let PrcsScopeList(List)
let PrcsOcc(MfgProcessOccurrence)
Let oMfgItemReference(DELFmiFunctionReference)
Let PartName(String)

oMfgItemReference = NULL

set ThisRef = ThisObject.Reference
PartName = ThisRef.V_Name
if (PartName == "P1")
{
   PrcsScopeList = ThisRef.NavigateFromPartOrPrdToProcessThroughScopeLink()
   set oMfgItemReference = PrcsScopeList.GetItem(1)
   Parameters.SetAttributeObject("oMfgItemReference" , oMfgItemReference)
} 	
else
{
      Parameters.SetAttributeString("oMfgItemType" , "ProcessContinuousProvide")
      Parameters.SetAttributeInteger("oMfgItemMagnitude" , 4)
}