ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Viraf Bankwalla <viraf_bankwa...@yahoo.com>
Subject Re: Adding Business Relevant Data to Events
Date Sat, 27 Jan 2007 04:28:18 GMT
Thanks for your comments.  I too was concerned about what the performance impact would be.
 I have a couple of questions:

   I noticed that you proposed the context to be added to BpelEvent.  My understanding was
that the process variables would only be available for Scope events.  What other information
do you think would be useful ?

   Could you point me to an example that I can use as a basis to get process variables given
a scope id.
   Is the capture of event data currently under consideration or development ?  If so, does
the implementation follow your proposal ?  If this is not under consideration / development
would this be something that would be added to the ode codebase?
Thanks - viraf

Maciej Szefler <mbs@intalio.com> wrote: Viraf,

I think what you are after is a valid use case. However, the proposed
implementation is not practical. There is simply too much variable
data to be loading it from the store every time an event is issued.
Not only would it be expensive to read this data, but it would make
persistence of the events very expesnive as well. What would make more
sense is to provide a "context" object for the listeners that would be
able to retrieve the information on demand. (as opposed to
pre-populating the event object with this information). That way if
your listener is interested in some variable it could easily obtain
it. This is possible currently (with PMAPI), but it is rather
inconvenient. So basically something along the lines:

class BpelEvent {
  public transient BpelEventContext context;

interface BpelEventContext  {
   getVariableData(scopeId, varname);


On 1/26/07, Viraf Bankwalla  wrote:
>       There is a need to determine the state of a process and provide metrics on the
process.  The current implementation of ODE provides the mechanism by which to emit events
(as defined in ODE Execution Events), and notify observers of the event.  The event structure
lacks the process context ("VariableData') that may be needed by observers.  I would like
to propose that 'variableData' be added to the 'ScopeEvent' so that observers have business
context.  Your feedback on the proposed changes would be appreciated.
>   1.      The ScopeEvent would be updated to include
>         private HashMap variableData;
>   2.      Populate variableData
>   All events get fired from ACTIVITY object.  The following retrieves variable data and
populates variableData in the scope object.
>   In org.apache.ode.bpel.runtime.ACTIVITY replace the code for sendEvent(ScopeEvent event)
with the following code
>   protected void sendEvent(ScopeEvent event)
>   {
>       if (event.getLineNo() == -1 && _self.o.debugInfo != null)
>       {
>           event.setLineNo(_self.o.debugInfo.startLine);
>       }
>       _scopeFrame.fillEventInfo(event);
>       fillVariableInfo(event);   // Add variableData to ScopeEvent
>       getBpelRuntimeContext().sendEvent(event);
>   }
>   /**
>   * Adds process context to the ScopeEvent as variableData
>   *
>    * @param event The ScopeEvent to which the process context is to be added
>    */
>   protected void fillVariableInfo(ScopeEvent event)
>   {
>       HashMap variableData = new HashMap();
>       Iterator variableNames = _scopeFrame.oscope.variables.keySet().iterator();
>       while(variableNames.hasNext())
>       {
>           String name = variableNames.next();
>           String value = "";
>           Variable var = _scopeFrame.oscope.variables.get(name);
>           VariableInstance varInst = _scopeFrame.resolve(var);
>           try
>           {
>               Node varNode = getBpelRuntimeContext().fetchVariableData(varInst, false);
>               value = DOMUtils.domToString(varNode);
>           }
>           catch (FaultException e)
>           {
>           }
>           variableData.put(name, value);
>         }
>     event.setVariableData(variableData);
>   }
> Look forward to your commnets.
>  Thanks
> - viraf
> ---------------------------------
> Have a burning question? Go to Yahoo! Answers and get answers from real people who know.

Any questions?  Get answers on any topic at Yahoo! Answers. Try it now.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message