You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by Matthieu Riou <ma...@gmail.com> on 2007/02/01 18:23:54 UTC

Re: Adding Business Relevant Data to Events

Hi Raja,

I just had a look at your patch and it looked pretty good so I've committed
it in the trunk. An update should bring it in.

Thanks a lot for the nice patch and keep it up! I wish we had more of them
:)

Matthieu

On 1/31/07, Raja Balasubramanian/MAXIMUS <Ra...@maximus.com>
wrote:
>
> Maciej,
>
> Could you please post your opinion about the JIRA issue ODE-91.
> Hope it follows your recommendations.
> Thank you
> Raja
>
>
> -----Original Message-----
> From: Maciej Szefler [mailto:mbs@intalio.com]
> Sent: Friday, January 26, 2007 2:46 PM
> To: ode-dev@incubator.apache.org
> Subject: Re: Adding Business Relevant Data to Events
>
> 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);
>    .
>    .
> }
>
>
> -mbs
>
> On 1/26/07, Viraf Bankwalla <vi...@yahoo.com> 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<String, String> 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<String,String> variableData = new
> HashMap<String,String>();
> >       Iterator<String> 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.
> >
>