Skip to content

Routing Orders

Purpose

Call and list routing order.

Methods

Binding name: p6.routingorder


Method: List<String> getActiveNames()

List all the active routing order name.


Method: List<String> getFailedNames()

List all the failed routing order name.


Method: void deleteCompleted(String name)

Delete a completed routing order.


Method: void deleteFailed(String name)

Delete a failed routing order.


Method: void deleteAllCompleted()

Delete all the completed routing order.


Method: void deleteAllFailed()

Delete all the failed routing order.


Method: void reprocessAllFailed()

Reprocess all the failed routing order.


Method: String reprocessCompleted(String name)

Reprocess a completed routing order.


Method: String reprocessFailed(String name)

Reprocess a failed routing order.


Method: void searchCompleted(Map configuration, Closure<Boolean> notify)

Perform a search for completed routing order

Configuration map

Configuration Name Description
page the page number (default 0)
pageSize the page size (default 25)
sortColumn (default ‘date’)
sortDirection (default ‘desc’)
from Range date start
to Range date stop
dataPartition
dataType
serviceName
keywords

Note

All the configuration entries are optional.

The closure has two arguments:

  • the page number (integer). It’s a zero indexed value.
  • the records (List>)

Record detail

Key Name
date
dataType
name
ids
serviceName
serviceParameters

If you want to read the next page your must return true inside the closure.

If the closure returns false or if the records are empty the next page wont be read.


Method: void searchFailed(Map configuration, Closure<Boolean> notify)

Perform a search for failed routing order

Notice

Take a look to searchCompleted for configuration and notify arguments


Method: void searchActive(Map configuration, Closure<Boolean> notify)

Perform a search for active routing order

Notice

Take a look to searchCompleted for configuration and notify arguments

Examples

println "*** Failed ***"
p6.routingorder.getFailedNames().each {
    println "- name: " + it
}
p6.routingorder.reprocessAllFailed()

println "*** Active ***"
p6.routingorder.getActiveNames().each {
    println "- " + it
}

def conf = [
    page: 0,
    pageSize: 5,
    sortColumn: "date",
    sortDirection: "asc",
    dataPartiton: "TRANSACTION",
    dataType: "TransactionInfo",
    serviceName: "platform6.workflowsteps",
    keywords: "Received",
]
println "*** Search Failed ***" + it
p6.routingorder.searchFailed(conf) { page, records ->
    println "Page n°" + page + " - records found: " + records.size()
    records.each {
        println " - Deleting " + it.get("name")
        p6.routingorder.deleteFailed(it.get("name"))
    }
    // Stop after reading the first two pages (zero indexed)
    page < 1
}

println "*** Cleaning ***" + it
p6.routingorder.deleteAllFailed()
p6.routingorder.deleteAllCompleted()