TryBMC Expert GitLab

54d95f53
Name Last commit Last update
images PreFinal Version
README.md Update README.md
image.png PreFinal Version

Lab 06 - Work with RUNTIME parameters

Into this Lab we are going to work with RunTime parameters using JSON Queries in order to provide a message to the user when the job has been finished

This exercise will walk through:

  1. Define new Runtime parameters.
  2. Define a Post Execution Step
  3. Test the modifications.
  4. Deploy the new version of the Plug-In
  5. Run in Control-M

Step 1 - Define new Runtime parameters.

  1. Go back to our Application Integrator module and open the AAPIWEATHER Plug-In
  2. Into the Execution Steps select Execution - GET WEATHER and on the right pannel click on Output Handling

workspace

  1. Click on the icon workspace to create a Runtime paramenter and add the following configuration.
    • When the Response Is: Successful
    • Extract from: BODY
    • Content Type: JSON
    • If Output: $.weather[0].description & Any
    • DO: Keep value in Runtime Parameter
    • Parameter Name: DESCRIPTION

workspace

Note: To find out how to get specific values about an answer in JSON format there are different web tools (for example https://www.jsonquerytool.com/) where you can paste the answer in the page and test your variables using JSON Query. workspace

  1. Add a new runtime parameter using the icon workspace with the following values.
    • When the Response Is: Successful
    • Extract from: BODY
    • Content Type: JSON
    • If Output: $.main.temp & Any
    • DO: Keep value in Runtime Parameter
    • Parameter Name: MAINTEMP

workspace

  1. Create the last Runtime parameter click again on the icon workspace and add the following values.
    • When the Response Is: Successful
    • Extract from: BODY
    • Content Type: JSON
    • If Output: $.main.feels_like & Any
    • DO: Keep value in Runtime Parameter
    • Parameter Name: FEELTEMP

workspace

  1. Save the modifications applied.

Step 2 - Define a Post Execution Step

  1. Into the left panel select the step Post-Execution and click on the pencil icon.

workspace

  1. From the Step Interface configuration change to Command Line

workspace

  1. A new message will appear click on Change

workspace

  1. Finally click on Save (bottom right corner)

  2. Into the Post-Execution step click on the tab Command Line and into the command line editor include the following:

    • echo La temperatura en {{city}} es de {{MAINTEMP}} grados con una sensacion termica de {{FEELTEMP}} y {{DESCRIPTION}}
    • Enable the option "Append command standard output to job output"

workspace

Note: As we have mention into previous Labs you can use the option Insert Attribute to insert the attributes defined inside the job. workspace

  1. Validate the changes applied

workspace

  1. Save the changes applied.

workspace

Step 3 - Test the modifications

  1. Click on Test and under the Test Definition
    • Testing Agent: select the agent designated.
    • key: <should_appear_autocompleted>
    • RESTHost: <should_appear_autocompleted>
    • Ciudad: <enter_the_city_of_your_choice>
  2. Click on Run Test
  3. Into the right side under the Runtime Parameters sections should appear our Runtime parameters defined.

workspace

  1. Into the Test Log if we select the Post-Execution and we expand the output execution we will see the output of the command line defined in this step.

workspace

  1. Close the Test tab.

Step 4 - Deploy the new version of the Plug-In

Now we are going to publish and deploy the new version of this Plug-in

  1. click on workspace
  2. Enable the option Publish Plug-In
  3. Select the Agent designated for this Plug-In.

workspace

  1. Click on Apply

Note: If you receive a message warning about the runtime parameters click on Review Conflicts. workspace Add the following configuration for the runtime parameters workspace

  1. Our Plug-In has been updated.

workspace

Step 5 - Run in Control-M

  1. Under Control-M Web logout and login to refresh the changes.
  2. Under Planning domain select Folders and Jobs

workspace

  1. Open the folder user01-rest-api
  2. Under the Workspace opened click on Run and select workspace.

workspace

  1. Use the default values and click on Run
  2. Move to Monitoring domain open the viewpoint created previously user01_folders
  3. Under the job pending of user confirmation right click over the job and Confirm

workspace

  1. Our job will be executing and wait to be completed.
  2. Select the job go to Output tab and scroll down to see the result.

workspace

  1. Compare the output differences between job executions.

workspace

Summary

In completing this lab, now you have the knowledge to run your Application Integrator JobTypes in Control-M defining and working with Runtime Parameters. Please continue to Lab 07 In which we proceed to work execution steps.