WebLogic Process Integrator Version 2.0

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
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.
 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.
 java.lang.String getTemplateID()
          Return the ID of the workflow template.
 void postStartWatch(java.lang.String contentType, java.lang.String eventDescriptor, java.lang.String keyValue, java.lang.String condition, java.lang.String startOrg)
          Register an event processor watch record for the specified message.
 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

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.
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)
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.
UnsupportedOperationException - if the method is called from other than a PluginStart node.
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.
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 node.
Throws:
EJBException - if the start watch could not be removed.
UnsupportedOperationException - if the method is called from other than a PluginStart node.
See Also:
postStartWatch(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

WebLogic Process Integrator Version 2.0

BEA WebLogic Process Integrator is a trademark of BEA Systems, Inc.
Copyright (c) 2001 BEA Systems, Inc.
All rights reserved.