Route Management

In precommit triggers and in the initialization business logic (BL), an Administrator can call methods on editable objects accessible in the BLs. The getRouteContents() method described in this topic returns the contents connected to the route.

This page discusses:

getRouteContents()

This method returns the contents connected to the route in Precommit.

Signature

getRouteContents(String, Boolean)

Arguments

Name Input or Output Required Type Comment
contentType In Yes String Supported types
IncludeAdHocContents In Yes Boolean When it is true, it returns all the contents of specified type in the previous argument irrespective of Blocking Maturity When it is false, it returns only those contents of specified type in the previous argument and whose Blocking Maturity is not None.
DomainObjectsList Out No List Returns list of contents connected to route of type passed in contentType

ReturnType

List

Example

getRouteContents(String contentType, Boolean IncludeAdHocContents) returns a List of all the contents of specified types.

let CurrentState(String)
let ListChildren(List)
let i(Integer)
// This variable is required to differentiate between restarted route and completed route
let RouteStatusVariable(String)
// Declare all the variables for different types
let DocumentVariable(Document)

CurrentState = ThisObject.current
RouteStatusVariable = ThisObject.GetAttributeString("Route Status”)
Validation = true

//Executes only if route gets complete manually through tasks
if (CurrentState == "Complete" and RouteStatusVariable == "Finished") {
  // Get all the contents attached to the route of the type Document and it includes Ad-Hoc Contents
  ListChildren = ThisObject.getRouteContents("Document", true)  
    if (ListChildren.Size() > 0) {
       i=1    
       //Iterate through the list and check if the document is promoted to Release state, and only then set Change Required attribute to true
       for i while i<=ListChildren.Size(){
         DocumentVariable = ListChildren.GetItem(i)
         if(DocumentVariable.current == "RELEASED"){
           SetChangeControlledStatus(DocumentVariable,true)
         }                                   
       }        
    }   
   Validation = true
}

Example

getRouteContents("",Boolean IncludeAdHocContents) method returns a List of all contents irrespective of type.

let CurrentState(String)
let ListChildren(List)
let i(Integer)
let DocumentVariable(Document)
let RouteStatusVariable (String)

CurrentState = ThisObject.current
RouteStatusVariable = ThisObject.GetAttributeString("Route Status")
Validation = true

if (CurrentState == "Complete" and RouteStatusVariable == "Finished") {
  ListChildren = ThisObject.getRouteContents("",true)  
    if (ListChildren.Size() > 0) {
       i=1    
       for i while i<=ListChildren.Size(){
           SetChangeControlledStatus(ListChildren.GetItem(i),true)                                          
       }        
    }   
   Validation = true
}
Notes:
  • IncludeAdHocContents signifies if the Ad-Hoc contents (Contents whose Blocking Maturity is None) should be returned.
  • When it is true, it returns all the contents of specified type in the previous argument irrespective of Blocking Maturity.
  • When it is false, it returns only those contents of specified type in the previous argument and whose Blocking Maturity is not None.