2 Replies Latest reply on Dec 15, 2005 3:31 PM by ejimenez

    Delegation design

    ejimenez

      Hi guys,

      Comments from internal reviews have pointed to an essential weakness in jbpm's design that I think we should think about. Please do keep in mind we are working in a container-based environment.

      Basically, is there any reason why jbpm must set fields on actions at classloading as opposed to passing a map to the execute method with the action's parameters? How hard would it be to change that?

      The reason is we would like to use JNDI or some other mechanism to be able to deploy our actions completely separately from our central code, so that adding a new process definition is a matter of deploying any dependent classes in their own ear plus deploying the process definitions.

      Using the classes directory in the process definitions doesn't work, as most actions are somewhat reusable and we would hate to have to duplicate them in the file system before deployment.

      By changing how parameters are passed to actions, it makes it easier for us to implement a custom way to call actions, say through JNDI.

      Anyone has any/other ideas about this?

        • 1. Re: Delegation design
          kukeltje

          Where do you want to pass parameters from? Currently they are passed from the process definition. I developed a generic action that takes a list (or a map) as one parameter. This generic list contains info on what to do next, including a jndi name, which kan pass on the list (and other process related info) to an ejb.

          Do you mis functionality this way?

          • 2. Re: Delegation design
            ejimenez

            Ok, been doing some more research. How do you pass a list or a map from a process definition?

            What I could use is the config-type constructor with a generic class, parse the XML string and pass that as properties to an EJB that complies with the action handler interface plus the reception of the map.

            Wouldn't it be possible though to come up with an Instantiator that makes the call to an EJB instead? One problem now is that the Instantiator receives a class instead of a String.

            Anyhow, just trying to find the simplest way to do this. Let me know how to pass a map as config for an action though. Apologize if this ends up being a user question instead of a design one.