Create a new Routing Slip
A new Routing Slip instance is instantiated and permanently saved with a series of FTU API calls. The calls must be made in a specific sequence, with the exception that creating Routing Actions may be performed before and/or after the Content Reference. The routing slip is defined piece by piece in memory, using several API calls to create the necessary parts of the slip -- the routing actions and application form information that will be displayed in the FTU Dashboard. When all calls have been made to build the routing slip, an API call causes FTU to assign a unique Routing Slip ID and store the slip permanently in the FTU database.
In addition to the routing slip-related API calls, basic FTU housekeeping tasks and creating and removing an FTU session must be performed prior to slip creation. Refer to the "API Overview" page for an explanation of how to do this.
In addition to the routing slip-related API calls, basic FTU housekeeping tasks and creating and removing an FTU session must be performed prior to slip creation. Refer to the "API Overview" page for an explanation of how to do this.
APIs Referenced:
The following FTU APIs are typically used to create a new routing slip:
createSession()
newRoutingSlip()
newRoutingAction()
newRoutingActionExpandable()
newContentReference()
createRoutingSlip()
getRoutingSlipID()
removeSession()
createSession()
newRoutingSlip()
newRoutingAction()
newRoutingActionExpandable()
newContentReference()
createRoutingSlip()
getRoutingSlipID()
removeSession()
Processing Logic:
1. First Steps
2. Create an FTU session
3. Start a new Routing Slip in memory
4. Create Routing Actions
5. Create Content Reference
6. Permanently save the new Routing Slip
7. Get Routing Slip ID
8. Remove the FTU session
Perform the required initial FTU tasks described in the "First Steps" section of the FTU API Overview page.
2. Create an FTU session
Initialize the client server connection with FTU. Successful creation of an FTU session returns a Session ID which is required as a parameter for all subsequent FTU API calls.
3. Start a new Routing Slip in memory
Instantiate a routing slip in memory. This establishes a temporary place to accumulate routing slip information prior to writing the slip to the FTU database.
4. Create Routing Actions
Optionally create one or more new routing actions -- any number and combination of expandable and fully defined routing action calls.
5. Create Content Reference
Indicate what should be displayed in the FTU Dashboard when pending actions are acted upon.
6. Permanently save the new Routing Slip
Up to this point, all routing slip information resides in memory. If the form application made no more API calls, the routing slip would no longer be available once gone from memory. This API call causes the slip in memory to be assigned a unique Routing Slip ID and stored in the FTU database. The routing slip continues to reside in memory and other API calls can be made on its information.
7. Get Routing Slip ID
Retrieve the unique Routing SLip ID assigned to the routing slip in memory.
8. Remove the FTU session
Terminate the FTU session so that resources can be reallocated
Programming Example:
'********************************************************
' This example creates a routing slip instance for the
' XYZ form application. Please link to individual API pages
' for a complete description of each API parameter.
'
' Processing variables:
' blnOK - indicates success/failure of most recent API call
' returnValue - string value returned by the API call
' sessionID - identifies the current FTU session
'********************************************************
Dim blnOK
Dim returnValue
Dim sessionID
'API parameter values
Dim applicationID
Dim applicationPassword
Dim contentLocation
Dim contentType
Dim externalKey
Dim externalType
Dim extraData
Dim initiator
Dim routingSlipID
Dim routingSlipTitle
Dim routingSlipType
'Initialize processing variables
blnOK = True
sessionID = ""
'---------------------------------------
' First Steps
'---------------------------------------
' Perform FTU housekeeping - establish the FTU client
' and retrieve properties. If any API call is not
' successful, set blnOK to False and perform
' exception processing.
'---------------------------------------
' Create an FTU session
'---------------------------------------
initiator = "smithjd" 'Form creator's MSUNetID
applicationID = "XYZ_AppID"
applicationPassword = "XYZ_AppPassword"
sessionID = FTUCreateSession (initiator, applicationID, applicationPassword)
'---------------------------------------
' Start a new Routing Slip in memory
'---------------------------------------
routingSlipType = "XYZ_RSType"
title = "Form XYZ - Account 123456"
returnValue = FTUNewRoutingSlip (sessionID, routingSlipType, title)
'---------------------------------------
' Create Routing Actions
'
' Note: Any number of expandable and non-expandable
' newRoutingAction APIs may be called.
'---------------------------------------
externalType = "GL-Account"
externalKey = "123456"
extraData = ""
returnValue = FTUNewRoutingActionExpandable (sessionID, externalType, externalKey, extraData)
'---------------------------------------
' Create Content Reference
' Note: Even though a Routing Slip ID has
' not been assigned to the new routing
' slip at this point, specifying
' $routingSlipID in the Content Reference
' URL will cause the correct routing slip
' to be displayed later to the user in the
' FTU Dashboard (because by then the
' Routing Slip ID has been assigned).
'---------------------------------------
contentLocation = "https://www.xyz.com/FormXYZ_Review.asp?RS=$routingSlipID"
contentType="HTTPS"
returnValue = FTUNewContentReference (sessionID, contentType, contentLocation)
'---------------------------------------
' Permanently save the new Routing Slip
'---------------------------------------
returnValue = FTUCreateRoutingSlip (sessionID)
'---------------------------------------
' Get Routing Slip ID
'---------------------------------------
If returnValue = "OK" Then
'---------------------------------------
' Remove the FTU session
'---------------------------------------
returnValue = FTURemoveSession(sessionID)
' This example creates a routing slip instance for the
' XYZ form application. Please link to individual API pages
' for a complete description of each API parameter.
'
' Processing variables:
' blnOK - indicates success/failure of most recent API call
' returnValue - string value returned by the API call
' sessionID - identifies the current FTU session
'********************************************************
Dim blnOK
Dim returnValue
Dim sessionID
'API parameter values
Dim applicationID
Dim applicationPassword
Dim contentLocation
Dim contentType
Dim externalKey
Dim externalType
Dim extraData
Dim initiator
Dim routingSlipID
Dim routingSlipTitle
Dim routingSlipType
'Initialize processing variables
blnOK = True
sessionID = ""
'---------------------------------------
' First Steps
'---------------------------------------
' Perform FTU housekeeping - establish the FTU client
' and retrieve properties. If any API call is not
' successful, set blnOK to False and perform
' exception processing.
'---------------------------------------
' Create an FTU session
'---------------------------------------
initiator = "smithjd" 'Form creator's MSUNetID
applicationID = "XYZ_AppID"
applicationPassword = "XYZ_AppPassword"
sessionID = FTUCreateSession (initiator, applicationID, applicationPassword)
'---------------------------------------
' Start a new Routing Slip in memory
'---------------------------------------
routingSlipType = "XYZ_RSType"
title = "Form XYZ - Account 123456"
returnValue = FTUNewRoutingSlip (sessionID, routingSlipType, title)
'---------------------------------------
' Create Routing Actions
'
' Note: Any number of expandable and non-expandable
' newRoutingAction APIs may be called.
'---------------------------------------
externalType = "GL-Account"
externalKey = "123456"
extraData = ""
returnValue = FTUNewRoutingActionExpandable (sessionID, externalType, externalKey, extraData)
'---------------------------------------
' Create Content Reference
' Note: Even though a Routing Slip ID has
' not been assigned to the new routing
' slip at this point, specifying
' $routingSlipID in the Content Reference
' URL will cause the correct routing slip
' to be displayed later to the user in the
' FTU Dashboard (because by then the
' Routing Slip ID has been assigned).
'---------------------------------------
contentLocation = "https://www.xyz.com/FormXYZ_Review.asp?RS=$routingSlipID"
contentType="HTTPS"
returnValue = FTUNewContentReference (sessionID, contentType, contentLocation)
'---------------------------------------
' Permanently save the new Routing Slip
'---------------------------------------
returnValue = FTUCreateRoutingSlip (sessionID)
'---------------------------------------
' Get Routing Slip ID
'---------------------------------------
If returnValue = "OK" Then
routingSlipNumber = FTUGetRoutingSlipID (sessionId)
Call SuccessfulAPI
ElseCall SuccessfulAPI
Call FTUError
End If'---------------------------------------
' Remove the FTU session
'---------------------------------------
returnValue = FTURemoveSession(sessionID)
Results and Explanations:
If the routing slip is created successfully, the form application performs the SuccessfulAPI subroutine to complete any application-specific tasks (e.g. saving the routing slip number in the form application database).
If the routing slip creation fails, the form application performs a general-purpose FTU error routine.
If the routing slip creation fails, the form application performs a general-purpose FTU error routine.