To Choose Parent in MBOM Structure in CUPS (DELMA_ChooseParentInCUPS_ID)

An opening ID is an entry point used to customize business logic. This opening ID is run to retrieve the parent item in the MBOM structure when creating a new node using the Create/Update Manufacturing Assembly (CUMA) command.

Note: The "CUMA" (Create/Update Manufacturing Assembly) command was known as "CUPS" (Create/Update Process Structure) in previous releases. The abbreviation "CUPS" is still used in the name of the opening ID. In this case, "CUPS" now means "CUMA".
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.

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

Input Objects

Input objects must be of the following types:

  • ThisObject: Product or Part occurrence.
  • Parameters: Corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
iParentMfgItemOccList List Read List of possible parents.

iFirstUpperScopedMfgItem

MfgProcessOccurrence

Read

Item occurrence with upper scope to a product.

iImplementingMfgItemRef

DELFmiFunctionReferenc

Read

Reference of the implementing manufactured Item.

oMfgItemOccurrence

List

Write

Item occurrence under which the given manufactured item is to be instantiated.

(In this case, the list will contain only a single parent item).

Sample

In the following sample, the parent item is retrieved from the MBOM structure when creating a new node using the CUMA command.

/* Inputs */
Let iPart(ProductOccurrence)
let iFirstUpperScopedMfgItem(MfgProcessOccurrence)
let iImplementingMfgItemRef(DELFmiFunctionReference)
let iParentMfgItemOccList(List)

/* Output */
let oMfgItemOccurence(List)

Let MfgItemInstance(DELFmiFunctionInstance) 
let ParentMfgItemRef(DELFmiFunctionReference)


/* intermediate nodes */
let MfgItemOccChild(MfgProcessOccurrence)
let listChilds(List)
let listChilds2(List)
Let PartDescription(String)
Let ParentMfgItemName(String)

Let PartInstance(VPMInstance)
Let MfgItemDescription(String)

Let index(Integer)
Let index2(Integer)

let Validation(Boolean)
set Validation = false
set PartDescription =""
set ParentMfgItemName =""

let MymfgItemOcc (MfgProcessOccurrence)

set iPart = ThisObject
if ( NULL <> iPart)
{
   PartInstance = iPart.Instance
   if (PartInstance <> NULL)
   {
      PartDescription = PartInstance->GetAttributeString("V_description")
	  ParentMfgItemName = PartInstance.V_Name		 
   }
}

if (true== Parameters.HasAttribute("UpperScopedMfgItem")) 
{
	set iFirstUpperScopedMfgItem = Parameters.GetAttributeObject("UpperScopedMfgItem")
}

if (true== Parameters.HasAttribute("iParentMfgItemOccList")) 
{
	set iParentMfgItemOccList = Parameters.GetAttributeObject("iParentMfgItemOccList")
}

if (true== Parameters.HasAttribute("ImplementingMfgItemRef")) 
{
	set iImplementingMfgItemRef = Parameters.GetAttributeObject("ImplementingMfgItemRef")
}
set index = 1
if(PartDescription <> "")
{
	for index while index <= iParentMfgItemOccList->Size()
	{
	   set MfgItemOccChild = iParentMfgItemOccList->GetItem(index)
	   if(NULL <> MfgItemOccChild)
	   {
	      MfgItemDescription = MfgItemOccChild->GetAttributeString("V_description")
	      if(0 <= PartDescription.Search(MfgItemDescription, 0, true))
	      {
		 oMfgItemOccurence.Append(MfgItemOccChild)
		 Parameters.SetAttributeObject("OutputParentMfgItemOcc", oMfgItemOccurence)
		 Validation=true
		 break
	      }
	    }
	}
}

if(PartDescription <> "")
{
	if(false == Validation )
	{
	   ParentMfgItemRef = new("CreateAssembly",ParentMfgItemName,NULL)
	   if(NULL <> ParentMfgItemRef)
	   {			
	      set MymfgItemOcc = iFirstUpperScopedMfgItem-> InsertPredecessor(ParentMfgItemRef)
	      if(MymfgItemOcc <> NULL)
	      {
		   MfgItemInstance = MymfgItemOcc.Instance
		   if(NULL <> MfgItemInstance)
		   {
		 	MfgItemInstance.V_description = PartDescription
		   }	
		   oMfgItemOccurence.Append(MymfgItemOcc)
		   Parameters.SetAttributeObject("OutputParentMfgItemOcc", oMfgItemOccurence)
		   Validation=true		
			
		   iParentMfgItemOccList.Append(oMfgItemOccurence)
	      }
	    }
	}
}