Java Business Process Management |
jBpm FAQ'sLazyInitializationExceptionERRORYou get a net.sf.hibernate.LazyInitializationException while using an object that you received from one of the jbpm services.ANSWERBefore jbpm-2.0-beta2, this problem must tackled with an Assembler. An assembler is an object that specifies the graph of objects that you want to obtain from a jbpm service method. As of jbpm-2.0-beta3, there is no need for an Assembler any more. See below Where did the Assembler go ?PROBLEMYou get compiler errors because Assembler does not exist.ANSWERFrom jbpm-2.0-beta3, your Assembler object is not necessary any more. An assembler is an object that specifies the graph of objects that you want to obtain from a jbpm service method. This graph was completely fetched from the database before the session was closed at the end of the jbpm service method. The new approach keeps the session open between the open...Service methods and the service.close(). So jbpm can now give you lazy loaded objects that you can access (and load transparantly). As long as the lazy loading does not occur outside of the open-close block of the jbpm service.ORA-01401PROBLEMjava.sql.BatchUpdateException: ORA-01401: inserted value too large for column while trying to deploy a process on an oracle database.ANSWERActually there's two problems that need to be solved :
Group assignmentQUESTIONHow to handle assignment of tasks to groups ? Suppose you want to model following process behaviour : You have a group of employees. When execution of a process arrives in a state the task should be assigned to the group. Then all of the members of the group should be able to perform the work related to the task, but we must avoid that 2 members start doing the same task. ANSWERGroup assignment is a form of process based assignment. For an introduction about process based assignments and for the explanation about how states relate to tasks, I would like to point to the jpdl section about assignments. jBpm is not aware of differences between groups and individual members. As far as jBpm is concerned, they (people, groups and systems) are all actors with an actorId (java.lang.String). The typical solution to this problem is to make a distinction between individual tasks and group tasks in the user interface. The user interface used to provide access to jBpm should know about the groups and members. For a given user, the user interface can then present the personal tasks in a separate list as the tasks assigned to all the groups of which the person is a member. The tasks in the personal lists can be performed by that user. That means that some form of navigation should be present that directs to a form. Submission of the form leads to a call to jBpm. No such navigation should be possible from the list of tasks assigned to a group. Instead, tasks assigned to one of the users' groups should have an action 'take'. Taking an action from a group means reassignment of the task from the group to the person that takes the task. After the reassignment, the task disappears from the group task list and appears in the personal task list. After reassignment, the user that took the task is the only one able to navigate to the form corresponding that task. Note that only the first person that takes a group task is able to do that. junit error in ant build scriptERRORBUILD FAILED C:\Software\eclipse-2.1.2\workspace\jbpm2\build.xml:38: Following error occured while executing this line C:\Software\eclipse-2.1.2\workspace\jbpm2\common.build.xml:92: Could not create task or type of type: junit. Ant could not find the task or a class this task relies upon. This is common and has a number of causes; the usual solutions are to read the manual pages then download and install needed JAR files, or fix the build file: - You have misspelt 'junit'. Fix: check your spelling. - The task needs an external JAR file to execute and this is not found at the right place in the classpath. Fix: check the documentation for dependencies. Fix: declare the task. - The task is an Ant optional task and optional.jar is absent Fix: look for optional.jar in ANT_HOME/lib, download if needed - The task was not built into optional.jar as dependent libraries were not found at build time. Fix: look in the JAR to verify, then rebuild with the needed libraries, or download a release version from apache.org - The build file was written for a later version of Ant Fix: upgrade to at least the latest release version of Ant - The task is not an Ant core or optional task and needs to be declared using ANSWERRun 'ant install.ant.libs' in ${jbpm.home}. That target will copy the libs lib/junit/junit-3.8.1.jar and lib/clover/clover.jar into your ${ant.home}/lib directory. |