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:
Note: You can also post events using web services. Both techniques produce the same results.
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:
Specifies a valid user ID for authentication.
Specifies the password for the user ID.
Specifies the business unit for the role of the user ID.
Specifies the Event Source from the event details: LOGICAL, PHYSICAL, CommonDB.
In this example, the value is LOGICAL.
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.
Specifies the transaction name for the event.
As shown in the event details, in this example, the value is DATA_MEDIATION_AGGREGATION.
Specifies the name of the event type: MODIFIED, ADDED, or DELETED.
In this example, the value is MODIFIED.
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.
(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.
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$.
Specifies whether this event is partial; This value is always false.
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.
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:
cmd /c echo Posted Event: $all$ >> C:\PostEventCheck.txt
Note: You can also post an event using one of the postEvent Administration web service methods.
Copyright © 2013 CA.
All rights reserved.
|
|