1 2 Previous Next 22 Replies Latest reply on Oct 20, 2005 3:30 AM by tom.baeyens Go to original post
      • 15. Re: jBPM Concerns
        ejimenez

        Well, is the current Scheduler clusterable? That is, if I have two jbpm instances on two app servers, can I run the scheduler on both and guarantee and if one server goes down, the other will take its scheduler load? It sounds to me like I can only run the scheduler on one box at a time (I could be wrong however).

        On the other hand, for most of my scope, I don't care about a business calendar because I'm dealing with either automated systems or 24/7 staff.

        Tom, any possiblity, if my contributions are acceptable, to have access to the CVS?

        Thanks,

        Ed

        • 16. Re: jBPM Concerns
          mangeshd

          Hi I'm new to JBPM development. I want to know if the JBPM server has an in-built web-server..?? If not then how can I invoke JBPM classes thru a servlet running on a separate web-server ?

          • 17. Re: jBPM Concerns
            tom.baeyens

            a few points i would like to add to this whole (interesting) thread:

            The main issue I have is that each task in the workflow needs to be an automated task, ... I know that someone will tell me add the automated tasks as action events, but this will not proved the level of control I require.


            correct. Our vision has refined on that matter. Both nodes and actions can have code associated to it. Only nodes can behave as wait states (actions cannot). The distinction between nodes and actions is visibility. That distinction is made by the business analyst role. The business analyst should be free to model his graph. And the developer must be able to add details to make that graph executable. So if a piece of code should be executed you have to ask yourself : "does this code need to be represented visually ?" or "is the business analyst interested in this piece of code ?" if yes, then you model it as a node. if no, you model it as an action.

            in the next release (3.1) you'll find better support for asynchronous nodes and actions. where till now, you have to include actions to send jms messages and invoke the process callbacks (with signal) yourself, this will be all integrated in jbpm with an attribute async="true" on a node or an action. a configuration will determine wether you use the built in (plain J2SE) messaging system or wether you want to use JMS.


            is the current Scheduler clusterable?


            you as a user have to make sure that there is exactly 1 scheduler running. in case for a simple webapp that is deployed only once this is simple. in a clustered configuration, you can use something like the jboss singleton service to accomplish this.


            Enterprise Integration Patterns book


            The first book i recommend when integrating systems. It is interesting because it covers amongst others, all asynchronous communication patterns in detail. That book, written by Gregor Hohpe and Bobby Woolf is all that you need.

            ESB

            JBoss is also starting on an ESB project. It is not yet in the same stage as mule or others. It's in sketchy-white-board-diagrams-stage. But we are going to catch up soon. And since this project is backed by professional open source, i would give it more chance of survival in the long run. But if you need something now, it might be a little to soon.

            regards, tom.

            • 18. Re: jBPM Concerns
              ejimenez

              Hi tom,

              Thanks for taking the time. I really appreciate it. I have some questions about the async support being added to jBPM having briefly looked at the code on the CVS, which I understand is not release quality yet.

              How are callbacks going to be handled in your impl? Currently, and correct me if i'm wrong, jBPM only supports internally-induced events, or explicit signaling (toekn.signal takes default, token.signal(transition) takes a specific one). Internally-induced events are things like node-enter, node-leave, etc.

              In my mind, when I want something executed asynchronously, I would not want that component to even know what should be done next (like signal the process), so my plan was to add externally-induced events, where actions would be invoked asynchronously through queueing and an event would be raised once the action is complete onto an event queue. From the event queue, I would then map the event to a transition by adding an event-choice node to the definition. In addition, the event could come with some data important for the process, so I was planning to add support for event data mappings to process variables.

              The nice thing about this is that actions don't really care about signal, all they must do is queue the operation on the action's queue. When they are done, they raise an event, and all the signaling logic is wihin the event queue MDB, which in my mind is sort of an automated process execution core.

              What I saw on the CVS implementation was that a command mechanism is being put in place, where you have to send a signal command to the process from an async action to get it to continue processing, and to me, that is coupling the actual action to the workflow definition, which can be very bad. Its also not clear to me how the queueing system will work....will it be one message queue per async action? will it be one queue for all async actions? What about callbacks? One queue per process instance? Per engine?

              Knowing what you will do can save me tons of work, so I just want to know what direction you are taking.

              • 19. Re: jBPM Concerns
                ejimenez

                One more thing, another way to implement events is simply to use the existing event tag, but use custom strings for the event types, then use actions to specify which transition to take and each custom event object can contain the process variable mappings by way of action configuration when the action request is created.

                Just another idea that might actually be simpler to implement.

                • 20. Re: jBPM Concerns
                  tom.baeyens

                  ejimenez,

                  i don't get your point yet. it would be great if you could help me in finding where we see things differently.

                  1) indeed a command mechanism is used. but should be jbpm internal stuff. the user only has the ability to specify that certain nodes or actions have to be executed asynchronously.

                  2) when a node or an action is marked as asynchronous, the node execution or the action execution is done asynchronously. jbpm creates the command and sends it over the async messaging system. the command executor picks it up and executes the node or the action respectively.

                  3) the execution of an action is plain atomic. just that action is executed and done with it. the execution of the action has no influence on the original path of execution (=token).

                  4) when the execution of a node is done asynchronously, the node can do some business logic (e.g. an automated action that needs to be represented in the process diagram) and then the node can propagate the execution. if the node does not propagate the execution it means that the node behaves as a wait state, which always requires a new trigger (=signal) from outside of jbpm. but the node can decide to continue the execution itself after it is done.

                  so the advantage is that you don't have to mess with message queing yourself. the process definition contains the information on how execution is continued asynchronously (meaning in a different transaction). all the user has to do is write pojo code.

                  i don't see yet your differentiation between internal and external induced events.

                  scalability is solvable, but i'm still looking for the most elegant way on how to get the best flexibility. by default jbpm will use 1 queue to send all the commands to. in case of JMS, you could install competing consumers to execute the commands. i think that the jbpm async messaging will not yet support competing consumers. we could think of adding that but that is probably not a priority. if you want scalability, you probably use an app server with JMS available any way... to further increase the scalability, we could think of specifying the name of the queue to use in the async attribute on the node or the action. that way you could distribute the load of command messages over multiple queues (e.g. one per priority) and have competing consumers on the end of every queue.

                  We should also be cautious with asyncrhonous continuations and isolation of transactions. We could introduce inefficiencies when we produce a set of commands in 1 transaction that relate to 1 process instance. These would become available to the command executor on the same moment. So chances are high that you get lock-requests colliding because all those commands want to lock the same process instance... that is the part where i want to make sure that we don't introduce these kinds of situations by default and that is not yet all clear in my head.

                  regards, tom.

                  • 21. Re: jBPM Concerns
                    ejimenez

                    Tom,

                    Your description of the chosen method is great. Like I said I had briefly looked at the code and initially couldn't fit the pieces toghether. It is in fact not too different from what I planned to do.

                    My domain is a bit different than typical business processes. In my domain, processes rarely will continue without knowing the result of an action. The reasoning behind using asynchronous actions is performance related. My actions can take a lot of time (3+ secs) which will block app server threads from the main app thread pool. The reason we will use asynchronous nodes is of a way to do non-blocking invocation of business logic, hence allowing the app to work on other processes if one process is waiting for the result of an action.

                    So, your model works great for me, except for two things: I need individial queues for individual actions to isolate performance issues (like one action taking 30 seconds to complete bringing the entire app down), which as you indicated might not be too hard to add to your current model byway of a parameter.

                    But second, I need some way of being notified that a process needs attention, otherwise, how do I know when to call Token.signal(), or GraphElement.fireEvent()? In other words, in a way, I want to treat the workflow engine as a black box: here's something I need done, give me a process id, and call me back when you are done. Wrapping jbpm in a JMS queue (not related to what you are doing) and have an MDB there listening for "events" from asynchronous actions. If such events were handled as custom events using jBPMs current structure, an example logic for that MDB could be:

                    ? If the process is active, the event?s payload is mapped to process variables and the event is fired immediately. If the event is not being expected, simply ignore it
                    ? If the process instance is paused, the event is added to a pending event list within the process instance. Once the process instance is resumed, each event will be fired in the order it was received. Each event's action is free to clear the pending event queue if such events should no longer apply.
                    ? If the process has been terminated, the event is ignored.
                    ? If the process has hung, the event is added to its pending event queue in case it can be picked up later if the process is reset.

                    Under such a framework, tasks could simply be asynchronous actions, that at some point will raise an event, like TaskComplete or TaskAborted, etc.

                    It may just be that there are already ways to do this from within jBPM and if so, I'd like to hear about them, and see some docs too! :)

                    • 22. Re: jBPM Concerns
                      tom.baeyens

                      your first comment is valid. in some way or another, it should be possible to specify the queue per async process element. but it will be for a later version. the configuration issue needs to be addressed properly. first of all we need to work out how to easily configure the queues for both the jbpm messaging and JMS. second, there might be indirection: e.g. some async events might want to use a round-robin on a set of queues. since i want to carefully balance those options, i want to postpone this feature for now and put it in another release.

                      the second issue i don't get yet.

                      regards, tom.

                      1 2 Previous Next