HOW TO: Use the Shell Command Service in Cloud Application Integration

Version 3

    You can use the Shell Command Service in Cloud Application Integration to execute scripts such as UNIX scripts or Windows batch files through a Cloud Application Integration process. You can use the Run a Shell Command action in a Service step to automate the call to a shell command as shown in the following image:

    Shell Command step123.jpg
    Note that the Run a Shell Command action can be executed only on a process that runs on an agent.

     

    This article describes how you can use the Shell Command Service to run a command on a Linux machine. The ZIP file attached to this article contains a sample CAI process. You can import the process in Application Integration and review the design. In this process, you execute ‘echo ‘ (which is a built-in command for Linux) and write the output to a file:

     

    echo "successful" > /data/gcsadmin/myscriptdir/outputfile.txt

     

    Perform the following steps to execute the process:

     

    1. Log in to your Informatica Intelligent Cloud Services organization.
    2. Open the Application Integration Console service.
    3. Click Processes (with the agent option) > Server Configuration > System Services > Shell Service and select the Enable Shell Service option as shown in the following image:
      Enable Shell Service.jpg
    4. Click Save.
    5. Open the process named ShellCommandProcess. Make sure that it is set to run on the agent.
    6. Publish the ShellCommandProcess process.
    7. Under Properties Details, copy the URL of the process.
    8. Open a browser, paste the URL, and press Enter. The process executes successfully as shown in the following image:
      Process Execution.jpg
    9. Access the output file on the Linux machine. The output file contains the text ‘successful’ as shown in the following image:
      OutputFile.jpg
    10. Open the Application Integration Console service.
    11. Click Processes (with the agent option). A completed process instance appears as shown in the following images:

    ShellCommandProcessInstance.jpg

     

    Process Steps Screenshot.jpg

    In case the process does not complete successfully, you can review the Catalina.log file available in the following location:

    $Agent\apps \process-engine\logs
    Note:
    You might receive the following error message if the Shell Command Service is not enabled in the agent process console (as shown in step 3 above):
    SEVERE: org.activebpel.rt.AeException: Access denied. at com.activee.rt.shellcmd.invoke.AeShellCmdInvokeHandler.handleInvoke(AeShellCmdInvokeHandler.java:47)