Context Object Parameters
Parameter Name |
Type |
Read/Write |
Comments |
ToPlacePort |
VPMPort + extension CATAsm3DPosition
|
Write |
Hook of the To Place Tooling Product |
Target Prd |
VPMInstance |
Write |
Target Product (Tooling Product or not) Must have an
Anchor |
TargetPort |
VPMPort + extension CATAsm3DPosition |
Write |
Anchor of the Target Product (Tooling Product or
not) V_HookingPointName defines the expected PLM Type
|
Sample
The following sample checks and
- either validates the connection (severity=0)
- or validates the connection with a warning computed from the rules context
(severity=1)
- or forbids the connection with an error message computed from the rules context
(severity=2)
/*=================================== */
/* File: TLG_EngConnectincheck.CATRule */
/* =================================== */
/* =================*/
/* Declaration */
/* =================*/
/* 4 Inputs of the BL*/
let ToPlacePrd(VPMInstance)
let ToPlacePort(VPMPort)
let TargetPrd(VPMInstance)
let ToPlacePort(VPMPort)
let TargetType(String)
let TargetPLMType(String)
let PLMExtension(Boolean)
Let VDiscipline=""
Let PrimaryType(String)
let iSearch(Integer)
let ToPlacePort3DPosExt(CATAsm3DPosition)
let TargetPort3DPosExt(CATAsm3DPosition)
/* =================*/
/* Init input */
/* =================*/
set ToPlacePrd = ThisObject
set ToPlacePort = Parameters.GetAttributeObject("ToPlacePort")
set TargetPrd = Parameters.GetAttributeObject("TargetPrd")
set TargetPort = Parameters.GetAttributeObject("TargetPort")
set PrimaryType = ThisObject.PrimaryType
set ToPlacePort3DPosExt = ToPlacePort
set TargetPort3DPosExt = TargetPort
set TargetType = TargetPort3DPosExt.V_HookingPointName
iSearch = 0
iSearch = TargetType.Search("_")
TargetPLMType = TargetType.Extract(0,iSearch)
TargetPLMType = "Tlg" + TargetPLMType
set PLMExtension = false
if(ThisObject.IsSupporting("ToolingExtension") == true)
PLMExtension = true
if(ThisObject->HasAttribute("V_discipline") == true)
VDiscipline =ThisObject->GetAttributeString("V_discipline")
/* =================*/
/* Check management*/
/* =================*/
/* BL Check */
Parameters.Severity =1
if (VDiscipline =="ToolingComponent")
{
if((ThisObject.IsSupporting(TargetPLMType)== true) or
(0 <= TargetType.Search("AnyComponent", 0, true)) )
Parameters.Severity =0
/* Test Error */
if (ThisObject.IsSupporting("TlgUserComponent")== true)
Parameters.Severity =2
}
if (VDiscipline =="ToolingMobileUnit")
{
if((ThisObject.IsSupporting(TargetPLMType)== true) or
(0 <= TargetType.Search("AnyMobileUnit", 0, true)) )
Parameters.Severity =0
}
if ((VDiscipline =="ToolingTool") or (VDiscipline == "ToolingPart"))
{
if((ThisObject.IsSupporting(TargetPLMType)== true) )
Parameters.Severity =0
}
/* =================*/
/* Return management*/
/* =================*/
if(Parameters.Severity ==0)
{
Validation = True
Parameters.Message = "Create: the engineering connection is created on the Tooling Product to
insert because it supports the Anchor expected PLM Type:" +TargetPLMType
}
else if(Parameters.Severity ==1)
{
Validation = True Parameters.Message = "Warning: the engineering connection is created on
the Tooling Product to insert, but it does not support the Anchor expected PLM Type:" + TargetPLMType
}
else if(Parameters.Severity ==2)
{
Validation = False Parameters.Message = "Error: the engineering connection is not created on
the Tooling Product because it is forbidden."
}