Replicate Predefined Configurations to Remaining Roots (DELPPRFindSimilarConfigIndexInOrderedList_ID)

An opening ID is an entry point used to customize business logic. This opening ID is run to replicate predefined configuration filters to all downstream roots.

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 IDDELPPRFindSimilarConfigIndexInOrderedList_ID
Customization intent Execution
Execution contextClient

Input Objects

Input objects must be of the following types:

  • ThisObject: Root occurrence having a list of predefined configurations, on which a drop-down list selection was just made.
  • Parameters: Corresponds to the context object.

Context Object Parameters

Parameter NameTypeRead/WriteComments
ReferencePredefinedConfigurationObject Type Read Feature: predefined configuration just selected in the drop-down list.
CurrentRootObject TypeRead Occurrence: the root for which the Business Logic must return the predefined configuration to apply.
CurrentRootPredefinedConfigurationListListWriteList of predefined configurations owned by the current root .
IndexIntegerWriteIndex corresponding to the predefined configuration to apply:

0 means no predefined configuration to apply is found.

n means referencePredefinedConfiguration[n] is selected for current root.

MessageStringWrite Error message.
StatusIntegerWrite0 if Business Logic is successful.

Sample

The following sample shows how to replicate predefined configuration filters to all downstream roots.

The filter is based on predefined configuration name ReferencePredefinedConfiguration, which is taken as reference pattern. For any configuration of CurrentRootPredefinedConfigurationList, a configuration fits if the first 9 characters of its name is the same as the pattern.

Let thisFeature(Feature)    /* the Reference Root Let currentRoot(Feature)    /* the current Root */
Let referencePredefinedConfiguration(Feature)  
let testResourceOccurrence(ResourceOccurrence)
let thisResourceOccurrence(ResourceOccurrence)

Let Index(Integer)
Let Message(String)
Let Status(Integer)
Let rank(Integer)

Let configurationItemfromList(Feature) /*used in each list do not use Feature*/

Let referencePredefinedConfigurationName(String)
Let CurrentRootPredefinedConfigurationList(List)

Let configurationName(String)
Let currentRootName(String)
Let fromIdSetAttName(String)

Let filteringPattern(String)

Set Index = 0
Set Message = ""
Set Status = -1

Set referencePredefinedConfigurationName = ""
Set currentRootName = ""
Set configurationName = ""
Set fromIdSetAttName = ""

/* In this exemple we keep configuration whose name contains filteringPattern and skip the resource */

Set thisResourceOccurrence = ThisObject 
if (NULL == thisResourceOccurrence)    
{
  if ( true == Parameters.HasAttribute("CurrentRoot") ) 
  {
     Set currentRoot=Parameters.GetAttributeObject("CurrentRoot")
     if (NULL <> currentRoot)    
     {
       currentRootName =  currentRoot.Name  
      Set testResourceOccurrence =  currentRoot
     }
  }

  if (NULL == testResourceOccurrence)    
  {
    if ( true == Parameters.HasAttribute("ReferencePredefinedConfiguration") ) 
    {
       Set referencePredefinedConfiguration=Parameters.GetAttributeObject("ReferencePredefinedConfiguration")
       if (NULL <> referencePredefinedConfiguration)    
       {
         referencePredefinedConfigurationName =  referencePredefinedConfiguration.Name  
        Message = "No configuration with the same name found on "+currentRootName
        
        filteringPattern =   referencePredefinedConfigurationName                 
        if (referencePredefinedConfigurationName.Length()>9)
        {
           filteringPattern=referencePredefinedConfigurationName.Extract(0,8)
        }

        if ( true == Parameters.HasAttribute("CurrentRootPredefinedConfigurationList") ) 
        {
           Set CurrentRootPredefinedConfigurationList=Parameters.GetAttributeObject("CurrentRootPredefinedConfigurationList")
          rank=0

          if (CurrentRootPredefinedConfigurationList.Size() > 0)    
          {
            for configurationItemfromList inside CurrentRootPredefinedConfigurationList
             {      
              rank=rank+1
              if (NULL <> configurationItemfromList)                                               
              {           
                configurationName =  configurationItemfromList.Name                         
                if(0  <=  configurationName.Search(filteringPattern, 0, true))  
                {                                         
                  Index=rank
                  Message = ""
                   Status=0   
                }                     
              } 
            }          
          }
        }
      }
    }
  }
  else
  {
     Message = "No modification applied to resource node "+currentRootName
  }
}
else
{
   Message = "Modification on resource node "+currentRootName+" not considered"
}


if ( true == Parameters.HasAttribute("Index") ) 
{
  Parameters.SetAttributeInteger ("Index" , Index) 
}

if ( true == Parameters.HasAttribute("Message") ) 
{
  Parameters.SetAttributeString ("Message" , Message) 
}
if ( true == Parameters.HasAttribute("Status") ) 
{
  Parameters.SetAttributeInteger ("Status" , Status) 
}