Even though an App Routine is created, it isn't available to use until it is published. However, you can, and should, test it.
In this article, we have created an example App Routine as outlined in the "App Routines - Create" article.
Test and Publish the App Routine
Make sure you have opened your newly created app routine. At the bottom of your app routine screen, you will find a More Actions button with four options:
Test App Routine: Go to a separage page where you can see if your app routine works.
Copy App Routine: Create a copy of your app routine. If the app routine is published, the new copy will be in draft.
Publish Draft: If the current app routine is in draft, you can publish it to be available to use.
See All Revisions: Once an app routine is published, it cannot be edited. You can, however, create a second draft (different from a copy), that will show up under revisions. This will be further covered below.
Let's test the app routine in our scenario. First, select the revision you wish to test. After that, you place the input you want the App Routine to process. When you click the Test App Routine button, you will see the output.
In our example app routine, you can see from above it works perfectly! We can now go back and click the Publish Draft option and the app routine screen changes to reflect it's published state.
Note that by editing either the input or the output, you will create a new copy of your App Routine. This copy will not show up under "All Revisions", because you cannot change the number of input or outputs once you publish an app routine.
Use your App Routine in your App
Once your App Routine is created, you can use it when customizing a screen with the Call Routine action.
In our example, the Call Routine action is set up as shown:
Select a Routine: Choose an active app routine defined in the app. For App Routines with multiple revisions, the published reversion will be selected.
Input Action Results: Select the value you wish to send to the App Routine. This value can be selected from an action result, a control, a session variable, or manually inputted.
Wait for the App Routine to finish before continuing (slower): Unchecking this in our scenario wouldn't make sense, since we are expecting a result.
Output Action Results: Select where you wish to store the output results of the App Routine.