Hi Rene,
most of the times the new event classes you are adding automatically have
the right TYPE value (declared in the class BpelEvent) because you place
them in the class hierarchy. For example when your class extends the class
ActivityEvent the TYPE of the new event class is automatically
activityLifecxycle. This is the case because the method getType in
ActivityEvent is implemented to return this TYPE.
The classes with names in capitals like ACTIVITY are implementing the
behavior of the different BPEL constructs. So, if you want to throw a new
event it must happen in such a class. The class you place your new event in
must also extend the class ACTIVITY because the method sendEvent is
implemented there.
In order to place your event in the right class, just debug through the
classes and find a suitable position for it. For example I inserted a
LinkSetTrue event in the run method of the class TCONDINTERCEPT because
there was code that evaluated link conditions:
boolean val = evaluateTransitionCondition(olink.transitionCondition);
linfo.pub.linkStatus(val);
//Check if linkstatus was set to true or
false
if (val) {
//Before a link is set to true we have
to throw an event.
LinkSetTrueEvent linkSetTrueEvent
= newLinkSetTrueEvent();
sendEvent(linkSetTrueEvent);
} else {
//Throw an event when a link is set to
false
LinkSetFalseEvent linkSetFalseEvent =
new LinkSetFalseEvent();
sendEvent(linkSetFalseEvent);
}
Hope that helps
Daniel
On Thu, Oct 29, 2009 at 2:03 PM, ReneR. <[email protected]> wrote:
>
> Thanks for your help!
>
> But i still got some more questions. I found the event classes and I think
> its also clear to me how to add them. I just need to add my new
> event-classes to the enum TYPEs, right?
> The biggest problem I have right now is that I dont understand where I need
> to say WHEN the events are sent. I looked up the ACTIVITY class, but i
> didnt
> find anything helpfull there.
>
> We want to create some new activities that use BPEL to connect to a
> datasource.
> Because of that we first need to create these activities and also the
> events
> for that, for example "Connection_TimeOut" or something like that. So right
> now I want to know, if i created that event, where do I say that the event
> should be thrown?
>
> It would be helpfull, if someone could give me a small example, like an new
> hello world event and how to integrate it in ODE.
>
>
>
> Daniel Schleicher wrote:
> >
> > Hi Rene,
> >
> > all ODE-Events are located in the package "org.apache.ode.bpel.evt". Here
> > you can add your new event-classes. An event can only be thrown if you
> > integrate the new event class in the event hierarchy. The root class of
> > this
> > hierarchy is "org.apache.ode.bpel.evt.BpelEvent".
> >
> > To throw an event the method "sendEvent" of the class
> > "org.apache.ode.bpel.runtime.ACTIVITY" musst be invoked. You can check if
> > the new event was thrown correctly if you register an event listener and
> > look for that event.
> >
> > Best regards,
> >
> > Daniel
> >
> > On Sun, Oct 25, 2009 at 6:14 PM, ReneR. <[email protected]> wrote:
> >
> >>
> >> Hello,
> >>
> >> is it possible to create your own events in ODE?
> >> We are currently working on a project with BPEL and ODE and we need to
> >> create new activities.
> >> To monitore these activities we would need some new events.
> >>
> >> So if it is possible to create own events i would also like to know how
> >> this
> >> can be done.
> >>
> >> Greetings!
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Creating-own-events-in-ODE-tp26049832p26049832.html
> >> Sent from the Apache Ode User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Creating-own-events-in-ODE-tp26049832p26112660.html
> Sent from the Apache Ode User mailing list archive at Nabble.com.
>
>