States are for situations where a process has to wait e.g. for an external trigger. Where that comes from does not matter. It might be a system from a different company with it's own workflow etc... Can be a webapp as well.
And yes, actionhandlers do not have any dependency on the webcontext.
What is the best way to build this solution ?
Totally depends on the other system. You can do anything from the actionhandler you can in plain java.
Sorry if this is some kind of old discussion in the forum, I looked for a post about this kind of issue and didnt find any.
Did you use the search in the forum or did you use google? The latter is better (at the moment)
Thanks for the quick answer.
So I used my imagination and i came up with the following solution.
My Action Handler gets the HttpServletResponse from the FacesContext, then it takes the actual token from the Execution Context. Now I use the JNDI to publish an object that holds, among other things, the token. The idea is that the external application (which has been started using the redirect method of the HttpServletResponse) should trigger the signal on the token, so it can fallow some outgoing transition. I don't think this is the most clever solution, but in my point of view it should work ! Working is all i need for now. Unfortunately the implementation is not as simple as i thought it would be. I'm having some problems while publishing the token object at the jndi tree. Whenever I try to bind it to a jndi name I get an exception, thrown by the FacesServlet:
17:56:53,686 ERROR [[FacesServlet]] Servlet.service() for servlet FacesServlet threw exception java.lang.NoClassDefFoundError: Lorg/jbpm/graph/exe/Token; at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2259) at java.lang.Class.getDeclaredField(Class.java:1852) at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1582)
I've already put the jbpm-jpdl.jar file in the the $CLASSPATH, in the jboss lib dir, in the $JBOSS_CLASSPATH. And Still I get the same Exception. Even when I try to pass the Token to another component (a plain java Object, for example).
By the way, I'm using Jbpm-jpdl-3.2.GA.
Did anyone already saw something like that ?
Has anybody already been through this kind of issue ? (use of a token from another web application)
I believe this shouldn't happen at all!