General InformationThis opening ID is invoked during the following commands:
This opening ID is used to determine which additional specification is to be used to filter the part subtypes.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
SampleThe following sample describes the business logic: /* Rule created by YRJ 6/9/2015 */
/* CATRule signature (do not edit) : (ThisObject : #In BL_AddedSpecsAndResourceFilteringParams, Parameters : #In RuleContext) : #Void */
/* Inputs */
let FeatureCurrentApplicativeInformation (Feature)
/* Declarations for current applicative entities */
let ListCurrentApplicativeEntitiesKeys (List)
let sCurrentApplicativeEntityKey (String)
let ListCurrentApplicativeEntities (List)
let NbCurrentApplicativeEntities (Integer)
let pCurrentApplicativeEntity (PLMEntity)
let sCurrentApplicativeEntityName (String)
/* Declarations for current ens specifications & content */
let ListCurrentEnsSpecifications (List)
let NbCurrentEnsSpecifications (Integer)
/* Declarations for additional customer ens specifications */
let ListAuthorizedAdditionalEnsSpecifications (List)
let NbAuthorizedAdditionalEnsSpecifications (Integer)
let pAuthorizedAdditionalEnsSpecification (PLMEntity)
let sAuthorizedAdditionalEnsSpecificationName1 (String)
let sAuthorizedAdditionalEnsSpecificationName2 (String)
/* Declarations for BL Outputs : additional PLM attributes to filter searched resource AND/OR indexes of customer additional ens specifications to filter searched resource */
let FeatureAddedPLMAttributesFilteringSearchedResource (Feature)
let ListIndexesOfAddedEnsSpecifications (List)
let i (Integer)
let j (Integer)
let posX(Real)
let posY(Real)
let posZ(Real)
let pos(Real)
/************ Get input parameters : ListCurrentApplicativeEntities ****************/
ListCurrentApplicativeEntitiesKeys = Parameters->GetAttributeObject("ListCurrentApplicativeEntitiesKeys")
ListCurrentApplicativeEntities = Parameters->GetAttributeObject("ListCurrentApplicativeEntities")
NbCurrentApplicativeEntities = ListCurrentApplicativeEntities.Size()
Trace(1,"Eng Spec Rule : BL_AddedSpecsAndResourceFilteringParams : NbCurrentApplicativeEntities = ", NbCurrentApplicativeEntities)
i = 1
if (0 < NbCurrentApplicativeEntities)
{
for i while i <= NbCurrentApplicativeEntities
{
set sCurrentApplicativeEntityKey = ListCurrentApplicativeEntitiesKeys.GetItem(i)
set pCurrentApplicativeEntity = ListCurrentApplicativeEntities.GetItem(i)
if (NULL <> pCurrentApplicativeEntity)
{
sCurrentApplicativeEntityName = pCurrentApplicativeEntity.V_Name /* Title */
}
}
}
set FeatureCurrentApplicativeInformation = Parameters->GetAttributeObject("FeatureCurrentApplicativeInformation")
posX = FeatureCurrentApplicativeInformation->GetAttributeReal("Location_PosX")
posY = FeatureCurrentApplicativeInformation->GetAttributeReal("Location_PosY")
posZ = FeatureCurrentApplicativeInformation->GetAttributeReal("Location_PosZ")
/************ Get input parameters : ListCurrentEnsSpecifications ****************/
ListCurrentEnsSpecifications = Parameters->GetAttributeObject("ListCurrentEnsSpecifications")
NbCurrentEnsSpecifications = ListCurrentEnsSpecifications.Size()
i = 1
/************ Get input parameters : ListAuthorizedAdditionalEnsSpecifications ****************/
ListAuthorizedAdditionalEnsSpecifications = Parameters->GetAttributeObject("ListAuthorizedAdditionalEnsSpecifications")
NbAuthorizedAdditionalEnsSpecifications = ListAuthorizedAdditionalEnsSpecifications.Size()
if (0 < NbAuthorizedAdditionalEnsSpecifications)
{
set pAuthorizedAdditionalEnsSpecification = ListAuthorizedAdditionalEnsSpecifications.GetItem(1)
if (NULL <> pAuthorizedAdditionalEnsSpecification)
{
sAuthorizedAdditionalEnsSpecificationName1 = pAuthorizedAdditionalEnsSpecification.V_Name /* Title */
}
set pAuthorizedAdditionalEnsSpecification = ListAuthorizedAdditionalEnsSpecifications.GetItem(2)
if (NULL <> pAuthorizedAdditionalEnsSpecification)
{
sAuthorizedAdditionalEnsSpecificationName2 = pAuthorizedAdditionalEnsSpecification.V_Name /* Title */
}
}
/* **************************** Fill outputs : "ListIndexesOfAddedEnsSpecifications" and "FeatureAddedPLMAttributesFilteringSearchedResource" ***************************************** */
if (true == Parameters.HasAttribute("ListIndexesOfAddedEnsSpecifications") and true == Parameters.HasAttribute("FeatureAddedPLMAttributesFilteringSearchedResource"))
{
set ListIndexesOfAddedEnsSpecifications = Parameters->GetAttributeObject("ListIndexesOfAddedEnsSpecifications") /* List of int being the indexes of additional ens specs to consider */
if( (1000 >= posX) AND (1000 >= posY) AND (1000 >= posZ) )
{
ListIndexesOfAddedEnsSpecifications->Append(1)
}
else
{
ListIndexesOfAddedEnsSpecifications->Append(2)
}
Parameters->SetAttributeObject("ListIndexesOfAddedEnsSpecifications", ListIndexesOfAddedEnsSpecifications)
/* Fill added PLM attributes filtering searched resource */
set FeatureAddedPLMAttributesFilteringSearchedResource = Parameters->GetAttributeObject("FeatureAddedPLMAttributesFilteringSearchedResource") /* Feature carrying N attributes */
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||