Skip to main content
This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.
LinkedIn
Copied!

Table of Contents

Calling web services using queued execution

To preserve business data integrity across multiple Pega 7 Platform instances, messages can be sent asynchronously from one system to another. If the receiving system is unable to receive the message, the message can be queued until it can be resent later.

While a process is running, invoked web services cannot return a message. Instead, the SOAP Connector Invoke activity maps the outbound data to the list of Java objects that are saved as a parameter on the parameter page. The connect activity calls the RequestProcessor queueConnectRequest method instead of calling the SOAP service. This method creates a queue item instance in the PegaRULES database, saves the primary page, parameter page, and dequeuing options to it, and sets the status to “scheduled” for an agent to resend the message.

You must have a functioning connector to use this feature.

Suggested approach

To enable web services queuing, do the following tasks:

Select a queue

You can either use the default queue (System-Queue-ExecutionRequest-Connect-Default) or create a queue by defining a new concrete class within the System-Queue-ExecutionRequest-Connect- class.

Create a connect request processor

The connect request processor defines the queue location and dequeuing options for the queued connection. To define a new connect request processor:

  1. Click Create > Integration-Resources > Connect Request Processor.
  2. On the New Rule Instance tab, enter a short description in the Short Description field of the connect request processor.
  3. In the RuleSet field, enter the ruleset name that you want to save the connect request processor to. The ruleset name must be the same name as the Connect rule that you are using.
  4. In the Request processor field, enter the connect request processor name.
  5. On the Queuing Options tab, enter the queue class name in the Queue class name field to specify the queue that you want to store the queued messages in.
  6. On the Dequeuing Options tab, specify what actions cause items to be removed from the queue.
  7. Click Save to save the connect request processor.

Edit the connect rule

The connect rule needs to specify that the request must be queued instead of processed immediately. To edit the connect rule:

  1. Open the connect rule.
  2. On the Service tab, in the Processing options section, select the queuing (response will not be available) option from the Intended for field.
  3. In the Request processor field, enter the request processor that you created earlier.

Edit the connect activity

Set the connect activity to run the connect rule in queued mode. To edit the connect activity:

  1. Open the connect activity.
  2. Expand the step that runs the web service.
  3. In the form for the ExecutionMode field, select Queue.
  4. Because queuing a connection request is a database operation, include a Commit step in one of the following ways:
  • After the web service invocation step in this activity
  • In the parent activity that calls the connect activity
Even if the activity does not contain any explicit database operations, you cannot save the queue to the database without a Commit step.

Test the web service

You can test the web service process to ensure that all the connections work correctly.

  1. Run the process that invokes the web service.
  2. View the instances of the queue class that you specified in the connect request processor. The Instances dialog box shows the instance and its status.Instances dialog box that shows when an instance was created and its status.

    Instances dialog box

    If you do not configure your connect request processor to keep items in the queue after successful completion, queue instances with a success status are not displayed.
Suggest Edit
Did you find this content helpful?

60% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us