0 Replies Latest reply on Jun 2, 2012 3:43 AM by leutenmayr

    How to properly invoke a Seam component method externally e.g. from Drools

    leutenmayr

      Hi,

       

      I am using Seam 2.2.0 on JBoss 4.2.3 and Drools 5.2. I have a problem invoking a Seam component method from Drools engine. As in Seam 2.2.0 there is no support for a KnowledgeBase and Knowledge Session, I build them in a Seam component and use a separate thread for starting knowledgeSession.fireUntilHalt() which has the Drools engine to continually evaluate the rules. From those rules I want to execute a Seam component method of my application. If I invoke the method from the rule directly by calling className.methodName(), I assume that no bijection takes place (and also no transaction management), because I dont have the entityManager or other injections available. I then tried to get the component by Seam.componentForName and invoke callComponentMethod, but no context is active in this case.

       

      So, what would be the proper way of invoking a Seam component method from a rule in the Drools engine?