You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Gianfranco Boccalon <gi...@eng.it> on 2007/11/19 18:39:40 UTC

Missing Variable value in VariableModificationEvent

Hi all,
I have a problem on a listener that I wrote for monitoring my processes.
My process contains a Invoke activity, so the events that I receives are:
.....

ActivityExecStartEvent:
        Type = activityLifecycle
        ActivityType = OInvoke

ProcessMessageExchangeEvent:
        Operation = getOrder

VariableModificationEvent:
        Type = dataHandling
        VarName = wsOutput

ActivityExecEndEvent:
        Type = activityLifecycle
        ActivityType = OInvoke
.....


In correspondance of the VariableModificationEvent, I try to retrieve 
the variable value through the EventContext, but I receive null.
I tried also to delay the retrieving of the value in the 
ActivityExecEndEvent, but I get always null.

Is there a way to get the value of the response variable used in the 
invoke activity ?

Thanks
Gianfranco Boccalon

Re: Missing Variable value in VariableModificationEvent

Posted by Gianfranco Boccalon <gb...@tiscali.it>.
Sure, if you provide the new variable value directly in the event, it 
should be ok for me.

Thanks
Gianfranco


Matthieu Riou ha scritto:
> On Nov 21, 2007 5:09 AM, Gianfranco Boccalon <gb...@tiscali.it> wrote:
>
>   
>> I solved my problem, but I think that this is an ODE bug or
>> misunderstanding about events.
>> The problem was that I receveid a VariableModificationEvent, but asking
>> for the variable value through the eventContext, I was getting null.
>>
>> The problem was that the variable for what I'm receiving the
>> VariableModificationEvent, was not in the current scope, but in a parent
>> scope: so the only solution I found was storing also the previous
>> contexts and when such situation occurs, I search also in the previous
>> scopes (the parent scopes).
>>
>> This workaround works only if the process is executed with "in-memory"
>> mode, and I think that this can be a problem in real world processes.
>>
>> Any suggestion ?
>>
>>     
>
> I'm now regretting the addition of this method on EventContext as there's no
> way it can be fixed for persistent processes. The problem is that when you
> receive an event, the transaction is usually not committed yet, so relying
> on a finder to get the variable value won't return anything from the
> database. The variable scoping problem can be fixed but not the
> transactional one.
>
> So I think I'm going to deprecate this interface and now include the
> variable new value directly in the event. Would that work for you?
>
> Cheers,
> Matthieu
>
>
>   
>> Gianfranco Boccalon
>>
>>
>>
>> Gianfranco Boccalon ha scritto:
>>     
>>> Hi all,
>>> I have a problem on a listener that I wrote for monitoring my processes.
>>> My process contains a Invoke activity, so the events that I receives
>>>       
>> are:
>>     
>>> .....
>>>
>>> ActivityExecStartEvent:
>>>        Type = activityLifecycle
>>>        ActivityType = OInvoke
>>>
>>> ProcessMessageExchangeEvent:
>>>        Operation = getOrder
>>>
>>> VariableModificationEvent:
>>>        Type = dataHandling
>>>        VarName = wsOutput
>>>
>>> ActivityExecEndEvent:
>>>        Type = activityLifecycle
>>>        ActivityType = OInvoke
>>> .....
>>>
>>>
>>> In correspondance of the VariableModificationEvent, I try to retrieve
>>> the variable value through the EventContext, but I receive null.
>>> I tried also to delay the retrieving of the value in the
>>> ActivityExecEndEvent, but I get always null.
>>>
>>> Is there a way to get the value of the response variable used in the
>>> invoke activity ?
>>>
>>> Thanks
>>> Gianfranco Boccalon
>>>
>>>       
>>     
>
>   


Re: Missing Variable value in VariableModificationEvent

Posted by Matthieu Riou <ma...@offthelip.org>.
On Nov 21, 2007 5:09 AM, Gianfranco Boccalon <gb...@tiscali.it> wrote:

> I solved my problem, but I think that this is an ODE bug or
> misunderstanding about events.
> The problem was that I receveid a VariableModificationEvent, but asking
> for the variable value through the eventContext, I was getting null.
>
> The problem was that the variable for what I'm receiving the
> VariableModificationEvent, was not in the current scope, but in a parent
> scope: so the only solution I found was storing also the previous
> contexts and when such situation occurs, I search also in the previous
> scopes (the parent scopes).
>
> This workaround works only if the process is executed with "in-memory"
> mode, and I think that this can be a problem in real world processes.
>
> Any suggestion ?
>

I'm now regretting the addition of this method on EventContext as there's no
way it can be fixed for persistent processes. The problem is that when you
receive an event, the transaction is usually not committed yet, so relying
on a finder to get the variable value won't return anything from the
database. The variable scoping problem can be fixed but not the
transactional one.

So I think I'm going to deprecate this interface and now include the
variable new value directly in the event. Would that work for you?

Cheers,
Matthieu


>
> Gianfranco Boccalon
>
>
>
> Gianfranco Boccalon ha scritto:
> > Hi all,
> > I have a problem on a listener that I wrote for monitoring my processes.
> > My process contains a Invoke activity, so the events that I receives
> are:
> > .....
> >
> > ActivityExecStartEvent:
> >        Type = activityLifecycle
> >        ActivityType = OInvoke
> >
> > ProcessMessageExchangeEvent:
> >        Operation = getOrder
> >
> > VariableModificationEvent:
> >        Type = dataHandling
> >        VarName = wsOutput
> >
> > ActivityExecEndEvent:
> >        Type = activityLifecycle
> >        ActivityType = OInvoke
> > .....
> >
> >
> > In correspondance of the VariableModificationEvent, I try to retrieve
> > the variable value through the EventContext, but I receive null.
> > I tried also to delay the retrieving of the value in the
> > ActivityExecEndEvent, but I get always null.
> >
> > Is there a way to get the value of the response variable used in the
> > invoke activity ?
> >
> > Thanks
> > Gianfranco Boccalon
> >
>
>

Re: Missing Variable value in VariableModificationEvent

Posted by Gianfranco Boccalon <gb...@tiscali.it>.
I solved my problem, but I think that this is an ODE bug or 
misunderstanding about events.
The problem was that I receveid a VariableModificationEvent, but asking 
for the variable value through the eventContext, I was getting null.

The problem was that the variable for what I'm receiving the 
VariableModificationEvent, was not in the current scope, but in a parent 
scope: so the only solution I found was storing also the previous 
contexts and when such situation occurs, I search also in the previous 
scopes (the parent scopes).

This workaround works only if the process is executed with "in-memory" 
mode, and I think that this can be a problem in real world processes.

Any suggestion ?

Gianfranco Boccalon



Gianfranco Boccalon ha scritto:
> Hi all,
> I have a problem on a listener that I wrote for monitoring my processes.
> My process contains a Invoke activity, so the events that I receives are:
> .....
>
> ActivityExecStartEvent:
>        Type = activityLifecycle
>        ActivityType = OInvoke
>
> ProcessMessageExchangeEvent:
>        Operation = getOrder
>
> VariableModificationEvent:
>        Type = dataHandling
>        VarName = wsOutput
>
> ActivityExecEndEvent:
>        Type = activityLifecycle
>        ActivityType = OInvoke
> .....
>
>
> In correspondance of the VariableModificationEvent, I try to retrieve 
> the variable value through the EventContext, but I receive null.
> I tried also to delay the retrieving of the value in the 
> ActivityExecEndEvent, but I get always null.
>
> Is there a way to get the value of the response variable used in the 
> invoke activity ?
>
> Thanks
> Gianfranco Boccalon
>