Previous Topic: Delete an ActionNext Topic: Scheduler


How to Post an Event

You can post an event as an automated way to mimic an action by a user, for example, a catalog user submitting a request, a request manager approving a request, or a catalog administrator updating the details of a user or business unit. In both cases (posted event or user action), when the event occurs, its rules are evaluated. If the conditions for a rule are met, the rule actions are executed.

Posting events is useful for performing such tasks using automation and with specific values and actions. For example, you can post events to specify custom values for the integration between CA Service Catalog and another CA product. This topic explains how to post a CA Service Catalog event through HTTP URL. You can also use this URL in rule actions whose type is HTTP Post.

Important! If you post an event, test it thoroughly before moving it to a production environment. Verify that the event does not run cyclically if the action is triggered.

To post an event, follow this process:

  1. Gather the data from the event to construct the HTTP URL.
  2. Specify the HTTP URL. This topic uses a URL example to illustrate how to post an event.

    Note: You can also post events using web services. Both techniques produce the same results.

  3. Verify that the event is posted.

Gather the Data from the Event to Construct the HTTP URL

Gather the following values from the event definition for the URL.

This example uses the Data Mediation Aggregation event on the Tools, Events-Rules-Actions page. Click the event name to display the details of the event, including the following details. Use these details to help specify the HTTP URL, as illustrated in the following text:

Specify the HTTP URL

To specify the HTTP URL to post an event to the system, use the following syntax:

Note: In the following line and in the example that follows, the line breaks are for readability only. In the product UI, enter this code as a single continuous line.

http://hostname:port/usm/wpf?Node=icguinode.postevent
&username=userid&pass=password&domain=businessunit
&Args=eventsource&Args=nsppath&Args=transactionname&Args=eventtypename
&Args=transactiontype&Args=eventdescription&Args=associatedobjectid
&Args=false&Args=param1|oldvalue1!param#|oldvalue#!
&Args=param1|newvalue1!param#|newvalue#!

An example URL follows:

http://hostname:port/usm/wpf?Node=icguinode.postevent
&username=spadmin&pass=spadmin&domain=ca.com&Args=LOGICAL
&Args=DATA_MEDIATION_AGGREGATION:MODIFIED
&Args=DATA_MEDIATION_AGGREGATION&Args=MODIFIED&
Args=LOGICAL&Args=Modified&Args=$id$&Args=false
&Args=end_date|abc!start_date|abc!status|123!status_date|abc!
&Args=end_date|abd!start_date|abd!status|124!status_date|abd!

Note: When you post an event via URL from Java or some other tools you may need to encode the URL by replacing unsupported characters with codes. For example, you may need to replace the ampersand (&) with %26 or replace a single blank space with %20.

Note: The Catalog system uses both old and new values when it evaluates rule filters for event rules.

The following parameters require explanation:

userid

Specifies a valid user ID for authentication.

password

Specifies the password for the user ID.

businessunit

Specifies the business unit for the role of the user ID.

eventsource

Specifies the Event Source from the event details: LOGICAL, PHYSICAL, CommonDB.

In this example, the value is LOGICAL.

nsppath

Specifies the namespace path, a placeholder value only. The Catalog system does not use the actual value but requires a placeholder value.

Use the following format:

<Transaction Name>-<Transaction Type>

<Transaction Type> - MODIFIED, ADDED, or DELETED.

<Transaction Name> - As displayed in event details

In this example, the value is DATA_MEDIATION_AGGREGATION:MODIFIED.

transactionname

Specifies the transaction name for the event.

As shown in the event details, in this example, the value is DATA_MEDIATION_AGGREGATION.

eventtypename

Specifies the name of the event type: MODIFIED, ADDED, or DELETED.

In this example, the value is MODIFIED.

transactiontype

Specifies the transaction type for the event.

This value is the same as the value of the eventsource parameter.

In this example, the value is LOGICAL.

eventdescription

(Optional for web service) Specifies a description for the event.

Specify the Transaction Type as displayed in event details.

In this example, the value is Modified.

associatedobjectid

Specifies the ID of an object to associate with this event.

You can optionally specify one of the event parameters for this value. This value is used to associate the alert that was logged in Change Events.

This example uses a dummy value: $id$.

ispartial

Specifies whether this event is partial; This value is always false.

param#|oldvalue#

Specifies the parameter name and the old value. Delimit the name and value with a vertical bar. Separate each name and value pair with an exclamation point.

In this example, the value is as follows:

end_date|abc!start_date|abc!status|123!status_date|abc!

Note: This example uses dummy values for event attributes. Do not specify a value for the $all$ attribute, because it reads all values.

param#|newvalue#

Specifies the parameter name and new value. Delimit the name and value with a vertical bar. Separate each name and value pair with an exclamation point.

In this example, the value is as follows:

end_date|abd!start_date|abd!status|124!status_date|abd!

The note for the previous parameter also applies to this parameter.

Verify that the Event is Posted

To verify that an event is posted, Follow these steps:

  1. Disable all the rules for the event that you are posting.
  2. Enable only one rule with no filter and one command line action, as follows:
    cmd /c echo Posted Event: $all$ >> C:\PostEventCheck.txt
    
  3. Verify that the PostEventCheck.txt file is created on the C:\ drive of the application server for CA Service Catalog.

Note: You can also post an event using one of the postEvent Administration web service methods.

More information:

Using Web Services