2 Replies Latest reply on Oct 8, 2007 8:57 AM by Jo Geraerts

    Seam Managed ActionHandler

    Jo Geraerts Newbie

      Hello all,

      I'm trying to create a seam managed Action Handler for a jbpm node ( not a task node ). I want to inject a variable into this action which is outjected in a another SLSB.


      My process definition:

      
      <?xml version="1.0"?>
      <process-definition name="inkless">
       <start-state name="start">
       <transition name="" to="node1"></transition>
       </start-state>
       <end-state name="end1"></end-state>
       <node name="node1">
       <action name="action1" expression="#{bar.foo}"/>
       <transition name="" to="end1"></transition>
      
       </node>
      
      </process-definition>
      
      


      The code that creates the process and Outjects a Context variable:

      
      @Stateless
      @Name("inklessProcessManager")
      @Interceptors(SeamInterceptor.class)
      public class InklessProcessManagerImpl implements InklessProcessManager {
      
       @Out(scope=ScopeType.BUSINESS_PROCESS, value="foo") Integer someThing;
      
       @CreateProcess(definition="inkless")
       public void startProcess() {
       someThing=new Integer(5);
       }
      
      }
      
      


      And now my actionhandler which is called in the process definition:

      
      @Stateless
      @Name("bar")
      @Interceptors(SeamInterceptor.class)
      public class BlahBlahActionHandler implements IActionHandler {
      
       /* (non-Javadoc)
       * @see com.melexis.inkless.IActionHandler#foo()
       */
       @In(value="foo", scope=ScopeType.BUSINESS_PROCESS) Integer foe;
      
      
       @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
       public void foo(){
       System.out.println("Foooooooooooooo");
       System.out.println(foe);
       }
      
      }
      
      


      And finally the exception i receive:

      
      Caused by: javax.ejb.EJBException: org.jboss.seam.RequiredException: In attribute requires non-null value: bar.foo
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
       at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:253)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
       at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
       at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
       at $Proxy101.foo(Unknown Source)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
       at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
       at org.javassist.tmp.java.lang.Object_$$_javassist_2.foo(Object_$$_javassist_2.java)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
       ... 170 more
      
      


      I'm just starting out with jboss seam so it might be my own incompetence, but i think i understood the documentation correctly.

      Can someone point out what i'm doing wrong? Thank you.


      Best regards,


      Jo