You can group a series of functions together and determine the path that the user follows through the group using the PROIV Aurora’s Routing functionality. A Route can be regarded as series of tasks that an Operator performs, e.g. create order, create invoice etc and you can set up a Route that follows this set of tasks.

Routing has several advantages:

  • Functions can be inserted into Routes or taken out of Routes without any code changes.

  • Function paths can be viewed at a glance.

For example, a Function Route could consist of a Screen function which accepts criteria, followed by an Update function which populates a workfile based on the criteria, and the Route finishes with a Report function that outputs data based in the workfile.

Furthermore, several Routes can contain the same set of functions. Each Route can be set up to include all of the functions, alternatively the functions can added to a Route and that Route can be called by other Routes

For example, a Function Route could consist of a Screen function which accepts criteria, followed by an Update function which populates a workfile based on the criteria, and the Route finishes with a Report function that outputs data based in the workfile.

Furthermore, several Routes can contain the same set of functions. Each Route can be set up to include all of the functions, alternatively the functions can added to a Route and that Route can be called by other Routes.

For example:

Route 1

 

 

Route 2

 

Function

ScreenA

 

Function

ScreenB

Function

Update1

 

Function

Update1

Function

Update2

 

Function

Update2

Function

Update3

 

Function

Update3

Function

Report1

 

Function

Report2

The updates could be placed into their own Route (Route3) and called by Route1 and Route2

Route1

 

 

Route 2

 

 

Route 3

 

Function

ScreenA

 

Function

ScreenB

 

Function

Update1

Route

Route3

 

Route

Route3

 

Function

Update2

Function

Report1

 

Function

Report3

 

Function

Update3

Function Route Definition Rules

General Guidance

It is important to note the following when maintaining and creating Routes and PROIV Functions:

  • Functions, where possible, should be coded in a manner that allows them to be independent of each other.

  • A Route should be regarded as a task. Although unavoidable in some circumstances, it is advisable to refrain from hard coding the Exit and Error Links in a function.

  • Even if two functions will always intrinsically follow each other, do not hard code the Exit Link in the function. It is better to define both functions in the Function Route. This increases flexibility and allows provides a definitive list of all the functions that are executed within a Route.

  • Keep the Routes as short as possible. It is better if a long Route is made up of smaller sub-routes rather than a long list of functions. Therefore, Function Routes become modular.

Routing Rules

  • The first entry in a Route must have the initial PROIV Function or Route details entered in the Exit Link field and the Error Link field is left blank.

  • The next entry in the Route defines where to link to next upon completion of the called function or Function Route. When there are no subsequent items, the Function Route ends, and if it was called from a menu, it returns to the menu. If it was called by another Function Route, it returns to the next item in the Route.

  • All functions in a Function Route exit to the next Exit Link function in the chain. For this to happen, all functions must have their Exit Link on the Function Definition set to @AU_NEXT.

  • Set the Error Link to @AU_NEXT if a function always continues to the next item in the Route.

  • Set Error Link to @AU_CANCEL if escaping/cancelling out of a function should link to the next Error Link. Functions referenced in the Error Link field are generally used to rollback a database or clear workfiles.

  •  Set Error Link to @AU0400U1 (or @AU_RETURN) or leave it blank if escaping/cancelling out of the function should return to the menu.

Click here to view a screenshot that shows the PROIV Function Definition screen where the function moves onto the next item in the Route, regardless of whether the function is exited normally or in error.

Setting Exit Link in Code

Furthermore, you can programmatically override the Exit Link during function execution, e.g. when the user clicks a Cancel or if an error occurred that means the Route cannot continue.  This causes it to link to the function or Route named in the subsequent item’s Error Link field. If this is blank, or there is no subsequent item then the Route will return to its caller, either a menu or a parent Route.

To force the function to exit to the next Exit Link in the Route, use the following code:

@LFUNCT = “@AU_NEXT"

To force the function to exit to the next Error Link in the Route, use the following code:

@LFUNCT = “@AU_CANCEL"

To force the function to exit to the menu, use the following code:

@LFUNCT = “@AU0400U1"

 

Note: This only applies to non-Global functions.

 

Comment on this topic

Topic ID: 810100

Table of Contents

Index

Glossary

-Search-

Back