WebLogic Integration


com.bea.wlpi.server.plugin
Interface EventContext


public interface EventContext

Provides run-time context and services to plugin event and start nodes. The framework passes an instance of this interface to the PluginEvent.activate(com.bea.wlpi.server.plugin.EventContext, com.bea.wlpi.server.common.ExecutionContext) and PluginStart.setTrigger(com.bea.wlpi.server.plugin.EventContext, java.lang.String) methods.

Since:
WebLogic Process Integrator 2.0
Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
PluginEvent, PluginStart, EventInfo, StartInfo

Method Summary
 void activateEvent(ExecutionContext context, java.lang.String contentType, java.lang.String eventDescriptor, java.lang.String keyValue, java.lang.String condition)
          Perform default event activation.
 void checkEventKey(java.lang.String contentType, java.lang.String eventDescriptor, java.lang.String keyExpr)
          Ensure that a suitable event key exists.
 java.lang.String getNodeID()
          Return the ID of the event or start node.
 java.lang.String getTemplateDefinitionID()
          Return the ID of the workflow template definition.
 PluginObject getTemplateDefinitionPluginData(java.lang.String pluginName)
          Return the plugin template definition data for the specified plugin.
 java.lang.String getTemplateID()
          Return the ID of the workflow template.
 PluginObject getTemplatePluginData(java.lang.String pluginName)
          Return the plugin template data for the specified plugin.
 void postStartWatch(java.lang.String contentType, java.lang.String eventDescriptor, java.lang.String keyValue, java.lang.String condition)
          Register an event processor watch record for the specified message.
 void postStartWatch(java.lang.String contentType, java.lang.String eventDescriptor, java.lang.String keyValue, java.lang.String condition, java.lang.String startOrg)
          Deprecated. Plugin start nodes should call postStartWatch(String, String, String, String) instead.
 void removeEventWatch(ExecutionContext context)
          De-register the event processor watch record for the specified message.
 void removeStartWatch()
          De-register the event processor watch record for the specified message.
 

Method Detail

getTemplateID

public java.lang.String getTemplateID()
Return the ID of the workflow template.

Returns:
The template ID.
See Also:
#getNodeID

getTemplateDefinitionID

public java.lang.String getTemplateDefinitionID()
Return the ID of the workflow template definition.

Returns:
The template definition ID.
See Also:
#getNodeID

getTemplatePluginData

public PluginObject getTemplatePluginData(java.lang.String pluginName)
Return the plugin template data for the specified plugin.

Parameters:
pluginName - The reverse-DNS plugin name.
Returns:
Plugin's template data.

getTemplateDefinitionPluginData

public PluginObject getTemplateDefinitionPluginData(java.lang.String pluginName)
Return the plugin template definition data for the specified plugin.

Parameters:
pluginName - The reverse-DNS plugin name.
Returns:
Plugin's template definition data.

getNodeID

public java.lang.String getNodeID()
Return the ID of the event or start node.

Returns:
The node ID.
See Also:
getTemplateID(), getTemplateDefinitionID()

activateEvent

public void activateEvent(ExecutionContext context,
                          java.lang.String contentType,
                          java.lang.String eventDescriptor,
                          java.lang.String keyValue,
                          java.lang.String condition)
                   throws WorkflowException
Perform default event activation. This consists of checking whether the event processor has already received and persisted a message addressed to this workflow instance or template. If such a message exists, is of the required content type and event descriptor, and its key value matches the key value (if any) specified by the caller, and the conditional expression (if any) also evaluates to true, the matching event is consumed and the event node triggered. If no such message exists, the method posts an event watch record.

Parameters:
context - The workflow execution context passed to the caller.
contentType - The MIME content type of the event data.
eventDescriptor - Event data format descriptor, in a plugin-defined format appropriate to the content type. Can be null.
keyValue - The key value required to trigger this event. Can be null.
condition - A conditional expression to evaluate to against the event data. The condition must evaluate to true to trigger the event. Can be null.
Throws:
EJBException - if the event watch could not be posted.
java.lang.UnsupportedOperationException - if the method is called from other than a PluginEvent node.
See Also:
PluginEvent.activate(com.bea.wlpi.server.plugin.EventContext, com.bea.wlpi.server.common.ExecutionContext)

postStartWatch

public void postStartWatch(java.lang.String contentType,
                           java.lang.String eventDescriptor,
                           java.lang.String keyValue,
                           java.lang.String condition,
                           java.lang.String startOrg)
Deprecated. Plugin start nodes should call postStartWatch(String, String, String, String) instead.
Register an event processor watch record for the specified message.

Parameters:
contentType - The MIME content type of the event data.
eventDescriptor - Event data format descriptor, in a plugin-defined format appropriate to the content type. Can be null.
keyValue - The key value required to trigger this event. Can be null.
condition - A conditional expression to evaluate to against the event data. The condition must evaluate to true to trigger the event. Can be null.
startOrg - An expression which, when evaluated, yields the ID of the organization in which to instantiate the workflow.
Throws:
EJBException - if the start watch could not be posted.
java.lang.UnsupportedOperationException - if the method is called from other than a PluginStart node.
See Also:
removeStartWatch()

postStartWatch

public void postStartWatch(java.lang.String contentType,
                           java.lang.String eventDescriptor,
                           java.lang.String keyValue,
                           java.lang.String condition)
Register an event processor watch record for the specified message.

Parameters:
contentType - The MIME content type of the event data.
eventDescriptor - Event data format descriptor, in a plugin-defined format appropriate to the content type. Can be null.
keyValue - The key value required to trigger this event. Can be null.
condition - A conditional expression to evaluate to against the event data. The condition must evaluate to true to trigger the event. Can be null.
Throws:
EJBException - if the start watch could not be posted.
java.lang.UnsupportedOperationException - if the method is called from other than a PluginStart or PluginStart2 node.
Since:
WebLogic Integration 2.1 (Plugin Framework 2.1)
See Also:
removeStartWatch()

removeEventWatch

public void removeEventWatch(ExecutionContext context)
De-register the event processor watch record for the specified message. This method should only be called by a PluginEvent node.

Parameters:
context - The workflow execution context passed to the caller.
Throws:
EJBException - if the event watch could not be removed.
java.lang.UnsupportedOperationException - if the method is called from other than a PluginEvent node.

removeStartWatch

public void removeStartWatch()
De-register the event processor watch record for the specified message. This method should only be called by a PluginStart or or PluginStart2 node.

Throws:
EJBException - if the start watch could not be removed.
java.lang.UnsupportedOperationException - if the method is called from other than a PluginStart or PluginStart2 node.
See Also:
postStartWatch(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

checkEventKey

public void checkEventKey(java.lang.String contentType,
                          java.lang.String eventDescriptor,
                          java.lang.String keyExpr)
                   throws WorkflowException
Ensure that a suitable event key exists. The method calls EventInfo.getFieldInfo() or StartInfo.getFieldInfo() to retrieve the information it requires to check for the existence of a suitable event key, and to create or update one if necessary. If keyExpr is non- null, the method creates a new event key if it does not already exist, or updates an existing event key if its keyExpr does not match that supplied by the plug-in. If keyExpr is null and no matching event key exists, the method throws a WorkflowException with the code Messages#EVENT_KEY_MISSING. This method can only be called by a PluginStart, PluginStart2, or PluginEvent node. This is an expensive call and plug-ins should take steps to minimize its use, typically by keeping a static flag to ensure that it is only called once per event key.

Parameters:
contentType - The MIME content type.
eventDescriptor - The content type specific schema identifier.
keyExpr - The expression to be used to extract the key value from an incoming message of the specified content type and event descriptor. Can be null.
Throws:
EvaluatorException - If keyExpr is non-null but invalid.
WorkflowException - If a communications error or other exception occurred. Also thrown if keyExpr is null and no such event key already exists.
Since:
WebLogic Integration 7.0

WebLogic Integration

WebLogic Integration (WLI)