3 Replies Latest reply on Mar 24, 2020 10:38 AM by Adi Leibowitz

    Wait for an external system

    Adi Leibowitz
      Share This:

      Hi All,

       

      I've seen a number of discussions around this question - with no definite answer.

       

      Let's say we need to call an external system in a DWP workflow, and then wait for that system to respond in order for the workflow to resume.

       

      Can this be achieved? The documentation around "receive task" implies that it is possible, by creating an entry in SB:ServiceRequestStub, however the details are not clear in the docs.

       

      Any idea? Does the external system simply need to create an entry in SB:ServiceRequestStub using the correct process correlation id?

       

      Thanks!

      Adi

        • 1. Re: Wait for an external system
          Paul Seager-Smith

          Hi Adi,

          It's difficult to provide the best answer here as it depends on the exact use case, but let me try to explain how some of this works.

          The SB:ServiceRequestStub is intended for use with the Remedy adapter when making requests to ITSM.

           

          Its basic purpose is to act as an information exchange mechanism between DWP-C and ITSM, but the key entry is the Process Correlation Id. The Process Correlation Id is the value that is used in DWP-C to identify which Receive Task should be notified when a response comes back to DWP-C from an external system.

          The remote action script in ITSM reads the process correlation id from the stub form and then sends a REST request back to DWP-C to notify it, which is then picked up by the receive task.

          Unfortunately the REST API to notify DWP-C is not public and hence potentially subject to change, but with a little creativity, you can figure out how it works.

          There is nothing to stop you writing directly to the stub form from DWP-C and/or some other external system, but to trigger the receive task, you need to run the remoteaction script, which is resident on the ITSM server and not easy to start manually, or call the DWP-C api/processes/signal REST endpoint. If you do this, the stub form is probably unnecessary.

          If you want to be able to call a different system and handle the response, you have a few choices:

          1. Use the synchronous REST connector to call the external system and pick up the response.
          2. Write a custom connector using RCF or Integration Services. This is the most flexible and future-proof, but also probably the most effort.
          3. Pass the Process Correlation ID and parameters to the external system and use the api/processes/signal REST endpoint to trigger a receive task and send the return parameters. Requires reverse engineering the REST endpoint, which may change in the future

           

          If you can be more specific, maybe I can help more.

          2 of 2 people found this helpful
          • 2. Re: Wait for an external system
            Adi Leibowitz

            Hi Paul,

             

            Thanks for all this info.

             

            As for my use case - I am trying to build a workflow which sends out an email with a URL to a web form hosted outside of the Remedy stack. The workflow should wait until a user has posted data to the form, and then resume execution.

             

            I'm not expecting the form to share information back with DWP, just simply trigger the rest of the workflow.

             

            Adi.

            • 3. Re: Wait for an external system
              Adi Leibowitz

              Paul,

               

              I decided to go with the un-supported api calls, as I am only building a mockup for the process.

               

              I'm posting the two calls here for anyone's benefit (and please remember this is not public/supported)

               

              Login:

               

              curl --location --request POST 'http://dwpchost:8008/api/rx/application/command' \

              --header 'Content-Type: application/json' \

              --header 'X-Requested-By: 111' \

              --data-raw '{

                  "resourceType": "com.bmc.arsys.rx.application.user.command.LoginCommand",

                  "username": "user",

                  "password": "password"

              }'

              Send Signal (use the response from the previous call as the JWT token):

              curl --location --request POST 'http://dwpchost:8008/api/myit-sb/processes/signal' \

              --header 'Authorization: JWT {your token}' \

              --header 'Content-Type: application/json' \

              --header 'X-Requested-By: 111' \

              --data-raw '{

                  "resourceType": "com.bmc.arsys.rx.application.process.command.SignalProcessInstanceCommand",

                  "processCorrelation": {

                      "resourceType": "com.bmc.arsys.rx.services.process.domain.AutomaticCorrelation",

                      "processCorrelationId": "{Process Correlation Id from DWP-C"

                  },

                  "signalInputValues": {

                      "Work Status": "Cancelled"

                  }

              }'

               

              Thank you again,
              Adi
              1 of 1 people found this helpful