In this article, we're going to go over how to execute a Script using Infogix Assure. There are two places where you can run an Action to execute a script: during Validation and after a Control Point Finishes.
Before you begin
Make sure you have the EXECUTE_SCRIPTS_ALLOWED property set to "true" and a scripts folder directory set in IA.properties. You will need to perform a redeploy to have these changes stick. If this isn't done beforehand, you will be unable to execute scripts with Infogix Assure.
Validate Tab
1. In the bottom of the screen when a Control Point is selected, the Validate tab is one of the tabs you can choose from. Select this tab, and select "Manage Validation Rule Sets" in the bottom right-hand corner.
2. From there, a window will pop up. Select the "Actions" tab.
3. In the Actions Tab, click on "New Action".
4. In the window that pops up in the bottom pane, select "Execute Script".
5. On this window, you can enter in the name of the Action, the script name, and any scheduling you want done for the Action. In the "Script" box, please only include the name of the script and its extension. For example: "test_script.bat", "test_script.sh", or "test_script.ksh".
6. Hit the "Apply" button once you have finished. The top window will be updated.
7. In the upper pane, your action will now appear. You have the option to add parameters as well. For more information about adding parameters, please see this article: Using Parameters with scripts executed from Infogix Assure Control Points
8. Go back to the Validate Tab. In the Validate Tab, you can now call your action under the "When Passed", "When Failed", or "When Complete" sections based on whether or not your validation rules pass, fail, or when validation has completed.
9. Click on the "New When Passed/Failed/Complete Rule".
10. A window will appear in the bottom pane. In the left box, select "Action", and in the right window, select the Action you just created.
11. The Action will now appear under the heading, as shown in the screenshot below. Hit the "Apply" button and then the "OK" button in the bottom right-hand corner of the window.
12. Save your control point.
13. Run your control point.
When a Control Point Finishes
You can also run a script when a control point has finished processing completely.
1. With your Control Point selected, click on the "More" button on the bottom right-hand corner of the screen, and select "Manage Actions".
2. In the window that appears, click on the "Actions" tab.
3. In the Actions tab, click "New Action".
4. In the window that pops up in the bottom pane, click "Execute Script".
5. On this window, you can enter in the name of the Action, the script name, and any scheduling you want done for the Action. In the "Script" box, please only include the name of the script and its extension. For example: "test_script.bat", "test_script.sh", or "test_script.ksh".
6. Hit the "Apply" button once you have finished. The top window will be updated.
7. In the upper pane, your action will now appear. You have the option to add parameters as well. For more information about adding parameters, please see this article: Using Parameters with scripts executed from Infogix Assure Control Points
8. Go back to the Process Tab. In the Process Tab, you can now call your Action you just created.
9. Click on "New When Rule".
10. In the window the appears on the bottom pane, select "Action".
11. Select the Action you just created. You can also set if the Action should happen every time a Control Point finishes or when a certain condition is met.
12. If setting an Action to run when a certain condition is met after a control point finishes, you can use the "Add Function", "Add Operation", and "Add Literal" buttons to create a condition.
13. Run your Control Point.
After Running Your Control Point
You can check the IGX logs to see if your script ran. If the return code is 0, your script has run successfully.
Comments
0 comments
Please sign in to leave a comment.