Running the Debugger From an Event Handler
Aptify includes the ability to run the Process Flow Debugger tool each time an Event Handler is fired by a particular user so that the process of firing a process flows from an event handler to automatically execute business-specific logic within the system can be tested. A developer can choose to test all process flows within the Aptify system or select certain process flows to be tested by specifying the appropriate values through the ProcessFlow User Values option which is found under an administrator or developer user's Aptify Button menu options. When the necessary scope has been specified, Aptify generates the appropriate User Values records for the administrator's or developer's User ID. Then, if an event handler exists for a process flow specified in the user's User Values record, the Aptify Process Flow Debugger Tool launches automatically each time the event handler is fired by the administrator/developer user. An administrator/developer can then go back and turn the tool off when finished testing. An administrator/developer can also turn on the debugger tool for a specific user by manually creating the necessary User Values record for a particular user.
This topic covers the following procedures:
- Defining Process Flow User Values
- Running the Debugger Tool From an Event
- Specifying a Non-Administrative User to Run the Debugger Tool
- Turning Off the Debugger Tool
Defining Process Flow User Values
Follow the steps below to define which process flow(s) should be debugged.
- Log into Aptify with a user account that has system administrator/developer privileges.
- Select the Aptify Button > ProcessFlow User Values menu option.
- This item is grayed out for non-administrator or non-developer users.
- If you want to run the debugger tool for a non-administrator or non-developer user, an administrator can manually create User Value records for a particular user. See Working with Process Components for more details.
- Select the scope of the debugger tool by selecting a value from the ProcessFlow Debugger Tool drop-down menu:
- Off: The debugger tool is turned off for all process flows runs from an Event Handler. However, you can still run the debugger tool from a Process Flow itself. See Running the Debugger From a Process Flow for details.
- All: The debugger tool will be launched for all Process Flows that are fired from an Event Handler.
- Defined List: Only process flows selected from the ProcessFlow List will launch in debug mode.
- If you select Defined List as the scope, specify the process flows to test by selecting the ProcessFlow List option next to the appropriate process flow(s) in.
- Click OK to save the changes and close the ProcessFlow Debugger User Value dialog.
- The appropriate User Values records are automatically generated or modified for the current user based on the scope specified.
Running the Debugger Tool From an Event
If an event handler exists for a process flow specified in the ProcessFlow User Values dialog, the Aptify Process Flow Debugger Tool launches automatically each time the event handler fires. Once the event handler is fired (for example, after a record is saved) and the debugger tool is launched, follow the steps below to utilize the tool:
- Enter a test value for each of the process flow's inputs.
- Note that the debugger enforces data type validation for input map values and prompts you if a value you enter is inconsistent with the input property's data type when you attempt to execute a process flow test run.
- Note that the debugger enforces data type validation for input map values and prompts you if a value you enter is inconsistent with the input property's data type when you attempt to execute a process flow test run.
Click the Run the process flow without stopping icon (the green arrow head in the toolbar) to execute the process flow.
Note that any action performed by the process flow is applied to the database so this tool should not be run on a production server.
Alternatively, you can use the debugger tool to set up breakpoints in the process flow and then step through process flow to review the results of a particular step.
When you select Run the process flow without stopping, the tool runs the -process flow and displays the result code it obtained based on the values you entered. Note that the displayed result code is the Process Flow Result Code for the specific step the test ended on (and not the step's result code).
- Click OK to close the message and return to the debugger tool and review the Step Log information as necessary.
If the process flow failed, follow these general steps to correct the error:
- Review the Step Log to determine where the error occurred.
- Close the debugger tool.
- If necessary, open the Session Exceptions viewer to review the data log messages generated for more information about this process flow's execution.
- The Session Exceptions viewer can be accessed from the Aptify > Session Exceptions menu item. See Using the Desktop Client Session Exception Viewer for more information.
- The Session Exceptions viewer can be accessed from the Aptify > Session Exceptions menu item. See Using the Desktop Client Session Exception Viewer for more information.
- Modify the process flow as needed based on the error information.
- Save the process flow.
- Rerun the debugger tool (by initiating the event handler again) to test the process flow again.
Once you are satisfied with your tested and are finished using the debugger tool, you need to turn the tool off for the particular process flow. See Turning Off the Debugger Tool for more details.
The debugger tool also supports an option to add breakpoints in the execution so you can step through the process flow and review the results prior to continuing to the next step in the logic.
Specifying a Non-Administrative User to Run the Debugger Tool
The ProcessFlow User Value dialog is only available for users who have administrative or developer privileges. However, an administrator or developer can turn on the debugger tool for a non-administrative user by manually creating the necessary User Values record for a particular user if needed by following the steps below.
- Log into Aptify using an account that has system administrator/developer privileges.
- Open a new record from the User Values service.
- The Users Values service is found under the User Administration application by default.
- The Users Values service is found under the User Administration application by default.
- Enter the username of the test user in the UserID field.
- This field links to the Users service.
- This field links to the Users service.
- Enter ProcessFlow Debugger Scope in the Name field.
- Enter the scope of the debugger tool for the particular user in the Value field.
- All: The Debugger Tool will be launched for all Process Flows that are fired from an Event Handler.
- Defined List: Only process flows specified in the ProcessFlow List will launch in debug mode.
- Save and close the record.
If you specified All as the scope of the debugger tool, no additional steps are necessary and you can begin testing. (See Running the Debugger Tool From an Event for details.) However, if you specified Defined List as the scope, an additional User Values record must be created to define the process flows that will launch in debug mode. Follow the steps below to create a list of process flows to debug.
- Open a new record from the User Values service.
- The Users Values service is found under the User Administration application by default.
- The Users Values service is found under the User Administration application by default.
- Enter the username of the test user specified in the scope record in the UserID field.
- Enter ProcessFlow List in the Name field.
- Enter the ID of each process flow to be tested, separated by a comma in the Value field.
- Save and close the record.
Turning Off the Debugger Tool
Once you are finished debugging the specified process flow(s) through an Event Handler, follow one of the methods below to turn off the Process Flow Debugger tool.
Turning Off Debugger Tool for an Administrator User
If you want to turn off the Process Flow Debugger Tool for an administrator/developer user, follow the steps below:
- Log into Aptify with the user associated with the debugger tool.
- Select the Aptify Button > ProcessFlow User Values menu option.
- Select Off from the ProcessFlow Debugger Tool drop-down menu.
- If you want to continue to use the debugger on additional process flows in a defined list, you can also disable the debugger tool for a specified process flow by clear the selection next to the appropriate process flow.
- If you want to continue to use the debugger on additional process flows in a defined list, you can also disable the debugger tool for a specified process flow by clear the selection next to the appropriate process flow.
- Click OK to save the changes and close the ProcessFlow Debugger User Value dialog.
- The appropriate User Values records are automatically modified for the current user based on the scope specified.
Turning Off Debugger Tool for a Non-Administrator User
If you want to turn off the Process Flow Debugger Tool for a non-administrative user, you must do so manually by modifying the appropriate User Values record for the user. Follow the steps below:
- Log into Aptify using an account that has system administrator/developer privileges.
- Go to the User Values service.
- The Users Values service is found under the User Administration application by default.
- The Users Values service is found under the User Administration application by default.
- Open the appropriate User Values record.
- To find the appropriate User Values record, use the following search criteria:
- UserID: ID of user you want to disabled the debugger tool for.
- Name: ProcessFlow Debugger Scope
- Modify the value in the Value field to Off.
- Save and Close the record.
Copyright © 2014-2019 Aptify - Confidential and Proprietary