Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
SupportInstance | VPMInstance |
Read | Instance of support to be added in branch routing. Its reference has a SharedSupportPart type. |
SupportSection | Integer | Read | Support section number |
ListOfSegments | List | Read | List of already routed segments in the support's section. |
Sample
The following sample illustrates how to check if a segment can be added to a support during branch routing.
/* CATRule signature (do not edit) : (ThisObject : #In Branch, Parameters
: #In RuleContext, Validation : #Out Boolean) : #Void */
let Support(VPMInstance)
let ListOfSegments(LIST)
let SptName(String)
let Branch(Branch)
let SupportSection(INTEGER)
let sBranchName(STRING)
let bChecked(BOOLEAN)
bChecked = false
Parameters.Severity = 1
Parameters.Message = "EHIRouting_ValidateAddSegmentToSupport Default Message"
Validation = true
set Support = Parameters.GetAttributeObject("SupportInstance")
set ListOfSegments = Parameters.GetAttributeObject("ListOfSegments")
set SupportSection = Parameters.GetAttributeInteger("SupportSection")
SptName = Support.Name
Trace(1, "Validating addition of Support to branch " + ThisObject.Name + "Support = "
+ SptName + "--> Section ",SupportSection)
if((3 == SupportSection) or (5 <= ListOfSegments->Size()))
{
/* Adding support to third section of Support is not allowed*/
/* Adding more than 5 supports is not allowed*/
Validation = false
Parameters.Severity = 2
Parameters.Message = "Addition is not possible on this section of Support"
Trace (1, "Rule FAILED: " + Parameters.Message)
}
else if(2 <= ListOfSegments->Size())
{
/* If 2 segments are already routed show warning */
Validation = true
Parameters.Severity = 1
Parameters.Message = "Warning: Two or more segments is already routed through
this section of Support;"
Trace (1, "EHIRouting_ValidateAddSegmentToSupport Rule succeeded : "
+ Parameters.Message)
}
else
{
/* else Allow routing */
Validation = true
Parameters.Severity = 0
Parameters.Message = "Support Addition is possible"
Trace (1, "EHIRouting_ValidateAddSegmentToSupport Rule succeeded : " + Parameters.Message)
}