Integration Server 10.7 | Publish-Subscribe Developer’s Guide | Working with webMethods Messaging Triggers | Creating a webMethods Messaging Trigger | Creating Conditions
 
Creating Conditions
A condition associates one or more publishable document types with a single service. A webMethods messaging trigger subscribes to the publishable document type in a subscription. The service, called a trigger services, processes instance of the document type received by the trigger.
A condition can be a simple condition or a join condition. A simple a condition associates one publishable document type with a service. A join associates more than one publishable document types with a service and specifies how the trigger handles the documents as a unit.
A webMethods messaging trigger must have at least one condition.
Keep the following points in mind when you create a condition for a webMethods messaging trigger:
*The publishable document types and services that you want to use in a condition must already exist.
*A webMethods messaging trigger can subscribe to publishable document types only. A webMethods messaging trigger cannot subscribe to ordinary IS document types.
*An XSLT service cannot be used as a trigger service.
*Conditions must meet additional requirements identified in webMethods Messaging Trigger Requirements.
*Trigger services must meet additional requirements identified in Trigger Service Requirements.
*If a webMethods messaging trigger subscribes to a publishable document type that is not in the same package as the trigger, create a package dependency on the package containing the publishable document type from the package containing the trigger. This ensures that Integration Server loads the package containing the publishable document type before loading the trigger.
*If a webMethods messaging trigger uses a trigger service that is not in the same package as the trigger, create a package dependency on the package containing the trigger service from the package containing the trigger. This ensures that Integration Server loads the package containing the service before loading the trigger.
*To create a condition for a webMethods messaging trigger
1. In the Package Navigator view of the Service Development perspective, open the webMethods messaging trigger for which you want to set a condition.
2. Under Conditions, click to add a new condition.
3. Under Condition detail, in the Name field, type the name you want to assign to the condition. Designer automatically assigns each condition a default name such as Condition1 or Condition2. You can keep this name or change it to a more descriptive one.
4. In the Service field, enter the fully qualified service name that you want to associate with the publishable document types in the condition. You can type in the service name, or click to navigate to and select the service.
5. Click under Condition detail to add a new document type subscription for this webMethods messaging trigger .
6. In the Select dialog box, select the publishable document types to which you want to subscribe. You can select more than one publishable document type by using the CTRL or SHIFT keys.
Designer creates a row for each selected publishable document type. Designer enters the name of the messaging connection alias used by each publishable document type in the Connection Alias column.
7. In the Filter column next to each publishable document type, do the following:
*If the publishable document type uses webMethods Broker as the messaging provider, specify a filter that you want Integration Server and/or webMethods Broker to apply to each instance of this publishable document type. For more information, see Creating Filters for Use with webMethods Broker .
*If the publishable document type uses Universal Messaging as the messaging provider, specify the local filter that you want Integration Server to apply to each instance of the publishable document type received by the trigger. For more information, see Creating Filters for Use with Universal Messaging .
Create the filter in the Filter column using the conditional expression syntax described in webMethods Service Development Help.
Filters are optional for a trigger condition. For more information about filters, see Using Filters with a Subscription.
8. If the publishable document type uses Universal Messaging as the messaging provider, in the Provider Filter (UM only) column, enter the filter that you want Universal Messaging to apply to each instance of the publishable document type. Universal Messaging enqueues the document for the trigger only if the filter criteria is met. For information about the syntax for provider filters for Universal Messaging, see the Universal Messaging documentation. For more information about using filters in trigger conditions, see Creating Filters for Use with Universal Messaging .
9. If you specified more than one publishable document type in the condition, select a join type.
Join Type
Description
All (AND)
Integration Server invokes the trigger service when the server receives an instance of each specified publishable document type within the join time-out period. The instance documents must have the same activation ID. This is the default join type.
Any (OR)
Integration Server invokes the trigger service when it receives an instance of any one of the specified publishable document types.
Only one (XOR)
Integration Server invokes the trigger service when it receives an instance of any of the specified document types. For the duration of the join time-out period, Integration Server discards any instances of the specified publishable document types with the same activation ID.
10. Repeat this procedure for each condition that you want to add to the webMethods messaging trigger .
11. Click File > Save.
Notes:
*Integration Server validates the webMethods messaging trigger before saving it. If Integration Server determines that the webMethods messaging trigger is invalid, Designer prompts you to save the webMethods messaging trigger in a disabled state. For more information about valid webMethods messaging triggers, see webMethods Messaging Trigger Requirements.
*Integration Server establishes the subscription locally by creating a trigger queue for the webMethods messaging trigger .
*If the trigger subscribes to one or more publishable document types that use webMethods Broker as the messaging provider, one of the following happens upon saving the trigger.
*If Integration Server is currently connected to the webMethods Broker, Integration Server registers the trigger subscription with the webMethods Broker by creating a client for the trigger on the webMethods Broker. Integration Server also creates a subscription for each publishable document type specified in the webMethods messaging trigger conditions and saves the subscriptions with the webMethods messaging trigger client. webMethods Broker validates the filters in the webMethods messaging trigger conditions when Integration Server creates the subscriptions.
*If Integration Server is not currently connected to a webMethods Broker, the webMethods messaging trigger will only receive documents published locally. When Integration Server reconnects to a webMethods Broker, the next time Integration Server restarts Integration Server will create a client for the webMethods messaging trigger on the webMethods Broker and create subscriptions for the publishable document types identified in the webMethods messaging trigger conditions. webMethods Broker validates the filters in the webMethods messaging trigger conditions when Integration Server creates the subscriptions.
*If the trigger subscribes to a publishable document type that uses Universal Messaging as the messaging provider, one of the following happens upon saving the trigger.
*If Integration Server is currently connected to Universal Messaging, Integration Server creates a durable subscription on the channel that corresponds to the publishable document type. A durable subscription can also be referred to as a “durable”.
*If Integration Server is not currently connected to Universal Messaging, you need to synchronize the publishable document type with the provider when the connection becomes available. Synchronizing creates the durable subscription on the channel that corresponds to the publishable document type.
*If a publishable document type specified in a webMethods messaging trigger condition does not exist on the webMethods Broker (that is, there is no associated webMethods Broker document type), Integration Server still creates the trigger client on the webMethods Broker, but does not create any subscriptions. Integration Server creates the subscriptions when you synchronize (push) the publishable document type with the webMethods Broker.
*If a publishable document type specified in a webMethods messaging trigger condition does not exist on Universal Messaging, Designer displays an error stating that a channel does not exist for the specified document type.
*When creating a condition, you can specify the trigger service by dragging a service from Package Navigator view and dropping it in the Service field. Additionally, you can specify the document types to which the webMethods messaging trigger subscribes by dragging one or more document types from Package Navigator view and dropping them in the table in Condition detail.
*If you need to specify nested fields in the Filter field, you can copy a path to the Filter field from the document type. Select the field in the document type, right-click and select Copy. You can then paste into the Filter field. However, you must add % as a preface and suffix to the copied path.