Reroute Item-Product Inconsistent Links After Restructuring of EBOM Structure (DELPLMFProcessInstance_RerouteUserListCandidates_ID)

Important Note: 
This wiki page is part of the use case where, the EBOM Tree is restructured after the establishment of MBOM structure, which in turn causes Item-Product Link inconsistencies. This should not be considered as best practice.

To tackle this problem, two use cases are prepared with custom business logics:
Use Case 1: Keep Same Instance Name After Drag and drop (Please click on the Link)
Use Case 2: [This Page] Reroute Item-Product Inconsistent Links After Restructuring of EBOM Structure (Based on alias of Previously Linked Physical Product) [DELPLMFProcessInstance_RerouteUserListCandidates_ID]

It is recommended to deploy the BL from 1st Use case for correct working of the BL in this Wiki page.

This document is intended to provide a detailed guide and examples on how to customize a Business Rule for opening ID "DELPLMFProcessInstance_RerouteUserListCandidates_ID"

Introduction

This Business Logic is intended to modify the "Manage Item-Product Link Inconsistency" command to propose the Products to reroute on Inconsistent Mfg. Item - Product Implement Link, when the EBOM structure is restructured after drag and drop.

Version Tested on – 2024x FD04 FP.CFA.3432, 2025x FD01 FP.CFA.2506

Pre-requisites:

Licenses –

  • PPL (Process Engineer): Required to create Mfg. Item Structure & Process Structure

Disclaimer: Licenses mentioned above are as per 2024x and 2025x documentation.

Details of The Opening ID
PLM Opening IDDELPLMFProcessInstance_RerouteUserListCandidates_ID
 
Customization IntentExecution
Execution ContextClient
UsageSuggest Products to be Rerouted on the Inconsistent Item-Product Implement links after the command "Manage Item-Product Link Inconsistency" gets called.

Use Case: Reroute After Re-Structuring of EBOM 

Note: The sample data and the scenario given below is only to demonstrate the use case and should not be considered as best practice.

Data Set Pre-requisite For the Use Case

Given that the objective is to facilitate the re-structuring of the Engineering Bill of Materials (EBOM) following the creation of the Manufacturing Bill of Materials (MBOM), it is essential to avoid establishing scope links between the intermediate nodes of the MBOM and their corresponding EBOM nodes. This precaution is crucial to enable the re-routing process, as the Physical Products in the EBOM may be transferred from one EBOM node to another.

Note: If scope links exist among the intermediate nodes of the Engineering Bill of Materials (EBOM) and the Manufacturing Bill of Materials (MBOM), it will prevent the rerouting of Physical Products that have been relocated to a different node in the EBOM that is not scoped with the Parent Manufacturing Item of the Manufacturing Item that has the inconsistent scope link.

For this use case, the EBOM and MBOM can be linked as given below:

Sample 1: Flat MBOMSample 2: Non-Flat MBOM with no scope at intermediate nodes

Scenario Description

Let's consider the data set is modelled as given below:

Here, sometimes, the BatteryCells may be moved from one place to another in the EBOM Tree. The objects may be moved from one node to another, or they may be moved directly under the Root.

For example, the BatteryCells "BatteryCell.34" and BatteryCell.35" from Group1 may be moved to Group2 and "BatteryCell.31" may be moved directly under the root by drag and drop as given below.

Important Note: Here the business logic from this use case is deployed prior to drag and drop of the Physical Products to keep same Instance Names after the restructuring.

Subsequent to this action, the scope links remain un-affected as they are Reference-Reference Links.  However, the Item-Product Implement Links become inconsistent as it cannot find the previous instance to which the link was pointing. Thought the instance name of Physical Products is kept same after re-structuring, as this restructuring causes the deletion of previous instance of the physical product and creation of new instances of the Physical Products, the link gets inconsistent.

To solve this inconsistency, the "Manage Item-Product Link Inconsistency" command can be used.

Default Behavior of MIPLI Command After Restructuring EBOM

To manage this, when the MIPLI command is launched, by default, the command proposes to "Reroute" the inconsistent Implement Links between Items and Products. It proposes all the possible Physical Products from the "First Upper Scoped" Physical Product, which could be rerouted on the inconsistent implement link.

If the number of inconsistent links are few, it could be managed manually by selecting the Physical Product Instance to be re-routed on the inconsistent Item-Product Link. However, it could be a tedious task if the number of inconsistent links are large.

Behavior After Deploying Customized Business Logic

After deploying the customized business logic, the MIPLI command will propose the Physical Product (From the first upper scoped Physical Product) to be rerouted on the inconsistent Item-Product implement Link which have the same Instance Name as the previously linked Physical Product.

Note: Here, the Instance Name of previously linked Physical Product Instance is taken from the alias or path of the previously linked Product from the list "ListCandidateAlias"

If the proposed products to re-route are correct, then one can select the rows to be re-routed and click on the "Perform action on selected lines" button.

It will re-route the Inconsistent Item-Product links to the new Physical Product Instances.

Sample Script

Sample Script

Working of the Business Logic

Get first upper scoped Physical Product

//Upper scope of object for which BL is called ->Product occurrence
set RootProductScopeOcc=Parameters->GetAttributeObject("iFirstScopeAncestor")

Get list of Mfg. Items Bearing the Inconsistent Implement Links

//List Occurrence ->List of the manufactured item occurrences holding the inconsistent link
set ListProcessOccurrences=Parameters->GetAttributeObject("iListOccurrence")
set SizePcsOcc = ListProcessOccurrences.Size()
Trace(1 , "SizePcsOcc : #", SizePcsOcc)

Get list of paths of the previously linked Physical Product Instances

//ListCandidateAlias -> List of the product alias (string) stored in the link, i.e., the old implemented products. This alias contains the retrieved path.
set ListCandidateAlias = Parameters->GetAttributeObject("iListCandidateAlias")
set AliasSize = ListCandidateAlias.Size()
Trace(1 , "ListCandidateAlias : #", AliasSize)

Get children of Fist Upper Scoped Physical Product

//Get all products under the first upper scoped Physical Product
listOfAllProdOcc = RootProductScopeOcc->Query("ProductOccurrence", "")
set Size = listOfAllProdOcc.Size()
Trace(1 , "listOfAllProdOcc Size : #", Size)

This script processes each manufacturing item from the list that contains Mfg. Items bearing the inconsistent links and retrieves the path of their corresponding previously linked physical product instance. Subsequently, it utilizes the instance name obtained from the path of the previously linked physical product instance to search for the product instance within the list of children of the first upper-scoped product. The product that corresponds to the name of the previously linked product instance is then recommended for rerouting.

Here, the 1st Element in the list "ListCandidateAlias" corresponds to the path of the previously linked Product Instance on the 1st Mfg. Item in the List "ListProcessOccurrences" and so on. Therefore, they need to be accessed simultaneously in the loop.

for Index = 1 while Index <= SizePcsOcc
{
    iRerouteIndex = Index
    MfgItemInConsistentOcc = ListProcessOccurrences->GetItem(iRerouteIndex) //Get Mfg. Item bearing the Inconsistent Implement Link
    set Alias = ListCandidateAlias->GetItem(iRerouteIndex)  //Get the Alias or Path of the previously linked Product Instance
    set SplitStrLst = SplitString(Alias, "/") //split the path at "/"
    Set PreviousProdName = SplitStrLst->GetItem(SplitStrLst.Size()) //Get name of instance from the list
    SplitStrLst.RemoveAll() //empty the list
    
    if(MfgItemInConsistentOcc <> NULL)
    {
        set ProcInst = MfgItemInConsistentOcc.Instance //Get Mfg. Item Instance
        set ProcRef = MfgItemInConsistentOcc.Reference //Get Mfg. Item Reference
        
        if(ProcInst <> NULL and ProcRef <> NULL)
        {
            set strMfgItemInstName = ProcInst.PLM_ExternalID  //Get Mfg. Item Instance Name
            Trace(1 , "Inconsistent Mfg item instance : ", strMfgItemInstName)
            
            set strMfgItemRefName = ProcRef.V_Name //Get Mfg. Item Ref. Title
            Trace(1 , "Inconsistent Mfg item Reference : ", strMfgItemRefName)
            
            for oToBeRerouteProdOcc inside listOfAllProdOcc
            {
                set oProductInst = oToBeRerouteProdOcc.Instance //Get product instance 
                set oProductRef = oToBeRerouteProdOcc.Reference //Get Product Reference 
                
                if(oProductInst <> NULL and oProductRef <> NULL)
                {
                    set strProdInstName = oProductInst.PLM_ExternalID //Get product instance name
                    Trace(1 , "Product instance Name: ", strProdInstName)
                    
                    //if(strMfgItemInstName == strProdInstName)
                    if(PreviousProdName == strProdInstName)
                    {                    
                        Trace(1 , "Reroute mapping found")
                        ListCandidateOccurrences->SetItem(oToBeRerouteProdOcc,iRerouteIndex) //Set the product to be rerouted on current item
                
                        rerouteStrategy = 1 //reroute
                        Strategies->SetItem(rerouteStrategy,iRerouteIndex) //Set strategy to Reroute
                    }
                }
            }            
        }
    }
}

Update the list of Parameters

// Set output parameters
Parameters.SetAttributeObject ("oCandidateOccurrences",ListCandidateOccurrences)  
Parameters.SetAttributeObject ("oListStrategies",Strategies)

Logical Flow

How to Deploy

You may refer the below page for Business Rule deployment.

How to Deploy Business Rule

For deployment using Data Setup app following Resource set ID and opening needs to be used:

Resource Set ID:

Opening ID:

Fact Type:

It is recommended to deploy the BL only using Data Setup for "Fact type" = "FProcessOccurrence"

References

  • User Assistance: Link

Authors

For any queries, please do not hesitate to reach out to @KA @KK