[Design of JBoss jBPM] - batch-size of jbpm runtime objects
by tom.baeyens@jboss.com
recently someone queried us about the batch size of the jbpm runtime objects and why they were not set to a proper default. based on Max's input on what batch-size on the class level actually is, i think that jBPM can't really define a good batch-size except the default for 1.
"Max" wrote :
| > | Is there a reason why batch-size isn't set to a reasonable default
| > | on the various jBPM runtime objects?
| >
| > would that make sense ?
|
| depends.
|
| Let me see if i can explain this via pure email (i normally do fancy drawings and gestures to explain the voodoo-magic)
|
| Basically/naivelly speaking batch-size defaults to 1.
|
| Meaning that when Hibernate is asked to get some object by id from the db, e.g 42 it will try and load this single object by id 42.
|
| By increasing this on the class level to eg. <class name="Blah"
| batch-size="5" ..>
| then instead of just loading the one(1) matching the given id(42) hibernate will look in its cache and see if there is up-to 5 more non-initialized proxies that can be fetched. If there is hibernate will do something like "select ... from Blah where id in (42, 32, 4, 3, 17)"
| instead of just id = 42. Hence optimally a reduction in requests to the db of factor 5.
|
| So, batch-size > 1 on classes make sense if you often have a bunch of un-initialized objects in the session that it would be relevant to get in batches of selects instead of single selects.
|
| The above is for class instances; but the same is valid for collections.
| They too
| have a batch-size option. This is not about getting a 20 element collection in e.g. 4 selects it is about loading multiple complete collections in fewer selects.
|
| The same logic as above applies. e.g. blah.getChildren() is internally viewed as "get the children collection for blah with id 42" (assuming blah's id is
| 42 of course).
| Here the default is to get that one collection, but alternatively Hibernate can look around and see if there are more uninitialized *collections* of the same role (Blah.children) and load those in one go. Again, this can be a very efficient optimization to e.g. load hiearchies of entities.
|
| There are alternatives such as fetch="subselect" which instead of using in
| (x,y,z) creates
| a sub query select based on what you just fetched. This requires a bit more drawings for me to explain (and i actually did that when you here - remember ? :)
|
| > should i have a look at what that is ?
|
| yes.
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964917#3964917
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964917
19 years, 7 months
[Design of JBoss jBPM] - debugger api
by tom.baeyens@jboss.com
"Alex" wrote : Providing a debugger API is a compelling task. I thought about it for a while and here are my first ideas. Comments are welcome :)
|
| Debugging is about setting breakpoints in the process *definition*, intercepting the *execution* and then stepping through the following steps. jBPM already offers a mechanism to observe the execution of a process. I can think of providing debugging facilities by creating a process instance with runtime actions installed at the node-enter event of every activity. I will call them "interceptors".
|
| There are two execution modes, "continuous" or "step-by-step". In the former, only interceptors marked as "breakpoints" can suspend the process execution. In the latter, all interceptors can suspend execution.
|
| Communication between the BPEL runtime and the debugger occurs through some remoting technology. EJBs are an option, but web services seem more appropriate since BPEL is about web services.
|
| The exposed operations are:
|
| setBreakpoint(processName: QName, activityName: String)
| ----
| Mark the interceptor at the entrance of the specified activity, which belongs to the specified process, as a breakpoint.
|
| debug(processName: QName) : ProcessInstanceHandle
| ---
| Create an instance of the specified process for debugging purposes. Returns a handle to the newly created instance.
|
| getBranches(instanceHandle: ProcessInstanceHandle) : List
| ---
| Retrieves the execution branches of the specified process instance.
|
| stepInto(branchHandle: ProcessBranchHandle)
| ---
| Executes the specified branch up to the next activity. If the branch currently points to a scope, execution will proceed up to the activity nested within the scope.
|
| stepOver(branchHandle: ProcessBranchHandle)
| ---
| Executes the specified branch up to the next activity. If the branch currently points to a scope, execution will proceed up to the activity that follows the scope.
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964910#3964910
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964910
19 years, 7 months
[Design of JBoss jBPM] - Re: create start task inconsistency
by tom.baeyens@jboss.com
That is indeed an inconsistency which is not easy to solve in the current architecture. The idea is that in jbpm 4, the architecture will change in a way that makes it easier to fix this.
Now modules are pluggable. The idea is that you can just plug in or rip out the task management module from a jbpm deployment. That is why the plain process instantiation code cannot have a direct reference to the task managment module to see if there needs a task to be created. If we want to fix this in the current architecture, we would have to expand the current event mechanism to span multiple modules. Now, events are generated in the graph and propagate to the process instance. To accomodate auto task instance creation, we would have to dispatch this event over the module instances once it arrives at the process instance level. Also we should dispatch it over the process definition and all module definitions.
This cumborsome and difficult eventing mechanism is one of the reasons why we want to go forward with a different architecture.
Modules will not be pluggable in the way they are now. A ProcessInstance will contain the plain graph execution runtime information (as now) but it will NOT contain any module instances. Instead, to add new module instances, inheritence should be used. That way, we will create a JpdlProcessInstance that contains the jPDL modules in the object model. This will remove the module instance indirection and reduce the navigation in the database, thereby significantly improve performance as well.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964907#3964907
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964907
19 years, 7 months
[Design of JBoss jBPM] - create start task inconsistency
by tom.baeyens@jboss.com
"Jeff" wrote :
| | Start-state taskInstances are not created when the
| | start-state is entered.
| |
| | Instead,
| |
| | TaskInstance taskInstance =
| | taskMgmtInstance.createStartTaskInstance();
| |
| | must be performed by the client (the jBPM web app does this).
| |
| | This seems to be inconsistent, in that task-nodes create
| | taskInstances if a task is specified in the task-node
| | definition (and create-task is not set to false). Also
| | problematic for a Seam application, in that there is not easy
| | way to tell Seam that this process definition has start tasks
| | and must be handled differently.
| |
| | However it is not clear how to fix this. Start-nodes are not
| | "entered" or "executed" like other nodes, so there is no good
| | place to hang the invocation to
| | taskMgmtInstance.createStartTaskInstance.
| |
| | Thoughts?
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964905#3964905
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964905
19 years, 7 months