Compute 3DExperience Defined Attribute Values for PCF (PipComputeAttribute)

An opening ID is an entry point used to customize business logic. Compute 3DExperience Defined Attribute Values for PCF allows you to retrieve the value of an attribute with the 3DEXPERIENCE-DEFINED name.

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

This opening ID is invoked when the ISOGen Attribute mapping table is modified to handle customized attributes.

This opening ID is used to customize the attributes.

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

Definition Description
PLM Opening ID PipComputeAttributeForPCF
Customization intent Computation
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject Product occurrence of rigid pipe/tube or Piping/ tubing part.
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
FactType ProductOccurrence Type of ThisObject in the business rule body
ListISOAttributeNames List Read ISOGen attributes [IN]
ListAttributeValues List Write Attribute values corresponding to input attribute names and object[OUT]

Sample

ThisObject=ProductOccurrence
Parameters=RuleContext
*/

/* Declaration of Variable */
let ListISOAttributeNames_Attr(String)
let ListISOAttributeNames(List)
let ListAttributeValues_Attr(String)
let ListAttributeValues(List)
let ProductRef(VPMReference)
let DS_ParamSet(AdvisorParameterSet)
let ListParametersName(List)
let ListParametersValue(List)
let NbParameters(Integer)
let ParamAttributeName(String)
let index_ISO(Integer)
let index_Param(Integer)
let ISOAttributeName(String)
let NbISOAttributes(Integer)
let StrUnset(string)
let bAttributeFound(Boolean)
let PipingPartObj(Piping_Part_Occurrence)
let PipingPipeObj(Piping_Pipe_Occurrence)
let PipingSpool(Piping_Spool_Occurrence)

/* initialize variable */
set ListAttributeValues_Attr = "ListAttributeValues"
set ListISOAttributeNames_Attr = "ListISOAttributeNames"
set StrUnset = "UNSET"
set NbParameters = 0
set NbISOAttributes = 0

/* Retrieve the Reference Product */
set ProductRef = ThisObject.Reference

/* Retrieve Parameters Set and number of Attribute inside*/
DS_ParamSet = ProductRef->Find ("AdvisorParameterSet","x.Name  == \"DS_Export_PCF\"",TRUE)

if (NULL <> DS_ParamSet)
{
  ListParametersName = DS_ParamSet->ListAttributeNames("", true)
  NbParameters = ListParametersName.Size()
}

/* Retrieve the input list of ISO Attribute */
set ListISOAttributeNames = Parameters->GetAttributeObject(ListISOAttributeNames_Attr)
NbISOAttributes = ListISOAttributeNames.Size()

if (0 < NbISOAttributes)
{
  /* Retrieve the value of parameters */
  set ListParametersValue = DS_ParamSet.Parameters

  /* Loop on all ISO Attributes */
  set index_ISO = 1
  for index_ISO while index_ISO <= NbISOAttributes
  {
    /* Read ISO Attribute Name */
    ISOAttributeName = ListISOAttributeNames.GetItem(index_ISO)

    /* Loop on Parameters */
    set bAttributeFound = false
    set index_Param = 1
    for index_Param while index_Param <= NbParameters
    {
      ParamAttributeName = ListParametersName.GetItem(index_Param)

      if (ISOAttributeName == ParamAttributeName)
      {
        ListAttributeValues.Append(ListParametersValue.GetItem(index_Param))
        bAttributeFound = true
        break
      }
	    if ( ("COMPONENT-ATTRIBUTE10" == ISOAttributeName) AND ("ISOCODE" == ParamAttributeName))  
      {        
        ListAttributeValues.Append(ListParametersValue.GetItem(index_Param)) 
        bAttributeFound = true
        break		
      }
    }

    /* If the ISO attribute is not define in Parameters set */
    if (false == bAttributeFound)
    {
      /* it can be the CATEGORY attribute */
      if ("CATEGORY" == ISOAttributeName)
      {
        /* Retrieve the Spool from Piping Object */
        set PipingPartObj = ThisObject
        if (NULL <> PipingPartObj)
        {
          PipingSpool =  PipingPartObj.GetSpoolObject()
        }
        else
        {
          set PipingPipeObj = ThisObject
          if (NULL <> PipingPipeObj)
          {
            PipingSpool =  PipingPipeObj.GetSpoolObject()
          }
        }

        /* Set the right value */
        if (NULL <> PipingSpool)
        {
          ListAttributeValues.Append("FABRICATION")
        }
        else
        {
          ListAttributeValues.Append("ERECTION")
        }
      }
      else
      {
        /* it is not CATEGORY attribute, we must add <UNSET> string in output*/
        ListAttributeValues.Append(StrUnset)
      }
    }
  }

  /* Set the result in output */
  Parameters -> SetAttributeObject(ListAttributeValues_Attr, ListAttributeValues)
}