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 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.

UpperScopedMfgItem

MfgProcessOccurrence

Read

Item occurrence with upper scope to a product.

ImplementingMfgItemRef

DELFmiFunctionReferenc

Read

Reference of the implementing Item already present in the Items structure

OutputParentMfgItemOcc

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).

iItemToReuseRef

DELFmiFunctionReference

Read

Reference of the Item to insert in the Items structure

oCancelInsertion

Boolean

Write

False, if the part can be inserted even if the proper parent is not found.

True, if the item should not be inserted along with its children when the proper parent is not found.

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 UpperScopedMfgItem(MfgProcessOccurrence)
let ImplementingMfgItemRef(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 UpperScopedMfgItem = Parameters.GetAttributeObject("UpperScopedMfgItem")
}

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

if (true== Parameters.HasAttribute("ImplementingMfgItemRef")) 
{
	set ImplementingMfgItemRef = 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 = UpperScopedMfgItem-> 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)
	      }
	    }
	}
}