[jbpm-commits] JBoss JBPM SVN: r5296 - in jbpm4/branches/jimma/trunk: modules/api and 100 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jul 15 01:27:25 EDT 2009


Author: jim.ma
Date: 2009-07-15 01:27:19 -0400 (Wed, 15 Jul 2009)
New Revision: 5296

Added:
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryComment.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetail.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTask.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTaskQuery.java
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/images/erd.history.png
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/images/erd.identity.png
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/images/erd.repo.and.runtime.png
   jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/
   jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/TaskCommentsTest.java
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/process.jpdl.xml
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendarImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryTaskQueryCmd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/TaskContext.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceCreate.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskActivityStart.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCreated.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskUpdated.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableCreate.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableUpdate.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryCommentImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryPriorityUpdateImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskAssignmentImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskDuedateUpdateImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableUpdateImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryTaskQueryImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.businesscalendar.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmCustomCfgTestCase.java
   jbpm4/branches/jimma/trunk/modules/test-cfg/
   jbpm4/branches/jimma/trunk/modules/test-cfg/.classpath
   jbpm4/branches/jimma/trunk/modules/test-cfg/.project
   jbpm4/branches/jimma/trunk/modules/test-cfg/pom.xml
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.hibernate.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.mail.properties
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/logging.properties
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskReassignTest.java
   jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/images/gpd.runtime.location.png
   jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch09-Configuration.xml
Removed:
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/Discussable.java
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/images/jbpm.erd.png
   jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/TaskCommentsTest.java
   jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/taskform/
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/async/activity/process.png
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/async/fork/process.png
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/process.jpdl.xml
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/taskform/vacation2.png
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskStart.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskHandler.java
   jbpm4/branches/jimma/trunk/modules/test-cfg/.classpath
   jbpm4/branches/jimma/trunk/modules/test-cfg/.project
   jbpm4/branches/jimma/trunk/modules/test-cfg/pom.xml
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.hibernate.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.mail.properties
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/logging.properties
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/
   jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
   jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch09-Identity.xml
Modified:
   jbpm4/branches/jimma/trunk/modules/api/pom.xml
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/ExecutionService.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/HistoryService.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstanceQuery.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java
   jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch03-MigrationFromJbpm3.xml
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch09-Configuration.xml
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch10-Persistence.xml
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch14-History.xml
   jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch16-SpringIntegration.xml
   jbpm4/branches/jimma/trunk/modules/distro/src/main/files/gpd/build.xml
   jbpm4/branches/jimma/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/distro/src/main/files/readme.html
   jbpm4/branches/jimma/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/InsertCommentCmd.java
   jbpm4/branches/jimma/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/RemoveCommentCmd.java
   jbpm4/branches/jimma/trunk/modules/examples/pom.xml
   jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
   jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
   jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java
   jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/custom/process.jpdl.xml
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/java/process.jpdl.xml
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/Order.jpdl.xml
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/swimlane/process.jpdl.xml
   jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
   jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java
   jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
   jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
   jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
   jbpm4/branches/jimma/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/migration/pom.xml
   jbpm4/branches/jimma/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartJBossTask.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Day.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/DayPart.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Holiday.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskAssign.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskComplete.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstanceImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstanceImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/TimerSession.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/HistoryServiceImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/DateVariable.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/DoubleVariable.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/LongVariable.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/StringVariable.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/BusinessCalendarBinding.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ScriptManagerBinding.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/BusinessCalendarDescriptor.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.history.hbm.xml
   jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
   jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/AutoWireTest.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
   jbpm4/branches/jimma/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/pvm/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
   jbpm4/branches/jimma/trunk/modules/test-concurrent/src/test/resources/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-db/pom.xml
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/ConcurrentEndTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/reporting/SQLStmtTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-db/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
   jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java
   jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
   jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java
   jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java
   jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
   jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java
   jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java
   jbpm4/branches/jimma/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.gpd.site.png
   jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/master.xml
   jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml
   jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
   jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch04-DeployingBusinessArchives.xml
   jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
   jbpm4/branches/jimma/trunk/qa/hudson-jbpm4-jboss.bat
   jbpm4/branches/jimma/trunk/qa/hudson-jbpm4-jboss.sh
   jbpm4/branches/jimma/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml
   jbpm4/branches/jimma/trunk/qa/test.demo.setup.bat
Log:
Merged r5295 to branch

Modified: jbpm4/branches/jimma/trunk/modules/api/pom.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/pom.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/pom.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -41,40 +41,63 @@
       <id>schemadocs</id>
       <build>
         <plugins>
-          <plugin>
+		      <plugin>
+		        <groupId>org.apache.maven.plugins</groupId>
+		        <artifactId>maven-dependency-plugin</artifactId>
+		        <executions>
+		          <execution>
+		            <id>unpack</id>
+		            <phase>process-resources</phase>
+		            <goals>
+		              <goal>unpack</goal>
+		            </goals>
+		            <configuration>
+		              <artifactItems>
+                    <artifactItem>
+				              <groupId>org.jbpm.jbpm4.dependencies.xsddoctool</groupId>
+				              <artifactId>xsddoctool</artifactId>
+				              <version>1.0</version>
+				              <type>zip</type>
+				              <outputDirectory>target/xsddoctool</outputDirectory>
+				            </artifactItem>
+				          </artifactItems>
+		            </configuration>
+		          </execution>
+		        </executions>
+		      </plugin>
+		      <plugin>
             <artifactId>maven-antrun-plugin</artifactId>
             <executions>
               <execution>
-                <id>generate-schemadocs</id>
-                <phase>package</phase>
+                <id>schemadocs-generation</id>
+                <phase>compile</phase>
                 <goals>
                   <goal>run</goal>
                 </goals>
                 <configuration>
                   <tasks>
-                    <echo message="creating schemadocs in ${basedir}/target/schemadocs" />
-                    <mkdir dir="target/schemadocs" />
-                    <taskdef name="xsddoc" classname="net.sf.xframe.xsddoc.Task" classpathref="maven.plugin.classpath" />
-                    <xsddoc out="${basedir}/target/schemadocs" title="jBPM 4 Schema's" verbose="false">
-                      <fileset dir="src/main/resources" />
-                    </xsddoc>
-                  </tasks>
+                    <java classname="com.docflex.xml.Generator" maxmemory="512m" fork="true">
+                      <classpath>
+							         <pathelement location="target/xsddoctool/xercesImpl.jar" />
+							         <pathelement location="target/xsddoctool/docflex-xml-re.jar" />
+							        </classpath>
+							        <!-- specify the template -->
+							        <arg value="-template"/>
+							        <arg value="target/xsddoctool/XSDDoc/FramedDoc.tpl"/>
+							        <arg value="-format"/>
+							        <arg value="HTML"/>
+ 							        <arg value="-d"/>
+							        <arg value="target/schemadocs"/>
+							        <arg value="-nodialog"/>
+							        <arg value="-launchviewer=false"/>
+							        <arg value="-p:docTitle=jPDL 4.0 Schema"/> 
+							        <arg value="src/main/resources/jpdl-4.0.xsd"/>
+                    </java>
+							    </tasks>
                 </configuration>
               </execution>
             </executions>
-            <dependencies>
-              <dependency>
-                <groupId>xsddoc</groupId>
-                <artifactId>xsddoc</artifactId>
-                <version>1.0</version>
-              </dependency>
-              <dependency>
-                <groupId>xalan</groupId>
-                <artifactId>xalan</artifactId>
-                <version>2.7.0</version>
-              </dependency>
-            </dependencies>
-          </plugin>
+          </plugin>         
         </plugins>
       </build>
     </profile>

Modified: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/ExecutionService.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/ExecutionService.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/ExecutionService.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -119,6 +119,10 @@
   /** end a process instance */
   void endProcessInstance(String processInstanceId, String state);
 
-  /** delete a process instance */
+  /** delete a process instance.  The history information will still be 
+   * in the database. */
   void deleteProcessInstance(String processInstanceId);
+
+  /** delete a process instance, including the history information. */
+  void deleteProcessInstanceCascade(String processInstanceId);
 }

Modified: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/HistoryService.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/HistoryService.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/HistoryService.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -25,6 +25,7 @@
 
 import org.jbpm.api.history.HistoryActivityInstanceQuery;
 import org.jbpm.api.history.HistoryProcessInstanceQuery;
+import org.jbpm.api.history.HistoryTaskQuery;
 
 
 /** exposes the history information for ongoing and past 
@@ -40,6 +41,9 @@
   /** search in history activity instance information */ 
   HistoryActivityInstanceQuery createHistoryActivityInstanceQuery();
 
+  /** search in history task information */ 
+  HistoryTaskQuery createHistoryTaskQuery();
+
   /** returns the average duration in milliseconds for each activity in the given process definition */
   Map<String, Long> avgDurationPerActivity(String processDefinitionId);
   

Modified: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -62,7 +62,4 @@
 
   /** retrieve and object defined in the process engine by name */
   Object get(String name);
-  
-  /** programmatically provide a hibernate session factory */
-  void setSessionFactory(Object sessionFactory);
 }

Modified: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,8 +21,8 @@
  */
 package org.jbpm.api;
 
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.api.history.HistoryActivityInstance;
-import org.jbpm.api.model.Comment;
 import org.jbpm.api.task.Participation;
 import org.jbpm.api.task.Task;
 
@@ -32,7 +32,7 @@
 
 /** task management.
  * 
- * @author Tome Baeyens
+ * @author Tom Baeyens
  * @author Alejandro Guizar
  * @author Heiko Braun <heiko.braun at jboss.com>
  */
@@ -87,13 +87,18 @@
   void completeTask(String taskId, String outcome);
 
   /** Deletes the task without completing it.
+   * The history information is kept in the DB.
    * If this task was created in the context of a process execution, 
    * the execution remains active and the {@link ExecutionService#signalExecutionById(String)} 
    * is to be given explicitly. */ 
   void deleteTask(String taskId);
 
+  /** deletes this task, including all history information */
+  void deleteTaskCascade(String taskId);
+
   /** Deletes the task without completing indicating the reason.  Example reasons 
    * could be: "failed", "error", "exited", "obsolete" or "deleted".
+   * The history information is kept in the DB.
    * The reason ends up as the state in the {@link HistoryActivityInstance}. 
    * If this task was created in the context of a process execution, 
    * the execution remains active and the {@link ExecutionService#signalExecutionById(String)} 
@@ -140,23 +145,20 @@
   List<Task> getSubTasks(String taskId);
 
   /** add a comment to a task */
-  Comment addTaskComment(String taskId, String message);
+  HistoryComment addTaskComment(String taskId, String message);
 
   /** get the list of comments made to a task.  this will 
    * fetch all the comments and recursively all replies to those 
    * comments. */
-  List<Comment> getTaskComments(String taskId);
+  List<HistoryComment> getTaskComments(String taskId);
 
   /** add a reply to another comment */
-  Comment addReplyComment(String commentId, String message);
+  HistoryComment addReplyComment(String commentId, String message);
 
   /** delete a comment.
    * this will recursively delete all replies to this comment. */
   void deleteComment(String commentId);
 
-  /** creates or overwrites a variable value on the given task */
-  void setVariable(String taskId, String name, Object value);
-
   /** creates or overwrites the variable values on the given task */
   void setVariables(String taskId, Map<String, Object> variables);
 

Copied: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryComment.java (from rev 5295, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryComment.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryComment.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryComment.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.history;
+
+import java.util.List;
+
+import org.jbpm.api.Execution;
+
+/** a free text comment that can be made to an {@link Execution} 
+ * or a task.  
+ * 
+ * This class also supports threaded discussions with the 
+ * {@link #getReplies()}.
+ * 
+ * @author Tom Baeyens
+ */
+public interface HistoryComment extends HistoryDetail {
+
+  /** the actual message.  Both plain text as well as HTML can be stored 
+   * as the message. */
+  String getMessage();
+
+  /** threaded replies to this comment */
+  List<HistoryComment> getReplies();
+}
\ No newline at end of file

Copied: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetail.java (from rev 5295, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetail.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetail.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetail.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.history;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/** base type for all history details.
+ * 
+ * @author Tom Baeyens
+ */
+public interface HistoryDetail extends Serializable {
+
+  /** the unique id for this comment that is used as a reference in the service methods */
+  String getId();
+
+  /** the id of the user that made this comment.  The term actorId is an abstract 
+   * reference to an entity in an external identity component. */
+  String getUserId();
+
+  /** time that specifies when the comment was made */
+  Date getTime();
+
+}

Modified: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstanceQuery.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstanceQuery.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstanceQuery.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -41,12 +41,18 @@
   /** duration property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
   String PROPERTY_DURATION = "duration";
 
+  /** select only the process instances with the given id */
   HistoryProcessInstanceQuery processInstanceId(String processInstanceId);
+
+  /** select only process instances within the given process definition */
   HistoryProcessInstanceQuery processDefinitionId(String processDefinitionId);
+
+  /** select only process instances in the given state */
   HistoryProcessInstanceQuery state(String state);
 
   /** order selected process instances ascending for certain {@link #PROPERTY_STARTTIME properties} */
   HistoryProcessInstanceQuery orderAsc(String property);
+
   /** order selected process instances ascending for certain {@link #PROPERTY_STARTTIME properties} */
   HistoryProcessInstanceQuery orderDesc(String property);
 

Copied: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTask.java (from rev 5295, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTask.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTask.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTask.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.history;
+
+import java.util.Date;
+import java.util.List;
+
+import org.jbpm.api.task.Task;
+
+
+/** history record for a task instance.  
+ * 
+ * In contrast to the {@link Task}, this entity will remain 
+ * after the task has been completed for history purposes.
+ *  
+ * @author Tom Baeyens
+ */
+public interface HistoryTask {
+
+  String STATE_COMPLETED = "completed";
+
+  /** the unique id for this task that is used as a reference in the service methods */
+  String getId();
+
+  /** the execution that was related to this activity occurrence */
+  String getExecutionId();
+
+  /** time when the activity was entered */
+  Date getCreateTime();
+
+  /** might be null in case the activity is still active */
+  Date getEndTime();
+
+  /** duration in milleseconds */
+  long getDuration();
+
+  /** history task state */  
+  String getState();
+
+  /** userId of the person that is responsible for this task */  
+  String getAssignee();
+
+  /** the outcome of this task */
+  String getOutcome();
+}
\ No newline at end of file

Copied: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTaskQuery.java (from rev 5295, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTaskQuery.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTaskQuery.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryTaskQuery.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.history;
+
+import java.util.Date;
+import java.util.List;
+
+
+/** query for history tasks.
+ * 
+ * @author Tom Baeyens
+ */
+public interface HistoryTaskQuery {
+
+  /** id property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+  String PROPERTY_ID = "dbid";
+  /** starttime property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+  String PROPERTY_STARTTIME = "startTime";
+  /** endtime property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+  String PROPERTY_ENDTIME = "endTime";
+  /** executionId property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+  String PROPERTY_EXECUTIONID = "executionId";
+  /** outcome property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+  String PROPERTY_OUTCOME = "outcome";
+  /** outcome property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+  String PROPERTY_ASSIGNEE = "assignee";
+  /** state property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+  String PROPERTY_STATE = "state";
+  /** duration property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+  String PROPERTY_DURATION = "duration";
+
+  /** only select the history task for the given id */
+  HistoryTaskQuery taskId(String taskId);
+  
+  /** only select history tasks within the given execution */
+  HistoryTaskQuery executionId(String executionId);
+  
+  /** only select history tasks for the given assignee */
+  HistoryTaskQuery assignee(String assignee);
+
+  /** only select history tasks in the given state */
+  HistoryTaskQuery state(String state);
+
+  /** only select history tasks that have the given outcome */
+  HistoryTaskQuery outcome(String outcome);
+
+  /** order selected history tasks ascending for certain {@link #PROPERTY_ID properties} */
+  HistoryTaskQuery orderAsc(String property);
+
+  /** order selected process definitions descending for certain {@link #PROPERTY_ID properties} */
+  HistoryTaskQuery orderDesc(String property);
+
+  /** select a specific page in the result set */
+  HistoryTaskQuery page(int firstResult, int maxResults);
+
+  /** only select history tasks started after the given time */
+  HistoryTaskQuery startedAfter(Date time);
+
+  /** only select history tasks started before the given time */
+  HistoryTaskQuery startedBefore(Date time);
+
+  /** only select history tasks that took less then the given duration in milliseconds */
+  HistoryTaskQuery tookLessThen(long durationInMillis);
+
+  /** only select history tasks that took longer then the given duration in milliseconds */
+  HistoryTaskQuery tookLongerThen(long durationInMillis);
+
+  /** execute the query and obtain the list of {@link HistoryTask}s */
+  List<HistoryTask> list();
+  
+  /** execute the query and obtain the unique {@link HistoryTask} */
+  HistoryTask uniqueResult();
+}

Deleted: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.api.Execution;
-
-/** a free text comment that can be made to an {@link Execution} 
- * or a task.  
- * 
- * This class also supports threaded discussions with the 
- * {@link #getComments() parent-child relation}.
- * 
- * @author Tom Baeyens
- */
-public interface Comment extends Discussable {
-
-  /** the unique id for this comment that is used as a reference in the service methods */
-  String getId();
-
-  /** the id of the user that made this comment.  The term actorId is an abstract 
-   * reference to an entity in an external identity component. */
-  String getUserId();
-
-  /** the actual message.  Both plain text as well as HTML can be stored 
-   * as the message. */
-  String getMessage();
-
-  /** time that specifies when the comment was made */
-  Date getTime();
-  
-  /** threaded replies to this comment */
-  List<Comment> getComments();
-}
\ No newline at end of file

Deleted: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/Discussable.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/Discussable.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/Discussable.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import java.util.List;
-
-import org.jbpm.api.TaskService;
-
-
-/** something that people can discuss like a task 
- * or a process instance.
- * 
- * for now, only task discussions are supported in 
- * the {@link TaskService}
- * 
- * @author Tom Baeyens
- */
-public interface Discussable {
-
-  /** all comments. */
-  List<Comment> getComments();
-  
-  /** create a comment */
-  Comment createComment(String message);
-  
-  /** remove a comment */
-  void removeComment(Comment comment);
-}

Modified: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -104,10 +104,6 @@
    * the type automagically. */
   void createVariable(String key, Object value);
 
-  /** create a new variable in this execution scope with  
-   * the given type name. */
-  void createVariable(String key, Object value, String typeName);
-  
   // priority /////////////////////////////////////////////////////////////////
   
   /** setter for the priority.  The default priority is 0, which means 

Modified: jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -25,9 +25,13 @@
 import java.util.Date;
 
 import org.jbpm.api.TaskService;
+import org.jbpm.api.history.HistoryTask;
 
-/** a task.
+/** a runtime task.
  * 
+ * In contrast to {@link HistoryTask}, a Task only represents the runtime 
+ * state of a task and hence it will be deleted after it is completed.
+ * 
  * @author Tom Baeyens
  */
 public interface Task extends Serializable {
@@ -70,14 +74,14 @@
   void setAssignee(String assignee);
 
   /** date and time when this task was created */
-  Date getCreate();
+  Date getCreateTime();
 
   /** date and time when this task must be completed. This might be null. */
-  Date getDueDate();
+  Date getDuedate();
 
   /** update the date and time when this task must be completed.
    * Updates like this require you to invoke {@link TaskService#saveTask(Task)} afterwards. */
-  void setDueDate(Date dueDate);
+  void setDuedate(Date duedate);
 
   /** the priority of this task.  This is only a data item for user purposes.  
    * The engine doesn't do anything different for different priorities. */

Copied: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/images/erd.history.png (from rev 5295, jbpm4/trunk/modules/devguide/src/main/docbook/en/images/erd.history.png)
===================================================================
(Binary files differ)

Copied: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/images/erd.identity.png (from rev 5295, jbpm4/trunk/modules/devguide/src/main/docbook/en/images/erd.identity.png)
===================================================================
(Binary files differ)

Copied: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/images/erd.repo.and.runtime.png (from rev 5295, jbpm4/trunk/modules/devguide/src/main/docbook/en/images/erd.repo.and.runtime.png)
===================================================================
(Binary files differ)

Deleted: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/images/jbpm.erd.png
===================================================================
(Binary files differ)

Modified: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -45,5 +45,73 @@
     <ulink url="http://repository.jboss.com/maven2/org/jbpm/jbpm4/">http://repository.jboss.com/maven2/org/jbpm/jbpm4/</ulink>
     </para>
   </section>
+  
+  <section>
+    <title>Library dependencies</title>
+    <para>If you want to install/deploy jBPM into your own application, this is still as easy
+    as it was before: Just put the right libs in your application classpath.  We didn't yet clean 
+    up the dependency description in the maven pom files.  So we can't yet give the exact 
+    minimal set of libraries from the <literal>lib</literal> directory that you need to include
+    in your application.   The versions of the libraties that are in the <literal>lib</literal>
+    directory are the ones that we tested with.  So we recommend you to use those very versions
+    of the libs.  To help you on your way, here's the current maven dependency list for jPDL:
+    </para>
+    <programlisting>[INFO] ------------------------------------------------------------------------
+[INFO] Building jBPM 4 - jPDL
+[INFO]    task-segment: [dependency:tree]
+[INFO] ------------------------------------------------------------------------
+[INFO] [dependency:tree]
+[INFO] org.jbpm.jbpm4:jbpm-jpdl:jar:4.0
+[INFO] +- org.jbpm.jbpm4:jbpm-pvm:jar:4.0:compile
+[INFO] |  +- org.jbpm.jbpm4:jbpm-api:jar:4.0:compile
+[INFO] |  |  \- jboss:jboss-j2ee:jar:4.2.2.GA:compile
+[INFO] |  +- org.jbpm.jbpm4:jbpm-log:jar:4.0:compile
+[INFO] |  +- org.jbpm.jbpm4:jbpm-test-base:jar:4.0:compile
+[INFO] |  |  \- org.hibernate:hibernate-core:jar:3.3.1.GA:compile
+[INFO] |  |     +- antlr:antlr:jar:2.7.6:compile
+[INFO] |  |     \- commons-collections:commons-collections:jar:3.1:compile
+[INFO] |  +- org.apache.ant:ant:jar:1.7.0:compile
+[INFO] |  |  \- org.apache.ant:ant-launcher:jar:1.7.0:compile
+[INFO] |  +- log4j:log4j:jar:1.2.14:compile
+[INFO] |  +- juel:juel:jar:2.1.0:compile
+[INFO] |  +- juel:juel-impl:jar:2.1.0:compile
+[INFO] |  +- juel:juel-engine:jar:2.1.0:compile
+[INFO] |  +- org.slf4j:slf4j-api:jar:1.5.2:compile
+[INFO] |  +- org.slf4j:slf4j-jdk14:jar:1.5.2:compile
+[INFO] |  +- org.jboss.identity.idm:idm-core:jar:1.0.0.Beta1:compile
+[INFO] |  |  +- org.jboss.identity.idm:idm-common:jar:1.0.0.Beta1:compile
+[INFO] |  |  +- org.jboss.identity.idm:idm-api:jar:1.0.0.Beta1:compile
+[INFO] |  |  +- org.jboss.identity.idm:idm-spi:jar:1.0.0.Beta1:compile
+[INFO] |  |  \- com.sun.xml.bind:jaxb-impl:jar:2.1.8:compile
+[INFO] |  |     \- javax.xml.bind:jaxb-api:jar:2.1:compile
+[INFO] |  |        \- javax.xml.stream:stax-api:jar:1.0-2:compile
+[INFO] |  +- org.jboss.identity.idm:idm-hibernate:jar:1.0.0.Beta1:compile
+[INFO] |  |  +- javassist:javassist:jar:3.4.GA:compile
+[INFO] |  |  +- org.hibernate:hibernate-cglib-repack:jar:2.1_3:compile
+[INFO] |  |  \- org.slf4j:slf4j-log4j12:jar:1.5.2:compile
+[INFO] |  +- org.hibernate:hibernate-entitymanager:jar:3.4.0.GA:compile
+[INFO] |  |  +- org.hibernate:ejb3-persistence:jar:1.0.2.GA:compile
+[INFO] |  |  +- org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:compile
+[INFO] |  |  +- org.hibernate:hibernate-annotations:jar:3.4.0.GA:compile
+[INFO] |  |  +- dom4j:dom4j:jar:1.6.1:compile
+[INFO] |  |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
+[INFO] |  |  \- javax.transaction:jta:jar:1.1:compile
+[INFO] |  +- org.livetribe:livetribe-jsr223:jar:2.0.5:compile
+[INFO] |  \- javax.mail:mail:jar:1.4.1:compile
+[INFO] |     \- javax.activation:activation:jar:1.1:compile
+[INFO] +- junit:junit:jar:3.8.1:compile
+[INFO] \- hsqldb:hsqldb:jar:1.8.0.7:test
+[INFO] ------------------------------------------------------------------------</programlisting>
+    <para>The jboss idm dependencies in sections 
+    <literal>org.jboss.identity.idm:*</literal> can be ignored, including the 
+    <literal>org.hibernate:hibernate-entitymanager</literal> </para>
+    <para>This list should already get you started to select a small subset of libs instead of 
+    including all the libs from the <literal>${jbpm.home}/lib</literal> directory.  
+    In one of the next releases, we'll clean up those dependency descriptions in the pom and include 
+    a good description of which are the minimal libs to get jBPM up and running inside 
+    your own application. 
+    </para>
+  </section>
+  
     
 </chapter>

Modified: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -85,6 +85,9 @@
 
     <section id="businesscalendar">
       <title>Business calendar</title>
+      <para>Known limitation.  The business calendar is not yet configurable.
+      See also <ulink url="https://jira.jboss.org/jira/browse/JBPM-2334">JBPM-2334</ulink>
+      </para>
       <para>The default configuration will contain a reference to the file
         <literal>jbpm.business.calendar.xml</literal>.  That contains a 
         configuration of business hours in the following format: 

Modified: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch03-MigrationFromJbpm3.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch03-MigrationFromJbpm3.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch03-MigrationFromJbpm3.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -26,11 +26,15 @@
     <title>Known limitations</title>
     <para>As part of creating a clear separation between basic and advanced usage, the API 
     has been completely revisited.  Basic usage is covered with the public API.  The same API 
-    is available in all the supported environments.
+    is available in all the supported environments.  Package names in jBPM 4 are strictly 
+    separated from package names in jBPM 3.
     </para>
     <para>Instead of providing a full DB migration, we opted for a strategy to 
     allow for jBPM 3 and jBPM 4 instances to run concurrently next to each 
-    other.  One of the main reasons is that any QA for a data migration of the
+    other. The table prefix is changed from <literal>JBPM_</literal> to <literal>JBPM4_</literal>.  
+    There is no migration tool to convert jBPM 3 runtime database contents 
+    to jBPM 4.  We're not sure if we'll be able to build such a tool in one of the
+    next version.  One of the main reasons is that any QA for a data migration of the
     DB contents would be impossible for the project team to achieve.  
     </para>
     <para>Furthermore, there are some features that are not yet available 
@@ -45,8 +49,8 @@
       <listitem>Identity expression to calculate the assignee of a task</listitem>
       <listitem>Task form variable-to-parameter conversions</listitem>
     </itemizedlist>
-  </section>  
-
+  </section>
+  
   <section id="processconversiontool">
     <title>Process conversion tool</title>  
     <para>In many cases, a lot of work has been put in the design of JPDL3 process
@@ -158,7 +162,10 @@
            <entry>Execution</entry>
            <entry>The root execution is now the same object as the 
            process instance.  (In jBPM 3, the ProcessInstance had 
-           a pointer to the root token)
+           a pointer to the root token).  Also, unlike in jBPM 3, executions in jBPM 4 might 
+           get inactivated, create a child execution and let the child execution continue, even 
+           when logically this represents only one single path of execution.  This happens in 
+           scope activities (or composite activities) that have timers or variables declared.
            </entry>
          </row>
          <row>

Modified: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch09-Configuration.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch09-Configuration.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch09-Configuration.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,6 +21,7 @@
     </para>
     <para>Configuration files that can be imported by the user's <literal>jbpm.cfg.xml</literal>:</para>
     <itemizedlist>
+      <listitem>jbpm.businesscalendar.cfg.xml</listitem>
       <listitem>jbpm.default.cfg.xml</listitem>
       <listitem>jbpm.identity.cfg.xml</listitem>
       <listitem>jbpm.jbossremote.cfg.xml</listitem>
@@ -39,6 +40,7 @@
   &lt;jbpm-configuration&gt;
   
     &lt;import resource=&quot;jbpm.default.cfg.xml&quot; /&gt;
+    &lt;import resource=&quot;jbpm.businesscalendar.cfg.xml&quot; /&gt;
     &lt;import resource=&quot;jbpm.tx.hibernate.cfg.xml&quot; /&gt;
     &lt;import resource=&quot;jbpm.jpdl.cfg.xml&quot; /&gt;
     &lt;import resource=&quot;jbpm.identity.cfg.xml&quot; /&gt;
@@ -88,7 +90,41 @@
       <listitem>package modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding</listitem>
     </itemizedlist>
   </section>
+
+  <section id="customizingthebusinesscalendar">
+    <title>Customizing the business calendar</title>
+    <para>For specifying a different configuration for the default 
+    business calendar implementation, see the userguide.
+    </para>
+    <para>To provide a custom implementation for the business calendar, 
+    specify a custom business calendar implementation like this in 
+    the jbpm.cfg.xml
+    </para>
+    <programlisting>&lt;jbpm-configuration&gt;
+
+  &lt;import resource=&quot;jbpm.default.cfg.xml&quot; /&gt;
+  ...
+
+  &lt;process-engine-context&gt;
+    &lt;object class=&quot;org.jbpm.test.custombusinesscalendarimpl.CustomBusinessCalendar&quot; /&gt;
+  &lt;/process-engine-context&gt;
+
+&lt;/jbpm-configuration&gt;</programlisting>
+    <para>Here's an example implementation</para>
+    <programlisting>public class CustomBusinessCalendar implements BusinessCalendar {
   
+  public Date add(Date date, String duration) {
+    if (&quot;my next birthday&quot;.equals(duration)) {
+      GregorianCalendar gregorianCalendar = new GregorianCalendar();
+      gregorianCalendar.set(Calendar.MONTH, Calendar.JULY);
+      gregorianCalendar.set(Calendar.DAY_OF_MONTH, 21);
+      return gregorianCalendar.getTime();
+    }
+    return null;
+  }
+}</programlisting>
+  </section>
+  
   <section id="customizingtheidentitycomponent">
     <title>Customizing the identity component</title>
     <para>There are 2 identity components that we support out of the box:

Modified: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch10-Persistence.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch10-Persistence.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch10-Persistence.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -10,16 +10,19 @@
   <ulink url="http://dev.mysql.com/workbench/">MySQL Workbench></ulink>.
   </para>
   
-  <figure id="schema ">
-    <title>The jBPM Schema ER Diagram</title>
-    <mediaobject><imageobject><imagedata align="center" fileref="images/jbpm.erd.png"/></imageobject></mediaobject>
+  <figure id="erd.repo.and.runtime">
+    <title>The jBPM repository and runtime schema ER diagram</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/erd.repo.and.runtime.png"/></imageobject></mediaobject>
   </figure>
   
+  <figure id="erd.history">
+    <title>The jBPM history schema ER diagram</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/erd.history.png"/></imageobject></mediaobject>
+  </figure>
   
-  <para>TODO: hibernate-session and the standard transaction
-  </para>
+  <figure id="erd.identity">
+    <title>The jBPM identity schema ER diagram</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/erd.identity.png"/></imageobject></mediaobject>
+  </figure>
   
-  <para>TODO: process definition caching
-  </para>
-  
 </chapter>
\ No newline at end of file

Modified: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch14-History.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch14-History.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch14-History.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,24 +1,20 @@
 <chapter id="history">
   <title>History</title>
 
-  <section id="overview">
-    <title>Overview</title>
+    <para>History information is the information that will be maintained in the database 
+    for querying purposes.  This information is kept in the database after the 
+    process or task has ended.  But it is always up to date with the runtime 
+    information.  History information is updated inside of the runtime 
+    transaction.
+    </para>
     
-    <para>HistoryEvents are fired during process execution.
+    <para>We maintain history information on 4 entities: process instance, activity instance
+    task and variable.  Each entity has a list of details associated to it.
+    Preferably use the history queries to access this information through the API.
     </para>
 
-    <para>We maintain history information on 2 levels: process instance and activity instance.
-    </para>
-
-    <para>Process instance start and process instance end generate history events are fired directly 
-    from within the implementation.
-    </para>
-
-    <para>ActivityBehaviour implementations are responsible for calling the historyXxx methods that 
-    are exposed on the ActivityExecution
-    </para>
-
-    <para>All the HistoryEvents are delegated to a HistorySession.  The default HistorySessionImpl 
+    <para>HistoryEvents are fired during process execution and dispatched to the configured 
+    HistorySession.  (see HistoryEvent.fire)  All the HistoryEvents are delegated to a HistorySession.  The default HistorySessionImpl 
     will invoke the process() method on the history events themselves.
     </para>
 
@@ -27,7 +23,7 @@
     </para>
 
     <para>In the HistoryEvent.process methods, the history events create model entities or merge 
-    information into the model entities.  For instance, a ProcessInstanceStart history event will 
+    information into the history entities.  For instance, a ProcessInstanceCreate history event will 
     create a HistoryProcessInstance entity/record.  And the ProcessInstanceEnd will set the endTime 
     property in the existing HistoryProcessInstance entity/record.  
     </para>
@@ -37,6 +33,4 @@
     this happens inside 1 transaction).
     </para>
 
-  </section>
-
 </chapter>
\ No newline at end of file

Modified: jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch16-SpringIntegration.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch16-SpringIntegration.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/devguide/src/main/docbook/en/modules/ch16-SpringIntegration.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -37,6 +37,8 @@
     <para>
 		Replace the standard-transaction-interceptor with the 
 		spring-transaction-interceptor. The hibernate session needs the attribute current=”true”. 
+        Also, the &lt;transaction/&gt; must be removed from the transaction-context if you want the 
+        transactions to be handled by Spring only.
 		This forces jBPM to search for the current session, 
 		which will be provided by Spring.
 		<programlisting>
@@ -78,20 +80,6 @@
 		</programlisting>
 	</para>
 
-	<para>
-		For accessing Spring beans from withing a process, we need to register 
-		the Spring applicationContext with the scripting-manager.
-		
-		<programlisting>
-	&lt;script-manager default-expression-language=&quot;juel&quot;
-	 default-script-language=&quot;juel&quot;
-	 read-contexts=&quot;execution, environment, process-engine, <emphasis role="bold">spring</emphasis>&quot;
-	 write-context=&quot;&quot;&gt;
-	 &lt;script-language name=&quot;juel&quot;
-	 factory=&quot;org.jbpm.pvm.internal.script.JuelScriptEngineFactory&quot; /&gt;
-	 &lt;/script-manager&gt;		
-		</programlisting>	
-    </para>
   </section>
   
   <section id="spring_usage">

Modified: jbpm4/branches/jimma/trunk/modules/distro/src/main/files/gpd/build.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/distro/src/main/files/gpd/build.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/distro/src/main/files/gpd/build.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -22,13 +22,16 @@
   <property name="jbpm.home" value="${jbpm.parent.dir}/jbpm-${jbpm.version}" />
 
   <!-- eclipse.filename -->
-  <condition property="eclipse.filename" value="eclipse-jee-ganymede-SR2-win32.zip">
+  <condition property="eclipse.filename" value="eclipse-jee-galileo-win32.zip">
     <contains string="${os.name}" casesensitive="false" substring="win" />
   </condition>
-  <condition property="eclipse.filename" value="eclipse-jee-ganymede-SR2-macosx-carbon.tar.gz">
+  <condition property="eclipse.tarfilename" value="eclipse-jee-galileo-macosx-carbon.tar">
     <contains string="${os.name}" casesensitive="false" substring="mac" />
   </condition>
-  <condition property="eclipse.filename" value="eclipse-jee-ganymede-SR2-linux-gtk.tar.gz">
+  <condition property="eclipse.filename" value="${eclipse.tarfilename}.gz">
+    <contains string="${os.name}" casesensitive="false" substring="mac" />
+  </condition>
+  <condition property="eclipse.tarfilename" value="eclipse-jee-galileo-linux-gtk.tar">
     <and>
       <contains string="${os.name}" casesensitive="false" substring="linux" />
       <not>
@@ -36,14 +39,28 @@
       </not>
     </and>
   </condition>
-  <condition property="eclipse.filename" value="eclipse-jee-ganymede-SR2-linux-gtk-x86_64.tar.gz">
+  <condition property="eclipse.filename" value="${eclipse.tarfilename}.gz">
     <and>
       <contains string="${os.name}" casesensitive="false" substring="linux" />
+      <not>
+        <contains string="${os.arch}" casesensitive="false" substring="64" />
+      </not>
+    </and>
+  </condition>
+  <condition property="eclipse.tarfilename" value="eclipse-jee-galileo-linux-gtk-x86_64.tar">
+    <and>
+	  <contains string="${os.name}" casesensitive="false" substring="linux" />
       <contains string="${os.arch}" casesensitive="false" substring="64" />
     </and>
   </condition>
+  <condition property="eclipse.filename" value="${eclipse.tarfilename}.gz">
+    <and>
+      <contains string="${os.name}" casesensitive="false" substring="linux" />
+      <contains string="${os.arch}" casesensitive="false" substring="64" />
+    </and>
+  </condition>
   <!-- general eclipse properties -->
-  <property name="eclipse.distro.url" value="http://mirror.cc.vt.edu/pub/eclipse/technology/epp/downloads/release/ganymede/SR2/${eclipse.filename}" />
+  <property name="eclipse.distro.url" value="http://mirror.cc.vt.edu/pub/eclipse/technology/epp/downloads/release/galileo/R/${eclipse.filename}" />
   <property name="eclipse.distro.dir"  value="${jbpm.home}/downloads" />
   <property name="eclipse.parent.dir" value="${jbpm.home}" />
   <property name="eclipse.distro.path" value="${eclipse.distro.dir}/${eclipse.filename}" />
@@ -69,7 +86,9 @@
   </target>
 
   <target name="internal.install.eclipse.non.windows" if="isNotWindows">
-    <gunzip src="${eclipse.distro.dir}/${eclipse.filename}" dest="${jbpm.home}" />
+    <gunzip src="${eclipse.distro.dir}/${eclipse.filename}" dest="${eclipse.distro.dir}" />
+    <untar src="${eclipse.distro.dir}/${eclipse.tarfilename}" dest="${jbpm.home}" overwrite="true" />
+  	<delete file="${eclipse.distro.dir}/${eclipse.tarfilename}"/>
   </target>
 
   <!-- ### GET ECLIPSE ##################################################### -->

Modified: jbpm4/branches/jimma/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,10 +3,10 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.jta.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.identity.cfg.xml" />
-
   <import resource="jbpm.jobexecutor.cfg.xml" />
 
 </jbpm-configuration>

Modified: jbpm4/branches/jimma/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.jta.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.jboss.idm.cfg.xml" />

Modified: jbpm4/branches/jimma/trunk/modules/distro/src/main/files/readme.html
===================================================================
--- jbpm4/branches/jimma/trunk/modules/distro/src/main/files/readme.html	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/distro/src/main/files/readme.html	2009-07-15 05:27:19 UTC (rev 5296)
@@ -35,9 +35,184 @@
       </tr>
     </table>
 
+
+<h1>Release Notes for jBPM 4.0 (GA)</h1>
+
+<h2>Known Issues
+</h2>
+<p>There are still 2 known minor inconveniences in the Graphical Process Designer (GPD).  For workarounds, see the jira issues:</p>
+<ul>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-306'>GPD-306</a>] - Self Referencing Connections
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-336'>GPD-336</a>] - image generation fails
+</li>
+</ul>
+
+
+<h2>        Bug
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2022'>JBPM-2022</a>] -         EnvironmentFactory cannot be bound to JNDI
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2055'>JBPM-2055</a>] -         Executions that are ended show up in query
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2303'>JBPM-2303</a>] -         Exception with a process containing a fork/join
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2313'>JBPM-2313</a>] -         Unabled to enlist resource exception
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2319'>JBPM-2319</a>] -         Finished executions are not changed to &quot;ended&quot; (they stay in the &quot;active&quot; state)
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2331'>JBPM-2331</a>] -         StaleObjectException on Timer execution.
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2332'>JBPM-2332</a>] -         task query candidate problem
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2335'>JBPM-2335</a>] -         Subprocess Element causes Exception if followed by an &lt;end&gt; Element
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2340'>JBPM-2340</a>] -         TaskService getTaskComments throws NullPointerException if the task is not found
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2344'>JBPM-2344</a>] -         JTA interceptor breaks console and deployer
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2355'>JBPM-2355</a>] -         Unable to retrieve suspended process defintions
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2387'>JBPM-2387</a>] -         integrity constraint violation in process that runs end to end with no wait
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2389'>JBPM-2389</a>] -         Reassignment is not reflected in task history
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2390'>JBPM-2390</a>] -         add tasks and task comments the history
+</li>
+</ul>
+        
+<h2>        Feature Request
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2052'>JBPM-2052</a>] -         Suspend / Resume executions
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2102'>JBPM-2102</a>] -         Provide process definition lifecycle
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2305'>JBPM-2305</a>] -         Implement a method in TaskService to return all active tasks of a process instance
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2309'>JBPM-2309</a>] -         Add method to support getTaskDefinition and getProcessInstance from interface Task
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2342'>JBPM-2342</a>] -         extend repo service to get a list of deployments
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2352'>JBPM-2352</a>] -         jPDL Schema definition needs some tweaks
+</li>
+</ul>
+                    
+<h2>        Task
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-1214'>JBPM-1214</a>] -         check optimistic locking in case of loops
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-1895'>JBPM-1895</a>] -         verify html documentation style sheets for internet explorer
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2004'>JBPM-2004</a>] -         finish database cleanup of all the tests
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2016'>JBPM-2016</a>] -         finalize test support
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2110'>JBPM-2110</a>] -         Delegate deployment-service dependency resolution to the dependecy deployer in AS 5
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2183'>JBPM-2183</a>] -         process conversion tool
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2212'>JBPM-2212</a>] -         review string == comparisons for execution.state
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2223'>JBPM-2223</a>] -         event propagate property
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2275'>JBPM-2275</a>] -         handle async message jobs after process instance deletion
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2286'>JBPM-2286</a>] -         create test case with fork and join in one transaction
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2304'>JBPM-2304</a>] -         investigate non-null return values for collections in the api 
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2306'>JBPM-2306</a>] -         fix developers guide
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2307'>JBPM-2307</a>] -         prune api where possible
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2314'>JBPM-2314</a>] -         Clean up validate(Timer)
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2322'>JBPM-2322</a>] -         enable module test-db in integration test suite
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2323'>JBPM-2323</a>] -         instantiate user defined classes at parsing time
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2328'>JBPM-2328</a>] -         move timers to devguide
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2330'>JBPM-2330</a>] -         fine tuning of the execution id generator
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2336'>JBPM-2336</a>] -         fix delete task mismatch
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2339'>JBPM-2339</a>] -         Complete JTA transaction refactoring
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2348'>JBPM-2348</a>] -         make ids consistent
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2350'>JBPM-2350</a>] -         move jboss process deployment to incubation
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2354'>JBPM-2354</a>] -         fix excluded integration tests for test-db
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2356'>JBPM-2356</a>] -         fine tuning of execution persistence hierarchy
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2357'>JBPM-2357</a>] -         Change findExecutionById to show suspended executions
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2359'>JBPM-2359</a>] -         reporting test fails on oracle
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2362'>JBPM-2362</a>] -         integrate andries' spring integration
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2363'>JBPM-2363</a>] -         document purpose of ant script installations
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2364'>JBPM-2364</a>] -         split mail documentation in userguide and devguide part
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2365'>JBPM-2365</a>] -         Clarification (and API) how &quot;Start process with task form&quot; should work
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2367'>JBPM-2367</a>] -         verify examples classes deployment in demo.setup script
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2370'>JBPM-2370</a>] -         Incorporate Migration tool in distribution
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2371'>JBPM-2371</a>] -         add mysql schema diagram to db docs
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2372'>JBPM-2372</a>] -         complete javadocs
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2374'>JBPM-2374</a>] -         image problem
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2376'>JBPM-2376</a>] -         putting a task back in the group
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2378'>JBPM-2378</a>] -         add continue attribute to xsd
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2379'>JBPM-2379</a>] -         regression on oracle related to clobs
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2393'>JBPM-2393</a>] -         expand task history to full audit logs
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2395'>JBPM-2395</a>] -         fix mail listener: change task variable to task scope
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/JBPM-2396'>JBPM-2396</a>] -         remove TaskServive.getVariable method
+</li>
+</ul>
+
+<h2>        Task
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-226'>GPD-226</a>] -         Define a repeatable build for these plugins to be exported as a feature
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-229'>GPD-229</a>] -         Write up the initial test scenario's to test the GPD (automated or manual)
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-288'>GPD-288</a>] -         Errors show up in problems view
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-301'>GPD-301</a>] -         migration support
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-331'>GPD-331</a>] -         Support HQL attributes and elements
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-333'>GPD-333</a>] -         Ensure backwards compatibility between GPD 3.1.x and GPD 4.x
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-334'>GPD-334</a>] -         update jbpm roadmap with gpd features
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-341'>GPD-341</a>] -         renaming swimlane should make editor dirty
+</li>
+<li>[<a href='https://jira.jboss.org/jira/browse/GPD-351'>GPD-351</a>] -         Modify project and jpdl creation wizards to allow for jBPM 3 and jBPM 4 to coexist
+</li>
+</ul>
+                        
+
     <h1>Release notes for jBPM 4.0.0.CR1</h1>
     
-      <h2 style="color:red;">Known Limitations</h2>
+      <h2>Known Limitations</h2>
         <ul>
           <li>In the Graphical Process Designer, the hql and sql nodes are not yet configurable</li>
           <li>In the Graphical Process Designer, the custom node is supported but not completely configurable</li>

Modified: jbpm4/branches/jimma/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/InsertCommentCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/InsertCommentCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/InsertCommentCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,12 +21,8 @@
  */
 package org.jbpm.enterprise.internal.custom;
 
-import java.sql.SQLException;
-
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.model.CommentImpl;
-import org.jbpm.pvm.internal.session.DbSession;
 
 /**
  * @author Alejandro Guizar
@@ -48,11 +44,11 @@
   }
 
   public Void execute(Environment environment) throws Exception {
-    CommentImpl comment = new CommentImpl();
-    comment.setMessage(message);
-    environment.get(DbSession.class).save(comment);
-    if (fail)
-      throw new SQLException("simulated failure");
+//    HistoryDetailImpl comment = new HistoryDetailImpl();
+//    comment.setMessage(message);
+//    environment.get(DbSession.class).save(comment);
+//    if (fail)
+//      throw new SQLException("simulated failure");
     return null;
   }
 

Modified: jbpm4/branches/jimma/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/RemoveCommentCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/RemoveCommentCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/RemoveCommentCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -28,7 +28,7 @@
 
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 
 /**
  * @author Alejandro Guizar
@@ -45,13 +45,13 @@
 
   public Boolean execute(Environment environment) throws Exception {
     Session session = environment.get(Session.class);
-    List<?> comments = session.createCriteria(CommentImpl.class)
+    List<?> comments = session.createCriteria(HistoryDetailImpl.class)
         .add(Restrictions.eq("message", message))
         .setMaxResults(1)
         .list();
     if (comments.isEmpty())
       return false;
-    CommentImpl phrase = (CommentImpl) comments.get(0);
+    HistoryDetailImpl phrase = (HistoryDetailImpl) comments.get(0);
     session.delete(phrase);
     return true;
   }

Modified: jbpm4/branches/jimma/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/pom.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/pom.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -89,20 +89,25 @@
             <artifactId>maven-antrun-plugin</artifactId>
             <executions>
               <execution>
+                <id>database-test-cfg-customization</id>
                 <phase>test-compile</phase>
                 <goals>
                   <goal>run</goal>
                 </goals>
                 <configuration>
                   <tasks>
-                    <copy file="../../qa/jdbc/${database}.properties"
-                          tofile="target/test-classes/jdbc.properties" />
-                    <copy file="${user.home}/.jbpm4/jdbc/${database}.properties"
+                    <echo message="database: ${database}" />
+                    <available property="qa.database.props.available" file="../../qa/jdbc/${database}.properties" />
+                    <echo message="qa.database.props.available: ${qa.database.props.available}" />
+                    <copy file="../../qa/jdbc/${database}.properties" 
                           tofile="target/test-classes/jdbc.properties"
+                          overwrite="true" />
+                    <copy file="${user.home}/.jbpm4/jdbc/${database}.properties" 
+                          tofile="target/test-classes/jdbc.properties"
                           overwrite="true"
-                          failonerror="true "/>
-                    <copy file="../../modules/distro/src/main/files/db/hibernate.cfg/${database}.hibernate.cfg.xml"
-                          tofile="target/test-classes/jbpm.hibernate.cfg.xml"
+                          failonerror="false"/>
+                    <copy file="../../modules/distro/src/main/files/db/hibernate.cfg/${database}.hibernate.cfg.xml" 
+                          tofile="target/test-classes/jbpm.hibernate.cfg.xml" 
                           overwrite="true">
                       <filterset>
                         <filtersfile file="target/test-classes/jdbc.properties" />
@@ -155,6 +160,7 @@
             <artifactId>maven-antrun-plugin</artifactId>
             <executions>
               <execution>
+                <id>integration-test-cfg-customization</id>
                 <phase>test-compile</phase>
                 <goals>
                   <goal>run</goal>

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -67,9 +67,9 @@
   protected void tearDown() throws Exception {
     repositoryService.deleteDeploymentCascade(deploymentId);
     
-    taskService.deleteTask(taskLaundryId);
-    taskService.deleteTask(taskDishesId);
-    taskService.deleteTask(taskIronId);
+    taskService.deleteTaskCascade(taskLaundryId);
+    taskService.deleteTaskCascade(taskDishesId);
+    taskService.deleteTaskCascade(taskIronId);
     
     super.tearDown();
   }

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -67,9 +67,9 @@
   protected void tearDown() throws Exception {
     repositoryService.deleteDeploymentCascade(deploymentId);
     
-    taskService.deleteTask(taskLaundryId);
-    taskService.deleteTask(taskDishesId);
-    taskService.deleteTask(taskIronId);
+    taskService.deleteTaskCascade(taskLaundryId);
+    taskService.deleteTaskCascade(taskDishesId);
+    taskService.deleteTaskCascade(taskIronId);
     
     super.tearDown();
   }

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,8 +21,11 @@
  */
 package org.jbpm.examples.subprocess.outcomevalue;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
+import org.apache.commons.collections.map.HashedMap;
 import org.jbpm.api.ProcessInstance;
 import org.jbpm.api.task.Task;
 import org.jbpm.test.JbpmTestCase;
@@ -65,7 +68,9 @@
     Task task = taskList.get(0);
     
     // the result variable is set in the task
-    taskService.setVariable(task.getId(), "result", "ok");
+    Map<String, Object> variables = new HashMap<String, Object>();
+    variables.put("result", "ok");
+    taskService.setVariables(task.getId(), variables);
     
     // the task in the sub process instance is completed 
     taskService.completeTask(task.getId());
@@ -85,7 +90,9 @@
     Task task = taskList.get(0);
     
     // the result variable is set in the task
-    taskService.setVariable(task.getId(), "result", "nok");
+    Map<String, Object> variables = new HashMap<String, Object>();
+    variables.put("result", "nok");
+    taskService.setVariables(task.getId(), variables);
     
     // the task in the sub process instance is completed 
     taskService.completeTask(task.getId());
@@ -105,7 +112,9 @@
     Task task = taskList.get(0);
     
     // the result variable is set in the task
-    taskService.setVariable(task.getId(), "result", "reject");
+    Map<String, Object> variables = new HashMap<String, Object>();
+    variables.put("result", "reject");
+    taskService.setVariables(task.getId(), variables);
     
     // the task in the sub process instance is completed 
     taskService.completeTask(task.getId());

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -75,7 +75,9 @@
     assertEquals("This document describes how we can make more money...", document);
     
     // the result variable is set in the task
-    taskService.setVariable(task.getId(), "result", "accept");
+    variables = new HashMap<String, Object>();
+    variables.put("result", "accept");
+    taskService.setVariables(task.getId(), variables);
     
     // the task in the sub process instance is completed 
     taskService.completeTask(task.getId());

Copied: jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments (from rev 5295, jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments)

Deleted: jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/TaskCommentsTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/TaskCommentsTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/TaskCommentsTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.examples.task.comments;
-
-import java.util.List;
-
-import org.jbpm.api.history.HistoryComment;
-import org.jbpm.api.task.Task;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TaskCommentsTest extends JbpmTestCase {
-
-  String deploymentId;
-  
-  protected void setUp() throws Exception {
-    super.setUp();
-    
-    deploymentId = repositoryService.createDeployment()
-        .addResourceFromClasspath("org/jbpm/examples/task/comments/process.jpdl.xml")
-        .deploy();
-  }
-
-  protected void tearDown() throws Exception {
-    repositoryService.deleteDeploymentCascade(deploymentId);
-    
-    super.tearDown();
-  }
-
-  public void testTaskComments() {
-    executionService.startProcessInstanceByKey("TaskComments");
-
-    List<Task> taskList = taskService.findPersonalTasks("johndoe");
-    assertEquals(1, taskList.size());
-    String taskId = taskList.get(0).getId();
-    
-    taskService.addTaskComment(taskId, "hi");
-    taskService.addTaskComment(taskId, "yo");
-    
-    List<HistoryComment> comments = taskService.getTaskComments(taskId);
-    
-    assertEquals("expected 2 comments: "+comments, 2, comments.size());
-    
-    assertEquals("hi", comments.get(0).getMessage());
-    assertEquals("yo", comments.get(1).getMessage());
-  }
-}

Copied: jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/TaskCommentsTest.java (from rev 5295, jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/TaskCommentsTest.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/TaskCommentsTest.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/java/org/jbpm/examples/task/comments/TaskCommentsTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.task.comments;
+
+import java.util.List;
+
+import org.jbpm.api.history.HistoryComment;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskCommentsTest extends JbpmTestCase {
+
+  String deploymentId;
+  
+  protected void setUp() throws Exception {
+    super.setUp();
+    
+    deploymentId = repositoryService.createDeployment()
+        .addResourceFromClasspath("org/jbpm/examples/task/comments/process.jpdl.xml")
+        .deploy();
+  }
+
+  protected void tearDown() throws Exception {
+    repositoryService.deleteDeploymentCascade(deploymentId);
+    
+    super.tearDown();
+  }
+
+  public void testTaskComments() {
+    executionService.startProcessInstanceByKey("TaskComments");
+
+    List<Task> taskList = taskService.findPersonalTasks("johndoe");
+    assertEquals(1, taskList.size());
+    String taskId = taskList.get(0).getId();
+    
+    taskService.addTaskComment(taskId, "hi");
+    taskService.addTaskComment(taskId, "yo");
+    
+    List<HistoryComment> comments = taskService.getTaskComments(taskId);
+    
+    assertEquals("expected 2 comments: "+comments, 2, comments.size());
+    
+    assertEquals("hi", comments.get(0).getMessage());
+    assertEquals("yo", comments.get(1).getMessage());
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.hibernate.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.identity.cfg.xml" />

Deleted: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/async/activity/process.png
===================================================================
(Binary files differ)

Deleted: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/async/fork/process.png
===================================================================
(Binary files differ)

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/custom/process.jpdl.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/custom/process.jpdl.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/custom/process.jpdl.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -8,11 +8,11 @@
 
   <custom name="print dots" 
         class="org.jbpm.examples.custom.PrintDots"
-        g="96,16,127,52">
+        g="96,16,100,52">
         
     <transition to="end" />
   </custom>
   
-  <end name="end" g="205,22,80,40"/>
+  <end name="end" g="231,19,80,40"/>
 
 </process>

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/java/process.jpdl.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/java/process.jpdl.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/java/process.jpdl.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -10,7 +10,7 @@
         class="org.jbpm.examples.java.JohnDoe"
         method="hello"
         var="answer"
-        g="96,16,127,52">
+        g="96,16,83,52">
         
     <field name="state"><string value="fine"/></field>
     <arg><string value="Hi, how are you?"/></arg>
@@ -22,7 +22,7 @@
         expr="#{hand}"
         method="shake"
         var="hand"
-        g="96,16,127,52">
+        g="215,17,99,52">
         
     <arg><object expr="#{joesmoe.handshakes.force}"/></arg>
     <arg><object expr="#{joesmoe.handshakes.duration}"/></arg>
@@ -30,6 +30,6 @@
     <transition to="wait" />
   </java>
 
-  <state name="wait" g="255,16,88,52"/>
+  <state name="wait" g="352,17,88,52"/>
 
 </process>

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/Order.jpdl.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/Order.jpdl.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/Order.jpdl.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -6,10 +6,10 @@
     <transition to="receive confirmation" />
   </start>
   
-  <state name="receive confirmation" g="96,16,75,52">
+  <state name="receive confirmation" g="96,16,136,52">
     <transition to="end" />
   </state>
   
-  <end name="end" g="203,19,48,48"/>
+  <end name="end" g="269,20,48,48"/>
 
 </process>
\ No newline at end of file

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -2,13 +2,13 @@
 
 <process name="SubProcessDocument" xmlns="http://jbpm.org/4.0/jpdl">
 
-  <start g="32,111,48,48">
+  <start g="43,109,48,48">
     <transition to="review" />
   </start>
 
   <sub-process name="review"
                sub-process-key="SubProcessReview"
-               g="96,16,127,52">
+               g="118,106,99,52">
                
     <transition name="ok" to="next step" g="167,67:6,-19"/>
     <transition name="nok" to="update" g="-22,-18"/>

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -2,14 +2,14 @@
 
 <process name="SubProcessDocument" xmlns="http://jbpm.org/4.0/jpdl">
 
-  <start g="32,111,48,48">
+  <start g="36,109,48,48">
     <transition to="review" />
   </start>
 
   <sub-process name="review"
                sub-process-key="SubProcessReview"
                outcome="#{result}" 
-               g="96,16,127,52">
+               g="118,106,99,52">
                
     <transition name="ok" to="next step" g="167,67:6,-19"/>
     <transition name="nok" to="update" g="-22,-18"/>

Copied: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments (from rev 5295, jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments)

Deleted: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/process.jpdl.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/process.jpdl.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="TaskComments" xmlns="http://jbpm.org/4.0/jpdl">
-
-  <start g="20,20,48,48">
-    <transition to="review" />
-  </start>
-
-  <task name="review" 
-        assignee="johndoe"
-        g="96,16,127,52">
- 
-     <transition to="wait" />
-  </task>
-  
-  <state name="wait" g="255,16,88,52"/>
-
-</process>

Copied: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/process.jpdl.xml (from rev 5295, jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/process.jpdl.xml)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/process.jpdl.xml	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/comments/process.jpdl.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="TaskComments" xmlns="http://jbpm.org/4.0/jpdl">
+
+  <start g="20,20,48,48">
+    <transition to="review" />
+  </start>
+
+  <task name="review" 
+        assignee="johndoe"
+        g="96,16,127,52">
+ 
+     <transition to="wait" />
+  </task>
+  
+  <state name="wait" g="255,16,88,52"/>
+
+</process>

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/swimlane/process.jpdl.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/swimlane/process.jpdl.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/swimlane/process.jpdl.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -19,7 +19,7 @@
   <task 
       name="calculate quote" 
       swimlane="sales representative"
-      g="255,16,88,52">
+      g="255,16,111,52">
   </task>
 
 </process>

Deleted: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/examples/taskform/vacation2.png
===================================================================
(Binary files differ)

Modified: jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/examples/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,7 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
-  
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.identity.cfg.xml" />
 

Modified: jbpm4/branches/jimma/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -158,8 +158,8 @@
 
     // prio and duedate
     task.setPriority(t0.getPriority());
-    task.setDueDate(t0.getDueDate());
-    task.setCreateDate(t0.getCreate());
+    task.setDueDate(t0.getDuedate());
+    task.setCreateDate(t0.getCreateTime());
     
     // task formResourceName url
     String url = t0.getFormResourceName()!=null ? t0.getFormResourceName() : "";

Modified: jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -27,11 +27,12 @@
 
 import org.jbpm.api.listener.EventListener;
 import org.jbpm.api.listener.EventListenerExecution;
-import org.jbpm.api.task.Task;
 import org.jbpm.pvm.internal.email.spi.MailProducer;
 import org.jbpm.pvm.internal.email.spi.MailSession;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.TaskContext;
 import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
 
 /**
  * @author Alejandro Guizar
@@ -41,24 +42,22 @@
   protected transient MailProducer mailProducer;
 
   private static final long serialVersionUID = 1L;
-  private static final String TASK_VARIABLE_NAME = "task";
 
   public void notify(EventListenerExecution execution) throws Exception {
     // find current task
     Environment environment = Environment.getCurrent();
-    Task task = environment
-        .get(DbSession.class)
-        .findTaskByExecution(execution);
-    // make task available to mail templates through execution variable
-    // TODO find a cleaner way
-    execution.setVariable(TASK_VARIABLE_NAME, task);
+    DbSession dbSession = environment.get(DbSession.class);
+    TaskImpl task = dbSession.findTaskByExecution(execution);
+
+    // make task available to mail templates through task context
+    TaskContext taskContext = new TaskContext(task);
+    environment.setContext(taskContext);
     try {
       Collection<Message> messages = mailProducer.produce(execution);
       environment.get(MailSession.class).send(messages);
+    } finally {
+      environment.removeContext(taskContext);
     }
-    finally {
-//      execution.removeVariable(TASK_VARIABLE_NAME);
-    }
   }
 
   public void setMailProducer(MailProducer mailProducer) {

Modified: jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -81,6 +81,8 @@
       inParameter.produce(executionImpl, subProcessInstance);
     }
 
+    executionImpl.historyActivityStart();
+    
     subProcessInstance.start();
     execution.waitForSignal();
   }
@@ -143,6 +145,8 @@
         environment.setContext(originalExecutionContext);
       }
     }
+    
+    executionImpl.historyActivityEnd();
 
     if (transitionName!=null) {
       execution.take(transitionName);

Modified: jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -28,12 +28,16 @@
 import org.jbpm.api.task.Task;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.events.TaskActivityStart;
 import org.jbpm.pvm.internal.model.Activity;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.model.Transition;
 import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.ParticipationImpl;
+import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
+import org.jbpm.pvm.internal.task.SwimlaneImpl;
 import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
-import org.jbpm.pvm.internal.task.TaskHandler;
 import org.jbpm.pvm.internal.task.TaskImpl;
 
 
@@ -49,15 +53,48 @@
   protected TaskDefinitionImpl taskDefinition;
   
   public void execute(ActivityExecution execution) {
-    ExecutionImpl executionImpl = (ExecutionImpl) execution;
-    TaskImpl task = executionImpl.createTask(taskDefinition);
+    execute((ExecutionImpl)execution);
+  }
 
-    TaskHandler taskHandler = task.getTaskHandler();
-    boolean wait = taskHandler.executionCreateTask(task);
+  public void execute(ExecutionImpl execution) {
+    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+    TaskImpl task = (TaskImpl) dbSession.createTask();
+    task.setTaskDefinition(taskDefinition);
+    task.setExecution(execution);
+    task.setProcessInstance(execution.getProcessInstance());
+    task.setSignalling(true);
     
-    if (wait) {
-      execution.waitForSignal();
+    // initialize the name
+    if (taskDefinition.getName()!=null) {
+      task.setName(taskDefinition.getName());
+    } else {
+      task.setName(execution.getActivityName());
     }
+
+    task.setDescription(taskDefinition.getDescription());
+    task.setPriority(taskDefinition.getPriority());
+    task.setFormResourceName(taskDefinition.getFormResourceName());
+    
+    // save task so that TaskDbSession.findTaskByExecution works for assign event listeners
+    dbSession.save(task);
+
+    SwimlaneDefinitionImpl swimlaneDefinition = taskDefinition.getSwimlaneDefinition();
+    if (swimlaneDefinition!=null) {
+      SwimlaneImpl swimlane = execution.getInitializedSwimlane(swimlaneDefinition);
+      task.setSwimlane(swimlane);
+      
+      // copy the swimlane assignments to the task
+      task.setAssignee(swimlane.getAssignee());
+      for (ParticipationImpl participant: swimlane.getParticipations()) {
+        task.addParticipation(participant.getUserId(), participant.getGroupId(), participant.getType());
+      }
+    }
+
+    execution.initializeAssignments(taskDefinition, task);
+    
+    HistoryEvent.fire(new TaskActivityStart(task), execution);
+
+    execution.waitForSignal();
   }
   
   public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
@@ -76,8 +113,7 @@
     DbSession taskDbSession = Environment
         .getFromCurrent(DbSession.class);
     TaskImpl task = (TaskImpl) taskDbSession.findTaskByExecution(execution);
-    TaskHandler taskHandler = task.getTaskHandler();
-    taskHandler.executionSignal(task);
+    task.setSignalling(false);
     
     Transition transition = null;
     List<Transition> outgoingTransitions = activity.getOutgoingTransitions();

Modified: jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -61,7 +61,6 @@
 import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
 import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
 import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
-import org.jbpm.pvm.internal.task.TaskHandler;
 import org.jbpm.pvm.internal.util.ReflectUtil;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.wire.Descriptor;
@@ -490,13 +489,6 @@
       }
     }
     
-    Element taskHandlerElement = XmlUtil.element(element, "task-handler");
-    if (taskHandlerElement!=null) {
-      ObjectDescriptor objectDescriptor = parseObjectDescriptor(taskHandlerElement, parse);
-      TaskHandler taskHandler = (TaskHandler) WireContext.create(objectDescriptor);
-      taskDefinition.setTaskHandler(taskHandler);
-    }
-  
     JpdlParser.parseAssignmentAttributes(element, taskDefinition, parse);
     
     // parse notification mail producer

Modified: jbpm4/branches/jimma/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.hibernate.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.identity.cfg.xml" />

Modified: jbpm4/branches/jimma/trunk/modules/migration/pom.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/migration/pom.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/migration/pom.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -113,12 +113,12 @@
 								<id>distribution-package</id>
 								<phase>package</phase>
 								<goals>
-									<goal>assembly</goal>
+									<goal>single</goal>
 								</goals>
 								<configuration>
 									<finalName>migration-distro</finalName>
-						            <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
-						            <appendAssemblyId>false</appendAssemblyId>
+			            <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+			            <appendAssemblyId>false</appendAssemblyId>
 									<descriptors>
 										<descriptor>scripts/assembly-distro.xml</descriptor>
 									</descriptors>

Modified: jbpm4/branches/jimma/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -157,9 +157,7 @@
 				.parseXmlString("<jbpm-configuration>"
 						+ "  <process-engine-context>"
 						+ "    <script-manager default-expression-language='juel'"
-						+ "                    default-script-language='juel'"
-						+ "                    read-contexts='execution, environment, process-engine' "
-						+ "                    write-context='execution'>"
+						+ "                    default-script-language='juel'>"
 						+ "      <script-language name='juel' factory='com.sun.script.juel.JuelScriptEngineFactory' />"
 						+ "    </script-manager>"
 						+ "  </process-engine-context> </jbpm-configuration>");

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartJBossTask.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartJBossTask.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartJBossTask.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -41,7 +41,7 @@
       String command = null; 
       if ( os.indexOf( "windows" ) != -1 ) {
         command = getJBossHome() + fileSeparator + "bin" + fileSeparator + "run.bat " + getConfigParameter();          
-      } else if ( os.indexOf( "linux" ) != -1 ) {
+      } else if ( os.indexOf( "linux" ) != -1 || os.indexOf( "mac" ) != -1) {
         command = getJBossHome() + fileSeparator + "bin" + fileSeparator + "run.sh " + getConfigParameter();
       } else {
         throw new BuildException( "os '" + os + "' not supported in the startjboss task." );

Deleted: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,273 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cal;
-
-import java.io.Serializable;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
-
-/**
- * a calendar that knows about business hours.
- */
-public class BusinessCalendar implements Serializable {
-  
-  private static final long serialVersionUID = 1L;
-  private static BusinessCalendar instance = null;
-  
-  protected long oid = -1;
-  protected int version = 0;
-  protected TimeZone timeZone = TimeZone.getDefault();
-  /** array that contains the weekdays in the index as specified by {@link Calendar#SUNDAY} (=1),
-   * {@link Calendar#MONDAY} (=2),... {@link Calendar#SATURDAY} (=7).  
-   */ 
-  protected Day[] days = null;
-  protected Holiday[] holidays = null;
-  
-  protected long secondInMillis = 1000; 
-  protected long minuteInMillis = 60000; 
-  protected long hourInMillis = 3600000; 
-  protected long dayInMillis = 24*hourInMillis; 
-  protected long weekInMillis = 7*dayInMillis; 
-  protected long monthInMillis = 30*dayInMillis; 
-  protected long yearInMillis = 365*dayInMillis; 
-
-  protected long businessDayInMillis = 8*hourInMillis; 
-  protected long businessWeekInMillis = 40*hourInMillis; 
-  protected long businessMonthInMillis = 21*dayInMillis; 
-  protected long businessYearInMillis = 220*dayInMillis; 
-  
-  /** constructor for persistence and creating an empty business calendar */
-  public BusinessCalendar() {
-  }
-
-  public static synchronized BusinessCalendar getInstance() {
-    if (instance==null) {
-      instance = new BusinessCalendar();
-    }
-    return instance;
-  }
-
-  public Date add(Date date, Duration duration) {
-    Date end = null;
-    if (duration.isBusinessTime()) {
-      DayPart dayPart = findDayPart(date);
-      boolean isInbusinessHours = (dayPart!=null);
-      if (! isInbusinessHours) {
-        Object[] result = new Object[2];
-        findDay(date).findNextDayPartStart(0, date, result);
-        date = (Date) result[0];
-        dayPart = (DayPart) result[1];
-      }
-      long millis = convertToMillis(duration);
-      end = dayPart.add(date, millis, duration.isBusinessTime());
-    } else {
-      long millis = convertToMillis(duration);
-      end = new Date(date.getTime()+millis);
-    }
-    return end;
-  }
-
-  public long convertToMillis(Duration duration){
-    long millis = duration.getMillis();
-    millis += duration.getSeconds() * secondInMillis;
-    millis += duration.getMinutes() * minuteInMillis;
-    millis += duration.getHours() * hourInMillis;
-    if (duration.isBusinessTime()) {
-      millis += duration.getDays() * businessDayInMillis;
-      millis += duration.getWeeks() * businessWeekInMillis;
-      millis += duration.getMonths() * businessMonthInMillis;
-      millis += duration.getYears() * businessYearInMillis;
-    } else {
-      millis += duration.getDays() * dayInMillis;
-      millis += duration.getWeeks() * weekInMillis;
-      millis += duration.getMonths() * monthInMillis;
-      millis += duration.getYears() * yearInMillis;
-    }
-    return millis;
-  }
-
-  public boolean isInBusinessHours(Date date) { 
-    return (findDayPart(date)!=null); 
-  } 
-
-  public boolean isHoliday(Date date) {
-    if (holidays!=null) {
-      for(Holiday holiday: holidays) {
-        if (holiday.includes(date)) {
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-
-  protected Date findStartOfNextDay(Date date) {
-    Calendar calendar = createCalendar();
-    calendar.setTime(date);
-    calendar.add(Calendar.DATE, 1);
-    calendar.set(Calendar.HOUR_OF_DAY, 0);
-    calendar.set(Calendar.MINUTE, 0);
-    calendar.set(Calendar.SECOND, 0);
-    calendar.set(Calendar.MILLISECOND, 0);
-    date = calendar.getTime();
-    while(isHoliday(date)) {
-      calendar.setTime(date);
-      calendar.add(Calendar.DATE, 1);
-      date = calendar.getTime();
-    }
-    return date;
-  }
-
-  public Calendar createCalendar() {
-    return new GregorianCalendar();
-  }
-
-  protected Day findDay(Date date) {
-    Calendar calendar = createCalendar();
-    calendar.setTime(date);
-    int weekDayIndex = calendar.get(Calendar.DAY_OF_WEEK);
-    return days[weekDayIndex];
-  }
-
-  protected DayPart findDayPart(Date date) {
-    DayPart dayPart = null;
-    if (! isHoliday(date)) {
-      Day day = findDay(date);
-      DayPart[] dayParts = day.getDayParts();
-      if (dayParts!=null) {
-        for (int i=0; ((i < dayParts.length) && (dayPart==null)); i++) {
-          DayPart candidate = dayParts[i];
-          if (candidate.includes(date)) {
-            dayPart = candidate;
-          }
-        }
-      }
-    }
-    return dayPart;
-  }
-
-  protected DayPart findNextDayPart(Date date) { 
-    DayPart nextDayPart = null; 
-    while(nextDayPart==null) { 
-      nextDayPart = findDayPart(date); 
-      if (nextDayPart==null) { 
-        date = findStartOfNextDay(date); 
-        Object result[] = new Object[2]; 
-        Day day = findDay(date); 
-        day.findNextDayPartStart(0, date, result); 
-        nextDayPart = (DayPart) result[1]; 
-      } 
-    } 
-    return nextDayPart; 
-  }
-
-  
-
-  // getters and setters //////////////////////////////////////////////////////
-  
-  public long getBusinessDayInMillis() {
-    return businessDayInMillis;
-  }
-  public void setBusinessDayInMillis(long businessDayInMillis) {
-    this.businessDayInMillis = businessDayInMillis;
-  }
-  public long getBusinessMonthInMillis() {
-    return businessMonthInMillis;
-  }
-  public void setBusinessMonthInMillis(long businessMonthInMillis) {
-    this.businessMonthInMillis = businessMonthInMillis;
-  }
-  public long getBusinessWeekInMillis() {
-    return businessWeekInMillis;
-  }
-  public void setBusinessWeekInMillis(long businessWeekInMillis) {
-    this.businessWeekInMillis = businessWeekInMillis;
-  }
-  public long getBusinessYearInMillis() {
-    return businessYearInMillis;
-  }
-  public void setBusinessYearInMillis(long businessYearInMillis) {
-    this.businessYearInMillis = businessYearInMillis;
-  }
-  public long getDayInMillis() {
-    return dayInMillis;
-  }
-  public void setDayInMillis(long dayInMillis) {
-    this.dayInMillis = dayInMillis;
-  }
-  public Day[] getDays() {
-    return days;
-  }
-  public void setDays(Day[] days) {
-    this.days = days;
-  }
-  public Holiday[] getHolidays() {
-    return holidays;
-  }
-  public void setHolidays(Holiday[] holidays) {
-    this.holidays = holidays;
-  }
-  public long getHourInMillis() {
-    return hourInMillis;
-  }
-  public void setHourInMillis(long hourInMillis) {
-    this.hourInMillis = hourInMillis;
-  }
-  public long getMinuteInMillis() {
-    return minuteInMillis;
-  }
-  public void setMinuteInMillis(long minuteInMillis) {
-    this.minuteInMillis = minuteInMillis;
-  }
-  public long getMonthInMillis() {
-    return monthInMillis;
-  }
-  public void setMonthInMillis(long monthInMillis) {
-    this.monthInMillis = monthInMillis;
-  }
-  public long getSecondInMillis() {
-    return secondInMillis;
-  }
-  public void setSecondInMillis(long secondInMillis) {
-    this.secondInMillis = secondInMillis;
-  }
-  public TimeZone getTimeZone() {
-    return timeZone;
-  }
-  public void setTimeZone(TimeZone timeZone) {
-    this.timeZone = timeZone;
-  }
-  public long getWeekInMillis() {
-    return weekInMillis;
-  }
-  public void setWeekInMillis(long weekInMillis) {
-    this.weekInMillis = weekInMillis;
-  }
-  public long getYearInMillis() {
-    return yearInMillis;
-  }
-  public void setYearInMillis(long yearInMillis) {
-    this.yearInMillis = yearInMillis;
-  } 
-}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cal;
+
+import java.util.Date;
+
+/** 
+ * @author Tom Baeyens
+ */
+public interface BusinessCalendar {
+
+  Date add(Date date, String duration);
+
+}
\ No newline at end of file

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendarImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendarImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendarImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendarImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,277 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cal;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+/**
+ * a calendar that knows about business hours.
+ */
+public class BusinessCalendarImpl implements Serializable, BusinessCalendar {
+  
+  private static final long serialVersionUID = 1L;
+  private static BusinessCalendarImpl instance = null;
+  
+  protected long oid = -1;
+  protected int version = 0;
+  protected TimeZone timeZone = TimeZone.getDefault();
+  /** array that contains the weekdays in the index as specified by {@link Calendar#SUNDAY} (=1),
+   * {@link Calendar#MONDAY} (=2),... {@link Calendar#SATURDAY} (=7).  
+   */ 
+  protected Day[] days = null;
+  protected Holiday[] holidays = null;
+  
+  protected long secondInMillis = 1000; 
+  protected long minuteInMillis = 60000; 
+  protected long hourInMillis = 3600000; 
+  protected long dayInMillis = 24*hourInMillis; 
+  protected long weekInMillis = 7*dayInMillis; 
+  protected long monthInMillis = 30*dayInMillis; 
+  protected long yearInMillis = 365*dayInMillis; 
+
+  protected long businessDayInMillis = 8*hourInMillis; 
+  protected long businessWeekInMillis = 40*hourInMillis; 
+  protected long businessMonthInMillis = 21*dayInMillis; 
+  protected long businessYearInMillis = 220*dayInMillis; 
+  
+  /** constructor for persistence and creating an empty business calendar */
+  public BusinessCalendarImpl() {
+  }
+
+  public static synchronized BusinessCalendarImpl getInstance() {
+    if (instance==null) {
+      instance = new BusinessCalendarImpl();
+    }
+    return instance;
+  }
+
+  public Date add(Date date, String duration) {
+    return add(date, new Duration(duration));
+  }
+
+  public Date add(Date date, Duration duration) {
+    Date end = null;
+    if (duration.isBusinessTime()) {
+      DayPart dayPart = findDayPart(date);
+      boolean isInbusinessHours = (dayPart!=null);
+      if (! isInbusinessHours) {
+        Object[] result = new Object[2];
+        findDay(date).findNextDayPartStart(0, date, result);
+        date = (Date) result[0];
+        dayPart = (DayPart) result[1];
+      }
+      long millis = convertToMillis(duration);
+      end = dayPart.add(date, millis, duration.isBusinessTime());
+    } else {
+      long millis = convertToMillis(duration);
+      end = new Date(date.getTime()+millis);
+    }
+    return end;
+  }
+
+  public long convertToMillis(Duration duration){
+    long millis = duration.getMillis();
+    millis += duration.getSeconds() * secondInMillis;
+    millis += duration.getMinutes() * minuteInMillis;
+    millis += duration.getHours() * hourInMillis;
+    if (duration.isBusinessTime()) {
+      millis += duration.getDays() * businessDayInMillis;
+      millis += duration.getWeeks() * businessWeekInMillis;
+      millis += duration.getMonths() * businessMonthInMillis;
+      millis += duration.getYears() * businessYearInMillis;
+    } else {
+      millis += duration.getDays() * dayInMillis;
+      millis += duration.getWeeks() * weekInMillis;
+      millis += duration.getMonths() * monthInMillis;
+      millis += duration.getYears() * yearInMillis;
+    }
+    return millis;
+  }
+
+  public boolean isInBusinessHours(Date date) { 
+    return (findDayPart(date)!=null); 
+  } 
+
+  public boolean isHoliday(Date date) {
+    if (holidays!=null) {
+      for(Holiday holiday: holidays) {
+        if (holiday.includes(date)) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+  protected Date findStartOfNextDay(Date date) {
+    Calendar calendar = createCalendar();
+    calendar.setTime(date);
+    calendar.add(Calendar.DATE, 1);
+    calendar.set(Calendar.HOUR_OF_DAY, 0);
+    calendar.set(Calendar.MINUTE, 0);
+    calendar.set(Calendar.SECOND, 0);
+    calendar.set(Calendar.MILLISECOND, 0);
+    date = calendar.getTime();
+    while(isHoliday(date)) {
+      calendar.setTime(date);
+      calendar.add(Calendar.DATE, 1);
+      date = calendar.getTime();
+    }
+    return date;
+  }
+
+  public Calendar createCalendar() {
+    return new GregorianCalendar();
+  }
+
+  protected Day findDay(Date date) {
+    Calendar calendar = createCalendar();
+    calendar.setTime(date);
+    int weekDayIndex = calendar.get(Calendar.DAY_OF_WEEK);
+    return days[weekDayIndex];
+  }
+
+  protected DayPart findDayPart(Date date) {
+    DayPart dayPart = null;
+    if (! isHoliday(date)) {
+      Day day = findDay(date);
+      DayPart[] dayParts = day.getDayParts();
+      if (dayParts!=null) {
+        for (int i=0; ((i < dayParts.length) && (dayPart==null)); i++) {
+          DayPart candidate = dayParts[i];
+          if (candidate.includes(date)) {
+            dayPart = candidate;
+          }
+        }
+      }
+    }
+    return dayPart;
+  }
+
+  protected DayPart findNextDayPart(Date date) { 
+    DayPart nextDayPart = null; 
+    while(nextDayPart==null) { 
+      nextDayPart = findDayPart(date); 
+      if (nextDayPart==null) { 
+        date = findStartOfNextDay(date); 
+        Object result[] = new Object[2]; 
+        Day day = findDay(date); 
+        day.findNextDayPartStart(0, date, result); 
+        nextDayPart = (DayPart) result[1]; 
+      } 
+    } 
+    return nextDayPart; 
+  }
+
+  
+
+  // getters and setters //////////////////////////////////////////////////////
+  
+  public long getBusinessDayInMillis() {
+    return businessDayInMillis;
+  }
+  public void setBusinessDayInMillis(long businessDayInMillis) {
+    this.businessDayInMillis = businessDayInMillis;
+  }
+  public long getBusinessMonthInMillis() {
+    return businessMonthInMillis;
+  }
+  public void setBusinessMonthInMillis(long businessMonthInMillis) {
+    this.businessMonthInMillis = businessMonthInMillis;
+  }
+  public long getBusinessWeekInMillis() {
+    return businessWeekInMillis;
+  }
+  public void setBusinessWeekInMillis(long businessWeekInMillis) {
+    this.businessWeekInMillis = businessWeekInMillis;
+  }
+  public long getBusinessYearInMillis() {
+    return businessYearInMillis;
+  }
+  public void setBusinessYearInMillis(long businessYearInMillis) {
+    this.businessYearInMillis = businessYearInMillis;
+  }
+  public long getDayInMillis() {
+    return dayInMillis;
+  }
+  public void setDayInMillis(long dayInMillis) {
+    this.dayInMillis = dayInMillis;
+  }
+  public Day[] getDays() {
+    return days;
+  }
+  public void setDays(Day[] days) {
+    this.days = days;
+  }
+  public Holiday[] getHolidays() {
+    return holidays;
+  }
+  public void setHolidays(Holiday[] holidays) {
+    this.holidays = holidays;
+  }
+  public long getHourInMillis() {
+    return hourInMillis;
+  }
+  public void setHourInMillis(long hourInMillis) {
+    this.hourInMillis = hourInMillis;
+  }
+  public long getMinuteInMillis() {
+    return minuteInMillis;
+  }
+  public void setMinuteInMillis(long minuteInMillis) {
+    this.minuteInMillis = minuteInMillis;
+  }
+  public long getMonthInMillis() {
+    return monthInMillis;
+  }
+  public void setMonthInMillis(long monthInMillis) {
+    this.monthInMillis = monthInMillis;
+  }
+  public long getSecondInMillis() {
+    return secondInMillis;
+  }
+  public void setSecondInMillis(long secondInMillis) {
+    this.secondInMillis = secondInMillis;
+  }
+  public TimeZone getTimeZone() {
+    return timeZone;
+  }
+  public void setTimeZone(TimeZone timeZone) {
+    this.timeZone = timeZone;
+  }
+  public long getWeekInMillis() {
+    return weekInMillis;
+  }
+  public void setWeekInMillis(long weekInMillis) {
+    this.weekInMillis = weekInMillis;
+  }
+  public long getYearInMillis() {
+    return yearInMillis;
+  }
+  public void setYearInMillis(long yearInMillis) {
+    this.yearInMillis = yearInMillis;
+  } 
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Day.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Day.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Day.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -34,7 +34,7 @@
   protected long oid = -1;
   protected int version = 0;
   protected DayPart[] dayParts = null;
-  protected BusinessCalendar businessCalendar = null;
+  protected BusinessCalendarImpl businessCalendarImpl = null;
 
   public void findNextDayPartStart(int dayPartIndex, Date date, Object[] result) {
     // if there is a day part in this day that starts after the given date
@@ -49,20 +49,20 @@
       }
     } else {
       // descend recustively
-      date = businessCalendar.findStartOfNextDay(date);
-      Day nextDay = businessCalendar.findDay(date);
+      date = businessCalendarImpl.findStartOfNextDay(date);
+      Day nextDay = businessCalendarImpl.findDay(date);
       nextDay.findNextDayPartStart(0, date, result);
     }
   }
 
-  public BusinessCalendar getBusinessCalendar() {
-    return businessCalendar;
+  public BusinessCalendarImpl getBusinessCalendar() {
+    return businessCalendarImpl;
   }
   public DayPart[] getDayParts() {
     return dayParts;
   }
-  public void setBusinessCalendar(BusinessCalendar businessCalendar) {
-    this.businessCalendar = businessCalendar;
+  public void setBusinessCalendar(BusinessCalendarImpl businessCalendarImpl) {
+    this.businessCalendarImpl = businessCalendarImpl;
   }
   public void setDayParts(DayPart[] dayParts) {
     this.dayParts = dayParts;

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/DayPart.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/DayPart.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/DayPart.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -45,8 +45,8 @@
   public Date add(Date date, long millis, boolean isBusinessTime) {
     Date end = null;
     
-    BusinessCalendar businessCalendar = day.getBusinessCalendar();
-    Calendar calendar = businessCalendar.createCalendar();
+    BusinessCalendarImpl businessCalendarImpl = day.getBusinessCalendar();
+    Calendar calendar = businessCalendarImpl.createCalendar();
     calendar.setTime(date);
     int hour = calendar.get(Calendar.HOUR_OF_DAY);
     int minute = calendar.get(Calendar.MINUTE);

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Holiday.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Holiday.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Holiday.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -35,7 +35,7 @@
   protected int version = 0;
   protected Date fromDay = null;
   protected Date toDay = null;
-  protected BusinessCalendar businessCalendar = null;
+  protected BusinessCalendarImpl businessCalendarImpl = null;
 
   /*
   public static List parseHolidays(Properties calendarProperties, BusinessCalendar businessCalendar) {
@@ -85,11 +85,11 @@
              && (date.getTime()<toDay.getTime())
            );
   }
-  public BusinessCalendar getBusinessCalendar() {
-    return businessCalendar;
+  public BusinessCalendarImpl getBusinessCalendar() {
+    return businessCalendarImpl;
   }
-  public void setBusinessCalendar(BusinessCalendar businessCalendar) {
-    this.businessCalendar = businessCalendar;
+  public void setBusinessCalendar(BusinessCalendarImpl businessCalendarImpl) {
+    this.businessCalendarImpl = businessCalendarImpl;
   }
   public Date getFromDay() {
     return fromDay;

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -125,7 +125,7 @@
   public void setSessionFactory(Object sessionFactory) {
     processEngineWireContext
         .getWireDefinition()
-        .addDescriptor(new ProvidedObjectDescriptor(sessionFactory));
+        .addDescriptor(new ProvidedObjectDescriptor(sessionFactory, true));
   }
 
   public Configuration setInputStream(InputStream inputStream) {

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -22,16 +22,16 @@
 package org.jbpm.pvm.internal.cmd;
 
 import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 import org.jbpm.pvm.internal.session.DbSession;
 
 
 /**
  * @author Tom Baeyens
  */
-public class AddReplyCommentCmd extends AbstractCommand<Comment> {
+public class AddReplyCommentCmd extends AbstractCommand<HistoryComment> {
 
   private static final long serialVersionUID = 1L;
   
@@ -46,13 +46,13 @@
     this.message = message;
   }
 
-  public Comment execute(Environment environment) throws Exception {
+  public HistoryComment execute(Environment environment) throws Exception {
     DbSession dbSession = environment.get(DbSession.class);
-    CommentImpl parentComment = dbSession.get(CommentImpl.class, Long.parseLong(commentId));
+    HistoryCommentImpl parentComment = dbSession.get(HistoryCommentImpl.class, Long.parseLong(commentId));
     if (parentComment==null) {
       throw new JbpmException("parent comment doesn't exist: "+commentId);
     }
-    Comment replyComment = parentComment.createComment(message);
+    HistoryComment replyComment = parentComment.createReply(message);
     return replyComment;
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,16 +21,18 @@
  */
 package org.jbpm.pvm.internal.cmd;
 
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
 import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.task.TaskImpl;
 
 
 /**
  * @author Tom Baeyens
  */
-public class AddTaskCommentCmd extends AbstractCommand<Comment> {
+public class AddTaskCommentCmd extends AbstractCommand<HistoryComment> {
 
   private static final long serialVersionUID = 1L;
   
@@ -42,10 +44,15 @@
     this.message = message;
   }
 
-  public Comment execute(Environment environment) throws Exception {
+  public HistoryComment execute(Environment environment) throws Exception {
     DbSession dbSession = environment.get(DbSession.class);
-    TaskImpl task = dbSession.get(TaskImpl.class, taskDbid);
-    Comment comment = task.createComment(message);
+    HistoryTaskImpl historyTask = dbSession.get(HistoryTaskImpl.class, taskDbid);
+    if (historyTask==null) {
+      throw new JbpmException("task "+taskDbid+" doesn't exist");
+    }
+    HistoryCommentImpl comment = new HistoryCommentImpl(message);
+    historyTask.addDetail(comment);
+    dbSession.save(comment);
     return comment;
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -23,6 +23,8 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.events.TaskAssign;
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.task.TaskImpl;
 
@@ -60,6 +62,9 @@
     } else {
       task.setAssignee(userId, true);
     }
+    
+    HistoryEvent.fire(new TaskAssign(task, userId));
+
     return null;
   }
 }

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryTaskQueryCmd.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryTaskQueryCmd.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryTaskQueryCmd.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryTaskQueryCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.query.HistoryTaskQueryImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CreateHistoryTaskQueryCmd implements Command<HistoryTaskQueryImpl> {
+
+  private static final long serialVersionUID = 1L;
+
+  public HistoryTaskQueryImpl execute(Environment environment) throws Exception {
+    return new HistoryTaskQueryImpl();
+  }
+
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -23,7 +23,7 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.session.DbSession;
 
 
@@ -45,7 +45,7 @@
 
   public Object execute(Environment environment) throws Exception {
     DbSession dbSession = environment.get(DbSession.class);
-    CommentImpl comment = (CommentImpl) dbSession.get(CommentImpl.class, Long.parseLong(commentId));
+    HistoryDetailImpl comment = (HistoryDetailImpl) dbSession.get(HistoryDetailImpl.class, Long.parseLong(commentId));
     if (comment!=null) {
       dbSession.delete(comment);
       

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -29,7 +29,7 @@
 import org.jbpm.api.ProcessInstance;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.repository.DeploymentImpl;
 import org.jbpm.pvm.internal.repository.RepositoryCache;
 import org.jbpm.pvm.internal.session.DbSession;
@@ -67,20 +67,18 @@
 
     for (ProcessDefinition processDefinition: processDefinitions) {
       String processDefinitionId = processDefinition.getId();
-      List<ProcessInstance> processInstances = dbSession.createProcessInstanceQuery()
-        .processDefinitionId(processDefinitionId)
-        .list();
+      List<String> processInstanceIds = dbSession.findProcessInstanceIds(processDefinitionId);
       
       if (cascade) {
-        for (ProcessInstance processInstance: processInstances) {
-          dbSession.deleteProcessInstance(processInstance.getId(), true);
+        for (String processInstanceId: processInstanceIds) {
+          dbSession.deleteProcessInstance(processInstanceId, true);
         }
 
         dbSession.deleteProcessDefinitionHistory(processDefinitionId);
         
       } else {
-        if (!processInstances.isEmpty()) {
-          throw new JbpmException("cannot delete deployment "+deploymentId+": still executions for "+processDefinition+": "+processInstances);
+        if (!processInstanceIds.isEmpty()) {
+          throw new JbpmException("cannot delete deployment "+deploymentId+": still executions for "+processDefinition+": "+processInstanceIds);
         }
       }
     }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -33,14 +33,20 @@
   private static final long serialVersionUID = 1L;
 
   String processInstanceId;
+  boolean cascade = false;
   
   public DeleteProcessInstance(String processInstanceId) {
     this.processInstanceId = processInstanceId;
   }
 
+  public DeleteProcessInstance(String processInstanceId, boolean cascade) {
+    this.processInstanceId = processInstanceId;
+    this.cascade = cascade;
+  }
+
   public Void execute(Environment environment) throws Exception {
     DbSession dbSession = Environment.getFromCurrent(DbSession.class);
-    dbSession.deleteProcessInstance(processInstanceId);
+    dbSession.deleteProcessInstance(processInstanceId, cascade);
     return null;
   }
 

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -23,36 +23,50 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.task.TaskImpl;
 
 /**
+ * @author Tom Baeyens
  * @author Alejandro Guizar
  */
 public class DeleteTaskCmd extends AbstractCommand<Void> {
 
   private static final long serialVersionUID = 1L;
 
-  protected String taskId;
+  protected long taskDbid;
   protected String reason;
+  protected boolean deleteHistory = false;
 
   public DeleteTaskCmd(String taskId) {
-    this.taskId = taskId;
+    this.taskDbid = Long.parseLong(taskId);
   }
 
   public DeleteTaskCmd(String taskId, String reason) {
-    this.taskId = taskId;
+    this.taskDbid = Long.parseLong(taskId);
     this.reason = reason;
   }
 
+  public DeleteTaskCmd(String taskId, boolean deleteHistory) {
+    this.taskDbid = Long.parseLong(taskId);
+    this.deleteHistory = deleteHistory;
+  }
+
   public Void execute(Environment environment) throws Exception {
     DbSession dbSession = environment.get(DbSession.class);
-    TaskImpl task = (TaskImpl) dbSession.get(TaskImpl.class, Long.parseLong(taskId));
+    TaskImpl task = (TaskImpl) dbSession.get(TaskImpl.class, taskDbid);
     if (task!=null) {
       task.delete(reason);
       dbSession.delete(task);
+      if (deleteHistory) {
+        HistoryTaskImpl historyTask = (HistoryTaskImpl) dbSession.get(HistoryTaskImpl.class, taskDbid);
+        if (historyTask!=null) {
+          dbSession.delete(historyTask);
+        }
+      }
     } else {
-      throw new JbpmException("task "+taskId+" doesn't exist");
+      throw new JbpmException("task "+taskDbid+" doesn't exist");
     }
     return null;
   }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -25,16 +25,17 @@
 import java.util.Collections;
 import java.util.List;
 
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
 import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.task.TaskImpl;
 
 
 /**
  * @author Tom Baeyens
  */
-public class GetTaskCommentsCmd extends AbstractCommand<List<Comment>> {
+public class GetTaskCommentsCmd extends AbstractCommand<List<HistoryComment>> {
 
   private static final long serialVersionUID = 1L;
   
@@ -44,25 +45,20 @@
     this.taskId = taskId;
   }
 
-  public List<Comment> execute(Environment environment) throws Exception {
+  public List<HistoryComment> execute(Environment environment) throws Exception {
     DbSession dbSession = environment.get(DbSession.class);
-    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
-    
-    if (task != null) {
-      List<Comment> comments = task.getComments();
-      forceInitializationAndClean(comments);
-      return comments;
-    } else {
-      return Collections.emptyList();
-    }    
+
+    List<HistoryComment> comments = dbSession.findCommentsByTaskId(taskId);
+    forceInitializationAndClean(comments);
+    return comments;
   }
 
-  protected void forceInitializationAndClean(List<Comment> comments) {
+  protected void forceInitializationAndClean(List<HistoryComment> comments) {
     if (comments!=null) {
       comments.size();
-      List<Comment> copy = new ArrayList<Comment>(comments);
+      List<HistoryComment> copy = new ArrayList<HistoryComment>(comments);
       for (int i=0; i<copy.size(); i++) {
-        Comment comment = copy.get(i);
+        HistoryComment comment = copy.get(i);
         
         // when comments get deleted, it's possible that we 
         // get null values in the list as the indexes of the 
@@ -73,7 +69,7 @@
         if (comment==null) {
           comments.remove(i);
         } else {
-          forceInitializationAndClean(comment.getComments());
+          forceInitializationAndClean(comment.getReplies());
         }
       }
     }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -22,10 +22,15 @@
 package org.jbpm.pvm.internal.cmd;
 
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.HistorySession;
+import org.jbpm.pvm.internal.history.events.TaskCreated;
+import org.jbpm.pvm.internal.history.events.TaskUpdated;
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.task.TaskImpl;
 
 /**
+ * @author Tom Baeyens
  * @author Alejandro Guizar
  */
 public class SaveTaskCmd extends AbstractCommand<String> {
@@ -40,9 +45,24 @@
 
   public String execute(Environment environment) throws Exception {
     DbSession dbSession = environment.get(DbSession.class);
-    
-    dbSession.saveTask(task);
-    
+
+    if (task.isNew()) {
+      if (task.getSuperTaskDbid()!=null) {
+        TaskImpl parentTask = (TaskImpl) dbSession.get(TaskImpl.class, task.getSuperTaskDbid());
+        parentTask.addSubTask(task);
+        task.setSuperTaskDbid(null);
+      }
+      
+      dbSession.save(task);
+      
+      HistoryEvent.fire(new TaskCreated(task));
+
+    } else {
+      dbSession.update(task);
+
+      HistoryEvent.fire(new TaskUpdated(task));
+    }
+
     return task.getId();
   }
 }

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/TaskContext.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/TaskContext.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/TaskContext.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/TaskContext.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.env;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jbpm.api.job.Job;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskContext implements Context {
+  
+  private static final String KEY_TASK = "task";
+  
+  static final Set<String> keys = Collections.unmodifiableSet(getKeys());
+  
+  static Set<String> getKeys() {
+    Set<String> keys = new HashSet<String>();
+    keys.add(KEY_TASK);
+    return keys;
+  }
+
+  TaskImpl task;
+
+  public TaskContext(TaskImpl task) {
+    this.task = task;
+  }
+
+  public Object get(String key) {
+    if (KEY_TASK.equals(key)) {
+      return task;
+    }
+    return null;
+  }
+
+  public boolean has(String key) {
+    return KEY_TASK.equals(key);
+  }
+
+  public Set<String> keys() {
+    return keys;
+  }
+
+  public Object set(String key, Object value) {
+    task.setVariable(key, value);
+    return null;
+  }
+  
+  public <T> T get(Class<T> type) {
+    if (Job.class.isAssignableFrom(type)) {
+      return (T) task;
+    }
+    return null;
+  }
+
+  public String getName() {
+    return Context.CONTEXTNAME_TASK;
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -31,13 +31,14 @@
 import org.jbpm.api.Execution;
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.api.history.HistoryProcessInstance;
 import org.jbpm.api.task.Task;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.client.ClientExecution;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
 import org.jbpm.pvm.internal.job.JobImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -84,6 +85,10 @@
     session.save(entity);
   }
 
+  public void update(Object entity) {
+    session.update(entity);
+  }
+
   public void merge(Object entity) {
     session.merge(entity);
   }
@@ -144,7 +149,7 @@
     
     if (deleteProcessInstances) {
       for (String processInstanceId : processInstanceIds) {
-        deleteProcessInstance(processInstanceId);
+        deleteProcessInstance(processInstanceId, deleteHistory);
       }
     } else {
       if (processInstanceIds.size()>0) {
@@ -167,11 +172,6 @@
           .list();
     
     for (HistoryProcessInstanceImpl hpi: historyProcessInstances) {
-      session.createQuery(
-        "delete "+HistoryActivityInstanceImpl.class.getName()+" hai " +
-        "where hai.historyProcessInstance = :historyProcessInstance ")
-          .setEntity("historyProcessInstance", hpi)
-          .executeUpdate();
       session.delete(hpi);
     }
   }
@@ -219,7 +219,7 @@
     query.setString("processDefinitionId", processDefinitionId);
     return query.list();
   }
-
+  
   public void deleteProcessInstance(String processInstanceId) {
     deleteProcessInstance(processInstanceId, true);
   }
@@ -234,8 +234,7 @@
          && (isHistoryEnabled())
        ) {
       // try to get the history 
-      HistoryProcessInstanceImpl historyProcessInstance = (HistoryProcessInstanceImpl) 
-          session.get(HistoryProcessInstanceImpl.class, processInstanceId);
+      HistoryProcessInstanceImpl historyProcessInstance = findHistoryProcessInstanceById(processInstanceId);
   
       // if there is a history process instance in the db
       if (historyProcessInstance!=null) {
@@ -271,6 +270,15 @@
     }
   }
 
+  public HistoryProcessInstanceImpl findHistoryProcessInstanceById(String processInstanceId) {
+    return (HistoryProcessInstanceImpl) session
+      .createQuery(
+        "select hpi " +
+        "from "+HistoryProcessInstance.class.getName()+" as hpi " +
+        "where hpi.processInstanceId = '"+processInstanceId+"'"
+      ).uniqueResult();
+  }
+
   List<TaskImpl> findTasks(String processInstanceId) {
     Query query = session.createQuery(
       "select task " +
@@ -347,14 +355,16 @@
     }
   }
 
-  public Task createTask() {
+  public TaskImpl createTask() {
     TaskImpl task = newTask();
-    task.setCreate(Clock.getCurrentTime());
+    task.setCreateTime(Clock.getCurrentTime());
     return task;
   }
 
   protected TaskImpl newTask() {
-    return new TaskImpl();
+    TaskImpl task = new TaskImpl();
+    task.setNew(true);
+    return task;
   }
 
   public TaskImpl findTaskByDbid(long taskDbid) {
@@ -362,28 +372,16 @@
   }
 
 
-  public Task findTaskByExecution(Execution execution) {
+  public TaskImpl findTaskByExecution(Execution execution) {
     Query query = session.createQuery(
       "select task " +
       "from "+TaskImpl.class.getName()+" as task " +
       "where task.execution = :execution"
     );
     query.setEntity("execution", execution);
-    return (Task) query.uniqueResult();
+    return (TaskImpl) query.uniqueResult();
   }
   
-  public void saveTask(Task task) {
-    TaskImpl taskImpl = (TaskImpl) task;
-    
-    if (taskImpl.getSuperTaskDbid()!=null) {
-      TaskImpl parentTask = (TaskImpl) session.load(TaskImpl.class, taskImpl.getSuperTaskDbid());
-      parentTask.addSubTask(taskImpl);
-      taskImpl.setSuperTaskDbid(null);
-    }
-    
-    session.saveOrUpdate(task);
-  }
-  
   public JobImpl<?> findFirstAcquirableJob() {
     Query query = session.getNamedQuery("findFirstAcquirableJob");
     query.setTimestamp("now", Clock.getCurrentTime());
@@ -427,4 +425,21 @@
   public DeploymentQueryImpl createDeploymentQuery() {
     return new DeploymentQueryImpl();
   }
+
+  public List<HistoryComment> findCommentsByTaskId(String taskId) {
+    Long taskDbid = null;
+    try {
+      taskDbid = Long.parseLong(taskId);
+    } catch (Exception e) {
+      throw new JbpmException("invalid taskId: "+taskId);
+    }
+    return session.createQuery(
+      "select hc " +
+      "from "+HistoryCommentImpl.class.getName()+" as hc " +
+      "where hc.historyTask.dbid = :taskDbid " +
+      "order by hc.historyTaskIndex asc "
+    ).setLong("taskDbid", taskDbid)
+    .list();
+  }
+  
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -23,6 +23,7 @@
 
 import java.io.Serializable;
 
+import org.jbpm.pvm.internal.env.Environment;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 
 /** base class for process logs.  Process logs are dispatched to the 
@@ -46,4 +47,19 @@
   }
 
   public abstract void process();
+  
+  public static void fire(HistoryEvent historyEvent) {
+    fire(historyEvent, null);
+  }
+  
+  public static void fire(HistoryEvent historyEvent, ExecutionImpl execution) {
+    Environment environment = Environment.getCurrent();
+    if (environment!=null) {
+      HistorySession historySession = environment.get(HistorySession.class);
+      if (historySession!=null) {
+        historyEvent.setExecution(execution);
+        historySession.process(historyEvent);
+      }
+    }
+  }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -28,8 +28,6 @@
 public class HistorySessionImpl implements HistorySession {
 
   public void process(HistoryEvent historyEvent) {
-    if (historyEvent.execution.getId()!=null) {
-      historyEvent.process();
-    }
+    historyEvent.process();
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,12 +21,12 @@
  */
 package org.jbpm.pvm.internal.history.events;
 
-import org.hibernate.Session;
 import org.jbpm.api.history.HistoryProcessInstance;
 import org.jbpm.pvm.internal.env.Environment;
 import org.jbpm.pvm.internal.history.HistoryEvent;
 import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
 import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
+import org.jbpm.pvm.internal.session.DbSession;
 
 
 /**
@@ -37,22 +37,22 @@
   private static final long serialVersionUID = 1L;
 
   public void process() {
-    Session session = Environment.getFromCurrent(Session.class);
+    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
 
-    String processInstanceId = execution.getProcessInstance().getId();
+    long processInstanceDbid = execution.getProcessInstance().getDbid();
 
     HistoryProcessInstance historyProcessInstanceImpl = (HistoryProcessInstance) 
-        session.load(HistoryProcessInstanceImpl.class, processInstanceId);
+        dbSession.get(HistoryProcessInstanceImpl.class, processInstanceDbid);
     
-    HistoryActivityInstanceImpl historyActivityInstanceImpl = 
+    HistoryActivityInstanceImpl historyActivityInstance = 
         createHistoryActivityInstance(historyProcessInstanceImpl);
     
     String activityType = execution.getActivity().getType();
-    historyActivityInstanceImpl.setType(activityType);
+    historyActivityInstance.setType(activityType);
     
-    session.save(historyActivityInstanceImpl);
+    dbSession.save(historyActivityInstance);
     
-    execution.setHistoryActivityInstanceDbid(historyActivityInstanceImpl.getDbid());
+    execution.setHistoryActivityInstanceDbid(historyActivityInstance.getDbid());
   }
 
   protected HistoryActivityInstanceImpl createHistoryActivityInstance(HistoryProcessInstance historyProcessInstanceImpl) {

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceCreate.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceCreate.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceCreate.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceCreate.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import java.io.Serializable;
+
+import org.hibernate.Session;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessInstanceCreate extends HistoryEvent implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+  
+  public void process() {
+    HistoryProcessInstance historyProcessInstanceImpl = new HistoryProcessInstanceImpl(execution);
+    Session session = Environment.getFromCurrent(Session.class);
+    session.save(historyProcessInstanceImpl);
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -37,7 +37,7 @@
   public void process() {
     Session session = Environment.getFromCurrent(Session.class);
     HistoryProcessInstanceImpl historyProcessInstanceImpl = (HistoryProcessInstanceImpl) 
-        session.load(HistoryProcessInstanceImpl.class, execution.getId());
+        session.load(HistoryProcessInstanceImpl.class, execution.getDbid());
     historyProcessInstanceImpl.setEndTime(Clock.getCurrentTime());
     historyProcessInstanceImpl.setState(execution.getState());
     historyProcessInstanceImpl.setEndActivityName(execution.getActivityName());

Deleted: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.history.events;
-
-import java.io.Serializable;
-
-import org.hibernate.Session;
-import org.jbpm.api.history.HistoryProcessInstance;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.history.HistoryEvent;
-import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessInstanceStart extends HistoryEvent implements Serializable {
-
-  private static final long serialVersionUID = 1L;
-  
-  public void process() {
-    HistoryProcessInstance historyProcessInstanceImpl = new HistoryProcessInstanceImpl(execution);
-    Session session = Environment.getFromCurrent(Session.class);
-    session.save(historyProcessInstanceImpl);
-  }
-}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskActivityStart.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskActivityStart.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskActivityStart.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskActivityStart.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskActivityStart extends HistoryEvent {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected TaskImpl task;
+  
+  public TaskActivityStart(TaskImpl task) {
+    this.task = task;
+  }
+  
+  public void process() {
+    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+
+    ExecutionImpl processInstance = execution.getProcessInstance();
+    long processInstanceDbid = processInstance.getDbid();
+
+    HistoryProcessInstance historyProcessInstance = 
+        dbSession.get(HistoryProcessInstanceImpl.class, processInstanceDbid);
+    
+    HistoryTaskImpl historyTask = new HistoryTaskImpl(task);
+    historyTask.setExecutionId(execution.getId());
+    
+    HistoryActivityInstanceImpl historyActivityInstance = 
+        new HistoryTaskInstanceImpl(historyProcessInstance, execution, historyTask);
+    
+    String activityType = execution.getActivity().getType();
+    historyActivityInstance.setType(activityType);
+    
+    dbSession.save(historyActivityInstance);
+    
+    execution.setHistoryActivityInstanceDbid(historyActivityInstance.getDbid());
+  }
+
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskAssign.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskAssign.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskAssign.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,7 +21,11 @@
  */
 package org.jbpm.pvm.internal.history.events;
 
+import org.jbpm.pvm.internal.env.Environment;
 import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
 
 /**
  * @author Alejandro Guizar
@@ -30,15 +34,18 @@
 
   private static final long serialVersionUID = 1L;
 
-  protected String userId;
+  protected TaskImpl task;
+  protected String assignee;
 
-  public TaskAssign(String userId) {
-    this.userId = userId;
+  public TaskAssign(TaskImpl task, String assignee) {
+    this.task = task;
+    this.assignee = assignee;
   }
 
-  @Override
   public void process() {
-    // TODO
+    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+    HistoryTaskImpl historyTaskInstance = (HistoryTaskImpl) 
+        dbSession.get(HistoryTaskImpl.class, task.getDbid());
+    historyTaskInstance.setAssignee(assignee);
   }
-
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskComplete.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskComplete.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskComplete.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,18 +21,42 @@
  */
 package org.jbpm.pvm.internal.history.events;
 
+import org.hibernate.Session;
+import org.jbpm.api.history.HistoryTask;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
+import org.jbpm.pvm.internal.util.Clock;
 
 
+
 /**
  * @author Tom Baeyens
  */
-public class TaskComplete extends ActivityEnd {
+public class TaskComplete extends HistoryEvent {
 
   private static final long serialVersionUID = 1L;
   
   protected String outcome;
 
   public TaskComplete(String outcome) {
-    this.transitionName = outcome;
+    this.outcome = outcome;
   }
+
+  public void process() {
+    Session session = Environment.getFromCurrent(Session.class);
+    Long historyActivityInstanceDbId = execution.getHistoryActivityInstanceDbid();
+    HistoryTaskInstanceImpl historyTaskInstance = (HistoryTaskInstanceImpl) 
+        session.load(HistoryTaskInstanceImpl.class, historyActivityInstanceDbId); 
+    historyTaskInstance.setEndTime(Clock.getCurrentTime());
+    historyTaskInstance.setTransitionName(outcome);
+
+    HistoryTaskImpl historyTask = historyTaskInstance.getHistoryTask();
+    historyTask.setOutcome(outcome);
+    historyTask.setEndTime(Clock.getCurrentTime());
+    historyTask.setState(HistoryTask.STATE_COMPLETED);
+
+    session.update(historyTaskInstance);
+  }
 }

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCreated.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCreated.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCreated.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCreated.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskCreated extends HistoryEvent {
+  
+  private static final long serialVersionUID = 1L;
+
+  protected TaskImpl task;
+
+  public TaskCreated(TaskImpl task) {
+    this.task = task;
+  }
+
+  public void process() {
+    DbSession dbSession = Environment.getFromCurrent(DbSession.class); 
+    HistoryTaskImpl historyTask = new HistoryTaskImpl(task);
+    dbSession.save(historyTask);
+    
+    if (task.getSuperTask()!=null) {
+      HistoryTaskImpl superHistoryTask = dbSession.get(HistoryTaskImpl.class, task.getSuperTask().getDbid());
+      superHistoryTask.addSubTask(historyTask);
+    }
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,8 +21,14 @@
  */
 package org.jbpm.pvm.internal.history.events;
 
+import org.jbpm.api.JbpmException;
+import org.jbpm.pvm.internal.env.Environment;
 import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
 import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.pvm.internal.util.Clock;
 
 
 /**
@@ -32,17 +38,25 @@
 
   private static final long serialVersionUID = 1L;
 
+  protected TaskImpl task;
   protected String reason;
   
-  public TaskDelete(String reason) {
+  public TaskDelete(TaskImpl task, String reason) {
+    if (task.getExecution()!=null) {
+      throw new JbpmException("tasks related to an execution must be completed. they cannot just be deleted");
+    }
+      
+    this.task = task;
     this.reason = reason;
   }
 
   protected void updateHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance) {
     super.updateHistoryActivityInstance(historyActivityInstance);
 
-    HistoryTaskInstanceImpl historyTaskInstance = (HistoryTaskInstanceImpl) historyActivityInstance;
-    historyTaskInstance.setState(reason);
+    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+    HistoryTaskImpl historyTask = (HistoryTaskImpl) dbSession.get(HistoryTaskImpl.class, task.getDbid());
+    historyTask.setState(reason);
+    historyTask.setEndTime(Clock.getCurrentTime());
   }
 
   protected Class<? extends HistoryActivityInstanceImpl> getHistoryActivityInstanceClass() {

Deleted: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskStart.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskStart.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskStart.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.history.events;
-
-import org.jbpm.api.history.HistoryProcessInstance;
-import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
-import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TaskStart extends ActivityStart {
-
-  private static final long serialVersionUID = 1L;
-  
-  protected String assignee;
-  
-  public TaskStart(Task task) {
-    this.assignee = task.getAssignee();
-  }
- 
-  protected HistoryActivityInstanceImpl createHistoryActivityInstance(HistoryProcessInstance historyProcessInstanceImpl) {
-    return new HistoryTaskInstanceImpl(historyProcessInstanceImpl, execution, assignee);
-  }
-}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskUpdated.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskUpdated.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskUpdated.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskUpdated.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskUpdated extends HistoryEvent {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected TaskImpl task;
+
+  public TaskUpdated(TaskImpl task) {
+    this.task = task;
+  }
+
+  public void process() {
+    DbSession dbSession = Environment.getFromCurrent(DbSession.class); 
+    HistoryTaskImpl historyTask = dbSession.get(HistoryTaskImpl.class, task.getDbid());
+    historyTask.updated(task);
+  }
+}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableCreate.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableCreate.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableCreate.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableCreate.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.api.history.HistoryTask;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
+import org.jbpm.pvm.internal.history.model.HistoryVariableImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.pvm.internal.type.Variable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class VariableCreate extends HistoryEvent {
+
+  private static final long serialVersionUID = 1L;
+
+  Variable variable;
+  
+  public VariableCreate(Variable variable) {
+    this.variable = variable;
+  }
+
+  public void process() {
+    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+    
+    dbSession.save(variable);
+
+    HistoryProcessInstanceImpl historyProcessInstance = null;
+    ExecutionImpl processInstance = variable.getProcessInstance();
+    if (processInstance!=null) {
+      long processInstanceDbid = processInstance.getDbid();
+      historyProcessInstance = (HistoryProcessInstanceImpl) 
+          dbSession.get(HistoryProcessInstanceImpl.class, processInstanceDbid);
+    }
+    
+    HistoryTaskImpl historyTask = null;
+    TaskImpl task = variable.getTask();
+    if (task!=null) {
+      long taskDbid = task.getDbid();
+      historyTask = (HistoryTaskImpl) 
+          dbSession.get(HistoryTaskImpl.class, taskDbid);
+    }
+    
+    HistoryVariableImpl historyVariable = new HistoryVariableImpl(historyProcessInstance, historyTask, variable);
+    dbSession.save(historyVariable);
+  }
+}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableUpdate.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableUpdate.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableUpdate.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableUpdate.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryVariableImpl;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.type.Variable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class VariableUpdate extends HistoryEvent {
+
+  private static final long serialVersionUID = 1L;
+
+  Variable variable;
+  
+  public VariableUpdate(Variable variable) {
+    this.variable = variable;
+  }
+
+  @Override
+  public void process() {
+    DbSession dbSession = Environment.getFromCurrent(DbSession.class); 
+    HistoryVariableImpl historyVariable = dbSession.get(HistoryVariableImpl.class, variable.getDbid());
+    historyVariable.updated(variable);
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstanceImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstanceImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstanceImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -22,7 +22,11 @@
 package org.jbpm.pvm.internal.history.model;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 import org.jbpm.api.history.HistoryActivityInstance;
 import org.jbpm.api.history.HistoryProcessInstance;
@@ -51,6 +55,12 @@
   protected long duration;
   
   protected String transitionName;
+
+  protected int nextDetailIndex = 1;
+
+  /** only here to get hibernate cascade */
+  protected Set<HistoryDetailImpl> details = new HashSet<HistoryDetailImpl>();
+
   
   public HistoryActivityInstanceImpl() {
   }
@@ -62,6 +72,13 @@
     this.activityName = activity.getName();
     this.startTime = execution.getHistoryActivityStart();
   }
+  
+  // details //////////////////////////////////////////////////////////////////
+  
+  public void addDetail(HistoryDetailImpl detail) {
+    detail.setHistoryActivityInstance(this, nextDetailIndex);
+    nextDetailIndex++;
+  }
 
   public void setEndTime(Date endTime) {
     this.endTime = endTime;

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryCommentImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryCommentImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryCommentImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryCommentImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.history.HistoryComment;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryCommentImpl extends HistoryDetailImpl implements HistoryComment {
+
+  private static final long serialVersionUID = 1L;
+
+  protected String message;
+  protected List<HistoryCommentImpl> replies = new ArrayList<HistoryCommentImpl>();
+  
+  public HistoryCommentImpl() {
+  }
+
+  public HistoryCommentImpl(String message) {
+    // superclass has dummy string constructor to differentiate from  
+    // the default constructor which is used by hibernate 
+    super(null);
+    if (message==null) {
+      throw new JbpmException("message is null");
+    }
+    this.message = message;
+  }
+  
+  // replies //////////////////////////////////////////////////////////////////
+  
+  public HistoryCommentImpl createReply(String message) {
+    HistoryCommentImpl reply = new HistoryCommentImpl(message);
+    replies.add(reply);
+    return reply;
+  }
+
+  public List<HistoryComment> getReplies() {
+    return (List) replies;
+  }
+  
+  // getters and setters //////////////////////////////////////////////////////
+
+  public String getMessage() {
+    return message;
+  }
+  public void setMessage(String message) {
+    this.message = message;
+  }
+}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.util.Clock;
+import org.jbpm.pvm.internal.util.EqualsUtil;
+
+public class HistoryDetailImpl implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+
+  protected long dbid;
+  protected int dbversion;
+  protected String userId = null;
+  protected Date time = null;
+  
+  protected HistoryProcessInstanceImpl historyProcessInstance;
+  protected Integer historyProcessInstanceIndex;
+
+  protected HistoryActivityInstanceImpl historyActivityInstance;
+  protected Integer historyActivityInstanceIndex;
+  
+  protected HistoryTaskImpl historyTask;
+  protected Integer historyTaskIndex;
+
+  protected HistoryVariableImpl historyVariable;
+  protected Integer historyVariableIndex;
+
+  protected HistoryDetailImpl() {
+  }
+
+  // dummy string constructor to differentiate from  
+  // the default constructor which is used by hibernate 
+  protected HistoryDetailImpl(String dummy) {
+    this.time = Clock.getCurrentTime();
+    
+    Environment environment = Environment.getCurrent();
+    if (environment!=null) {
+      this.userId = environment.getUserId();
+    }
+  }
+  
+  // equals ///////////////////////////////////////////////////////////////////
+  // hack to support comparing hibernate proxies against the real objects
+  // since this always falls back to ==, we don't need to overwrite the hashcode
+  public boolean equals(Object o) {
+    return EqualsUtil.equals(this, o);
+  }
+
+  // cusomtized getters and setters ////////////////////////////////////////////
+
+  public String getId() {
+    return Long.toString(dbid);
+  }
+
+  // getters and setters //////////////////////////////////////////////////////
+
+  public long getDbid() {
+    return dbid;
+  }
+  public String getUserId() {
+    return userId;
+  }
+  public Date getTime() {
+    return time;
+  }
+  public void setUserId(String userId) {
+    this.userId = userId;
+  }
+  public void setTime(Date time) {
+    this.time = time;
+  }
+
+  public void setHistoryProcessInstance(HistoryProcessInstanceImpl historyProcessInstance, int historyProcessInstanceIndex) {
+    this.historyProcessInstance = historyProcessInstance;
+    this.historyProcessInstanceIndex = historyProcessInstanceIndex;
+  }
+
+  public void setHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance, int historyActivityInstanceIndex) {
+    this.historyActivityInstance = historyActivityInstance;
+    this.historyActivityInstanceIndex = historyActivityInstanceIndex;
+  }
+
+  public void setHistoryTask(HistoryTaskImpl historyTask, int historyTaskIndex) {
+    this.historyTask = historyTask;
+    this.historyTaskIndex = historyTaskIndex;
+  }
+
+  public void setHistoryVariable(HistoryVariableImpl historyVariable, int historyVariableIndex) {
+    this.historyVariable = historyVariable;
+    this.historyVariableIndex = historyVariableIndex;
+  }
+}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryPriorityUpdateImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryPriorityUpdateImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryPriorityUpdateImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryPriorityUpdateImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryPriorityUpdateImpl extends HistoryDetailImpl {
+
+  private static final long serialVersionUID = 1L;
+  
+  public int oldPriority;
+  public int newPriority;
+
+  public HistoryPriorityUpdateImpl() {
+  }
+
+  public HistoryPriorityUpdateImpl(int oldPriority, int newPriority) {
+    // superclass has dummy string constructor to differentiate from  
+    // the default constructor which is used by hibernate 
+    super(null);
+    this.oldPriority = oldPriority;
+    this.newPriority = newPriority;
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -23,6 +23,7 @@
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.HashSet;
 import java.util.Set;
 
 import org.jbpm.api.history.HistoryProcessInstance;
@@ -49,18 +50,31 @@
   protected String endActivityName;
   protected Date startTime;
   protected Date endTime;
-  protected Long duration = null;
-  
-  /** only here to get hibernate cascade deletes */
+  protected Long duration;
+  protected int nextDetailIndex = 1;
+
+  /** only here to get hibernate cascade */
   protected Set<HistoryActivityInstanceImpl> historyActivityInstances;
+
+  /** only here to get hibernate cascade */
+  protected Set<HistoryVariableImpl> historyVariables;
+
+  /** only here to get hibernate cascade */
+  protected Set<HistoryDetailImpl> details = new HashSet<HistoryDetailImpl>();
+
   
+  public void addDetail(HistoryDetailImpl detail) {
+    detail.setHistoryProcessInstance(this, nextDetailIndex);
+    nextDetailIndex++;
+  }
+
   public HistoryProcessInstanceImpl() {
   }
 
   public HistoryProcessInstanceImpl(ExecutionImpl processInstance) {
+    this.dbid = processInstance.getDbid();
     this.processDefinition = processInstance.getProcessDefinition();
     this.processDefinitionId = processDefinition.getId();
-    this.dbid = processInstance.getDbid();
     this.processInstanceId = processInstance.getId();
     this.key = processInstance.getKey();
     this.state = "active";

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskAssignmentImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskAssignmentImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskAssignmentImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskAssignmentImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryTaskAssignmentImpl extends HistoryDetailImpl {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected String oldAssignee;
+  protected String newAssignee;
+
+  public HistoryTaskAssignmentImpl() {
+  }
+
+  public HistoryTaskAssignmentImpl(String oldAssignee, String newAssignee) {
+    // superclass has dummy string constructor to differentiate from  
+    // the default constructor which is used by hibernate 
+    super(null);
+    this.oldAssignee = oldAssignee;
+    this.newAssignee = newAssignee;
+  }
+}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskDuedateUpdateImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskDuedateUpdateImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskDuedateUpdateImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskDuedateUpdateImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import java.util.Date;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryTaskDuedateUpdateImpl extends HistoryDetailImpl {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected Date oldDuedate;
+  protected Date newDuedate;
+
+  public HistoryTaskDuedateUpdateImpl() {
+  }
+
+  public HistoryTaskDuedateUpdateImpl(Date oldDuedate, Date newDuedate) {
+    // superclass has dummy string constructor to differentiate from  
+    // the default constructor which is used by hibernate 
+    super(null);
+    this.oldDuedate = oldDuedate;
+    this.newDuedate = newDuedate;
+  }
+}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,165 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.api.history.HistoryTask;
+import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.pvm.internal.util.Clock;
+import org.jbpm.pvm.internal.util.EqualsUtil;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryTaskImpl implements Serializable, HistoryTask {
+
+  private static final long serialVersionUID = 1L;
+
+  protected long dbid;
+  protected int dbversion;
+
+  protected String executionId;
+  protected String assignee;
+  protected String state;
+  protected String outcome;
+  protected int priority;
+  protected Date duedate;
+  protected Date createTime;
+  protected Date endTime;
+  protected long duration;
+  protected int nextDetailIndex = 1;
+
+  protected Set<HistoryTaskImpl> subTasks = new HashSet<HistoryTaskImpl>();
+
+  /** only here to get hibernate cascade */
+  protected Set<HistoryVariableImpl> historyVariables;
+
+  /** only here to get hibernate cascade */
+  protected Set<HistoryDetailImpl> details = new HashSet<HistoryDetailImpl>();
+
+  public HistoryTaskImpl() {
+  }
+
+  public HistoryTaskImpl(TaskImpl task) {
+    this.dbid = task.getDbid();
+    this.assignee = task.getAssignee();
+    this.priority = task.getPriority();
+    this.duedate = task.getDuedate();
+    this.createTime = Clock.getCurrentTime();
+  }
+
+  public void updated(TaskImpl task) {
+    if ( (assignee==null && task.getAssignee()!=null)
+         || (assignee!=null) && (!assignee.equals(task.getAssignee()))
+       ) {
+      addDetail(new HistoryTaskAssignmentImpl(assignee, task.getAssignee()));
+      this.assignee = task.getAssignee();
+    }
+    if (priority!=task.getPriority()) {
+      addDetail(new HistoryPriorityUpdateImpl(priority, task.getPriority()));
+      this.priority = task.getPriority();
+    }
+    if ( (duedate==null && task.getDuedate()!=null)
+         || (duedate!=null) && (!duedate.equals(task.getDuedate()))
+       ) {
+      addDetail(new HistoryTaskDuedateUpdateImpl(duedate, task.getDuedate()));
+      this.duedate = task.getDuedate();
+    }
+  }
+
+  // details //////////////////////////////////////////////////////////////////
+  
+  public void addDetail(HistoryDetailImpl detail) {
+    detail.setHistoryTask(this, nextDetailIndex);
+    nextDetailIndex++;
+  }
+
+  // subtasks /////////////////////////////////////////////////////////////////
+  
+  public void addSubTask(HistoryTaskImpl historyTask) {
+    subTasks.add(historyTask);
+  }
+
+  // equals ///////////////////////////////////////////////////////////////////
+  // hack to support comparing hibernate proxies against the real objects
+  // since this always falls back to ==, we don't need to overwrite the hashcode
+  public boolean equals(Object o) {
+    return EqualsUtil.equals(this, o);
+  }
+  
+  // customized getters and setters ///////////////////////////////////////////
+  
+  public String getId() {
+    return Long.toString(dbid);
+  }
+
+  public void setEndTime(Date endTime) {
+    this.endTime = endTime;
+    this.duration = endTime.getTime() - createTime.getTime();
+  }
+
+  // getters and setters //////////////////////////////////////////////////////
+
+  public String getState() {
+    return state;
+  }
+  public String getAssignee() {
+    return assignee;
+  }
+  public String getOutcome() {
+    return outcome;
+  }
+  public void setOutcome(String outcome) {
+    this.outcome = outcome;
+  }
+  public void setAssignee(String assignee) {
+    this.assignee = assignee;
+  }
+  public Date getCreateTime() {
+    return createTime;
+  }
+  public Date getEndTime() {
+    return endTime;
+  }
+  public long getDuration() {
+    return duration;
+  }
+  public void setDuration(long duration) {
+    this.duration = duration;
+  }
+  public String getExecutionId() {
+    return executionId;
+  }
+  public void setState(String state) {
+    this.state = state;
+  }
+  public void setExecutionId(String executionId) {
+    this.executionId = executionId;
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstanceImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstanceImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstanceImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -31,29 +31,18 @@
 public class HistoryTaskInstanceImpl extends HistoryActivityInstanceImpl {
 
   private static final long serialVersionUID = 1L;
-
-  protected String assignee;
-  protected String state;
   
+  HistoryTaskImpl historyTask;
+
   public HistoryTaskInstanceImpl() {
-    this.state = "active";
   }
 
-  public HistoryTaskInstanceImpl(HistoryProcessInstance historyProcessInstanceImpl, ExecutionImpl execution, String assignee) {
+  public HistoryTaskInstanceImpl(HistoryProcessInstance historyProcessInstanceImpl, ExecutionImpl execution, HistoryTaskImpl historyTask) {
     super(historyProcessInstanceImpl, execution);
-    this.assignee = assignee;
+    this.historyTask = historyTask;
   }
-  
-  public String getAssignee() {
-    return assignee;
+
+  public HistoryTaskImpl getHistoryTask() {
+    return historyTask;
   }
-  public void setAssignee(String assignee) {
-    this.assignee = assignee;
-  }
-  public String getState() {
-    return state;
-  }
-  public void setState(String state) {
-    this.state = state;
-  }
 }

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.type.Variable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryVariableImpl implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+
+  protected long dbid;
+  protected int dbversion;
+  
+  protected HistoryProcessInstanceImpl historyProcessInstance;
+  protected HistoryTaskImpl historyTask;
+
+  protected String processInstanceId;
+  protected String executionId;
+  protected String variableName;
+  protected String value;
+  protected int nextDetailIndex = 1;
+
+  /** only here to get hibernate cascade */
+  protected Set<HistoryDetailImpl> details = new HashSet<HistoryDetailImpl>();
+
+  protected HistoryVariableImpl() {
+  }
+  
+  public HistoryVariableImpl(HistoryProcessInstanceImpl historyProcessInstance, HistoryTaskImpl historyTask, Variable variable) {
+    this.dbid = variable.getDbid();
+
+    this.historyProcessInstance = historyProcessInstance;
+    this.historyTask = historyTask;
+
+    ExecutionImpl processInstance = variable.getProcessInstance();
+    if (processInstance!=null) {
+      this.processInstanceId = processInstance.getId();
+    }
+    // this.executionId = variable.getExecution().getId();
+
+    this.variableName = variable.getKey();
+    this.value = variable.getTextValue();
+  }
+  
+  public void updated(Variable variable) {
+    String newValue = variable.getTextValue();
+    if ( (value==null && newValue!=null)
+         || (value!=null && (!value.equals(newValue)))
+       ) {
+      addDetail(new HistoryVariableUpdateImpl(value, newValue));
+    }
+  }
+  
+  public void addDetail(HistoryDetailImpl detail) {
+    detail.setHistoryVariable(this, nextDetailIndex);
+    nextDetailIndex++;
+  }
+}

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableUpdateImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableUpdateImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableUpdateImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryVariableUpdateImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryVariableUpdateImpl extends HistoryDetailImpl {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected String oldValue;
+  protected String newValue;
+
+  public HistoryVariableUpdateImpl() {
+  }
+  
+  public HistoryVariableUpdateImpl(String oldValue, String newValue) {
+    // superclass has dummy string constructor to differentiate from  
+    // the default constructor which is used by hibernate 
+    super(null);
+    this.oldValue = oldValue;
+    this.newValue = newValue;
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -28,13 +28,13 @@
   protected int dbversion;
 
   /** date until which the command should not be executed
-   * for async messages, this dueDate should be set to null. */
+   * for async messages, this duedate should be set to null. */
   protected Date dueDate = null;
   
   /** job state. */
   protected String state = STATE_WAITING;
 
-  /** the execution (if any) for this jobImpl */  
+  /** the execution (if any) for this job */  
   protected ExecutionImpl execution;
 
   /** the process instance */  

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -28,12 +28,13 @@
 import org.jbpm.api.job.Timer;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.cal.BusinessCalendar;
-import org.jbpm.pvm.internal.cal.Duration;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentDefaults;
 import org.jbpm.pvm.internal.env.Transaction;
 import org.jbpm.pvm.internal.jobexecutor.JobAddedNotification;
 import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
 import org.jbpm.pvm.internal.model.ObservableElement;
+import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.session.TimerSession;
 import org.jbpm.pvm.internal.util.Clock;
@@ -69,29 +70,11 @@
   }
 
   public void setDueDateDescription(String dueDateDescription) {
-    Duration duration = new Duration(dueDateDescription);
+    ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
+    dueDateDescription = (String) scriptManager.evaluateExpression(dueDateDescription, null);
     Date now = Clock.getCurrentTime();
-    
-    if ( duration.isBusinessTime()
-         || duration.getMonths()>0 
-         || duration.getYears()>0
-       ) {
-      Environment environment = Environment.getCurrent();
-      if (environment==null) {
-        throw new JbpmException("no environment to get business calendar for calculating dueDate "+dueDateDescription);
-      }
-      BusinessCalendar businessCalendar = environment.get(BusinessCalendar.class);
-      dueDate = businessCalendar.add(now, duration);
-
-    } else {
-      long millis = duration.getMillis() + 
-                    1000*( duration.getSeconds() + 
-                           60*( duration.getMinutes() + 
-                                60*( duration.getHours() + 
-                                     24*( duration.getDays() + 
-                                          7*duration.getWeeks()))));
-      dueDate = new Date(now.getTime() + millis);
-    }
+    BusinessCalendar businessCalendar = Environment.getFromCurrent(BusinessCalendar.class);
+    dueDate = businessCalendar.add(now, dueDateDescription);
   }
 
   public Boolean execute(Environment environment) throws Exception {
@@ -126,7 +109,7 @@
     } else { // there is a repeat on this timer
       deleteThisJob = false;
       // suppose that it took the timer runner thread a very long time to execute the timers
-      // then the repeat action dueDate could already have passed
+      // then the repeat action duedate could already have passed
       do {
         setDueDateDescription(repeat);
       } while (dueDate.getTime() <= Clock.getCurrentTime().getTime());

Deleted: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.model;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.Comment;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.util.Clock;
-import org.jbpm.pvm.internal.util.EqualsUtil;
-
-public class CommentImpl implements Serializable, Comment {
-
-  private static final long serialVersionUID = 1L;
-
-  protected long dbid;
-  protected int dbversion;
-  protected String userId = null;
-  protected Date time = null;
-  protected String message = null;
-  protected List<CommentImpl> comments = new ArrayList<CommentImpl>();
-
-  public CommentImpl() {
-  }
-
-  public CommentImpl(String message) {
-    this.message = message;
-    this.time = Clock.getCurrentTime();
-    
-    Environment environment = Environment.getCurrent();
-    if (environment!=null) {
-      this.userId = environment.getUserId();
-    }
-  }
-  
-  // replies //////////////////////////////////////////////////////////////////
-  
-  public Comment createComment(String message) {
-    if (message==null) {
-      throw new JbpmException("message is null");
-    }
-    CommentImpl reply = new CommentImpl(message);
-    comments.add(reply);
-    return reply;
-  }
-
-  public void removeComment(Comment comment) {
-    if (comment==null) {
-      throw new JbpmException("reply is null");
-    }
-    if (comments.contains(comment)) {
-      comments.remove(comment);
-    }
-  }
-  
-  public List<Comment> getComments() {
-    return (List)comments;
-  }
-  
-  
-  public void setComments(List<CommentImpl> replies) {
-    this.comments = replies;
-  }
-
-  // equals ///////////////////////////////////////////////////////////////////
-  // hack to support comparing hibernate proxies against the real objects
-  // since this always falls back to ==, we don't need to overwrite the hashcode
-  public boolean equals(Object o) {
-    return EqualsUtil.equals(this, o);
-  }
-
-  // cusomtized getters and setters ////////////////////////////////////////////
-
-  public String getId() {
-    return Long.toString(dbid);
-  }
-
-  // getters and setters //////////////////////////////////////////////////////
-
-  public long getDbid() {
-    return dbid;
-  }
-  public String getUserId() {
-    return userId;
-  }
-  public String getMessage() {
-    return message;
-  }
-  public Date getTime() {
-    return time;
-  }
-  public void setUserId(String userId) {
-    this.userId = userId;
-  }
-  public void setTime(Date time) {
-    this.time = time;
-  }
-  public void setMessage(String message) {
-    this.message = message;
-  }
-}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -27,7 +27,6 @@
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -41,7 +40,6 @@
 import org.jbpm.api.job.Job;
 import org.jbpm.api.job.Timer;
 import org.jbpm.api.listener.EventListenerExecution;
-import org.jbpm.api.model.Comment;
 import org.jbpm.api.model.Event;
 import org.jbpm.api.model.OpenExecution;
 import org.jbpm.api.task.Assignable;
@@ -53,13 +51,12 @@
 import org.jbpm.pvm.internal.env.Environment;
 import org.jbpm.pvm.internal.env.ExecutionContext;
 import org.jbpm.pvm.internal.history.HistoryEvent;
-import org.jbpm.pvm.internal.history.HistorySession;
 import org.jbpm.pvm.internal.history.events.ActivityEnd;
 import org.jbpm.pvm.internal.history.events.ActivityStart;
 import org.jbpm.pvm.internal.history.events.AutomaticEnd;
 import org.jbpm.pvm.internal.history.events.DecisionEnd;
+import org.jbpm.pvm.internal.history.events.ProcessInstanceCreate;
 import org.jbpm.pvm.internal.history.events.ProcessInstanceEnd;
-import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
 import org.jbpm.pvm.internal.job.JobImpl;
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.model.op.AtomicOperation;
@@ -71,16 +68,11 @@
 import org.jbpm.pvm.internal.session.RepositorySession;
 import org.jbpm.pvm.internal.session.TimerSession;
 import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
-import org.jbpm.pvm.internal.task.ParticipationImpl;
 import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
 import org.jbpm.pvm.internal.task.SwimlaneImpl;
-import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
-import org.jbpm.pvm.internal.task.TaskImpl;
 import org.jbpm.pvm.internal.type.Variable;
 import org.jbpm.pvm.internal.util.EqualsUtil;
 import org.jbpm.pvm.internal.util.Priority;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.WireContext;
 
 /**
  * @author Tom Baeyens
@@ -124,9 +116,6 @@
   /** swimlanes */
   protected Map<String, SwimlaneImpl> swimlanes = new HashMap<String, SwimlaneImpl>();
 
-  /** the free text comments users make on this execution */
-  protected Set<CommentImpl> comments = new LinkedHashSet<CommentImpl>();
-  
   /** reference to the current activity instance history record */
   protected Long historyActivityInstanceDbid;
   
@@ -194,6 +183,8 @@
     if (idGenerator!=null) {
       this.id = idGenerator.createId(processDefinition, null, this);
     }
+    
+    HistoryEvent.fire(new ProcessInstanceCreate(), this);
   }
 
   // execution method : start /////////////////////////////////////////////////
@@ -205,7 +196,6 @@
     this.state = STATE_ACTIVE_ROOT;
     ExecutionImpl scopedExecution = initializeScopes();
     
-    fireHistoryEvent(new ProcessInstanceStart());
     fire(Event.START, getProcessDefinition());
     if (getActivity()!=null) {
       scopedExecution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
@@ -360,7 +350,7 @@
       parent.removeExecution(this);
       
     } else { // this is a process instance
-      fireHistoryEvent(new ProcessInstanceEnd());
+      HistoryEvent.fire(new ProcessInstanceEnd(), this);
       fire(Event.END, getProcessDefinition());
 
       if (superProcessExecution!=null) {
@@ -707,46 +697,7 @@
   
   
   // tasks ////////////////////////////////////////////////////////////////////
-  
-  public TaskImpl createTask(TaskDefinitionImpl taskDefinition) {
-    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
-    TaskImpl task = (TaskImpl) dbSession.createTask();
-    task.setTaskDefinition(taskDefinition);
-    task.setExecution(this);
-    task.setProcessInstance(processInstance);
-    task.setSignalling(true);
-    
-    // initialize the name
-    if (taskDefinition.getName()!=null) {
-      task.setName(taskDefinition.getName());
-    } else {
-      task.setName(getActivityName());
-    }
 
-    task.setDescription(taskDefinition.getDescription());
-    task.setPriority(taskDefinition.getPriority());
-    task.setFormResourceName(taskDefinition.getFormResourceName());
-    
-    // save task so that TaskDbSession.findTaskByExecution works for assign event listeners
-    dbSession.saveTask(task);
-    
-    SwimlaneDefinitionImpl swimlaneDefinition = taskDefinition.getSwimlaneDefinition();
-    if (swimlaneDefinition!=null) {
-      SwimlaneImpl swimlane = getInitializedSwimlane(swimlaneDefinition);
-      task.setSwimlane(swimlane);
-      
-      // copy the swimlane assignments to the task
-      task.setAssignee(swimlane.getAssignee());
-      for (ParticipationImpl participant: swimlane.getParticipations()) {
-        task.addParticipation(participant.getUserId(), participant.getGroupId(), participant.getType());
-      }
-    }
-
-    initializeAssignments(taskDefinition, task);
-    
-    return task;
-  }
-
   /** tasks and swimlane assignment.
    * SwimlaneDefinitionImpl is base class for TaskDefinitionImpl.
    * Both Task and Swimlane implement Assignable. */
@@ -840,28 +791,6 @@
     return swimlane;
   }
   
-  // comments /////////////////////////////////////////////////////////////////
-  
-  public Comment createComment(String message) {
-    if (message==null) {
-      throw new JbpmException("message is null");
-    }
-    CommentImpl comment = new CommentImpl(message);
-    addComment(comment);
-    return comment;
-  }
-  
-  public void removeComment(Comment comment) {
-    throw new UnsupportedOperationException("please implement me");
-  }
-
-  public void addComment(CommentImpl comment) {
-    if (comment==null) {
-      throw new JbpmException("comment is null");
-    }
-    comments.add(comment);
-  }
-
   // child executions /////////////////////////////////////////////////////////
 
   public ExecutionImpl createExecution() {
@@ -989,7 +918,7 @@
   }
 
   public void createSystemVariable(String key, Object value, String typeName) {
-    Variable variable = createVariableObject(key, value, typeName);
+    Variable variable = createVariableObject(key, value, typeName, false);
     systemVariables.put(variable.getKey(), variable);
   }
 
@@ -1101,17 +1030,6 @@
 
   ////////////////////////////////////////////////////////////////////////////////
 
-  public void fireHistoryEvent(HistoryEvent historyEvent) {
-    Environment environment = Environment.getCurrent();
-    if (environment!=null) {
-      HistorySession historySession = environment.get(HistorySession.class);
-      if (historySession!=null) {
-        historyEvent.setExecution(this);
-        historySession.process(historyEvent);
-      }
-    }
-  }
-
   // overriding the ScopeInstanceImpl methods /////////////////////////////////
   
   public ScopeInstanceImpl getParentVariableScope() {
@@ -1139,23 +1057,23 @@
   // history //////////////////////////////////////////////////////////////////
 
   public void historyAutomatic() {
-    fireHistoryEvent(new AutomaticEnd());
+    HistoryEvent.fire(new AutomaticEnd(), this);
   }
 
   public void historyDecision(String transitionName) {
-    fireHistoryEvent(new DecisionEnd(transitionName));
+    HistoryEvent.fire(new DecisionEnd(transitionName), this);
   }
   
   public void historyActivityStart() {
-    fireHistoryEvent(new ActivityStart());
+    HistoryEvent.fire(new ActivityStart(), this);
   }
 
   public void historyActivityEnd() {
-    fireHistoryEvent(new ActivityEnd());
+    HistoryEvent.fire(new ActivityEnd(), this);
   }
 
   public void historyActivityEnd(String transitionName) {
-    fireHistoryEvent(new ActivityEnd(transitionName));
+    HistoryEvent.fire(new ActivityEnd(transitionName), this);
   }
 
   // equals ///////////////////////////////////////////////////////////////////
@@ -1229,14 +1147,16 @@
     return false;
   }
 
-  public List<Comment> getComments() {
-    return new ArrayList<Comment>(comments);
-  }
-
   public boolean isProcessInstance() {
     return parent==null;
   }
 
+  // getters and setters for scope instance //////////////////////////////////////
+  
+  public ExecutionImpl getExecution() {
+    return this;
+  }
+
   // getters and setters /////////////////////////////////////////////////////////
   
   public TransitionImpl getTransition() {
@@ -1278,9 +1198,6 @@
   public void setProcessInstance(ExecutionImpl processInstance) {
     this.processInstance = processInstance;
   }
-  public void setComments(Set<CommentImpl> comments) {
-    this.comments = comments;
-  }
   public String getKey() {
     return key;
   }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -33,7 +33,10 @@
 import org.jbpm.api.JbpmException;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.events.VariableCreate;
 import org.jbpm.pvm.internal.job.TimerImpl;
+import org.jbpm.pvm.internal.task.TaskImpl;
 import org.jbpm.pvm.internal.type.Converter;
 import org.jbpm.pvm.internal.type.Type;
 import org.jbpm.pvm.internal.type.TypeSet;
@@ -72,24 +75,23 @@
         String key = variableDefinition.getName();
         Object value = variableDefinition.getInitValue(outerExecution);
         String typeName = variableDefinition.getTypeName();
-        createVariable(key, value, typeName);
+        boolean isHistoryEnabled = variableDefinition.isHistoryEnabled();
+        createVariable(key, value, typeName, isHistoryEnabled);
       }
     }
   }
 
   public void createVariable(String key, Object value) {
-    createVariable(key, value, null);
+    createVariable(key, value, null, false);
   }
 
-  public void createVariable(String key, Object value, String typeName) {
-    Variable variable = createVariableObject(key, value, typeName);
+  public void createVariable(String key, Object value, String typeName, boolean isHistoryEnabled) {
+    Variable variable = createVariableObject(key, value, typeName, isHistoryEnabled);
     variables.put(variable.getKey(), variable);
     hasVariables = true;
-
-    // TODO add create-variable-log
   }
 
-  protected Variable createVariableObject(String key, Object value, String typeName) {
+  protected Variable createVariableObject(String key, Object value, String typeName, boolean isHistoryEnabled) {
     log.debug("create variable '"+key+"' in '"+this+"' with value '"+value+"'");
     
     Type type = null;
@@ -130,8 +132,15 @@
     }
 
     variable.setKey(key);
+    variable.setExecution(getExecution());
+    variable.setTask(getTask());
+    variable.setHistoryEnabled(isHistoryEnabled);
+
+    if (isHistoryEnabled) {
+      HistoryEvent.fire(new VariableCreate(variable));
+    }
+    
     variable.setValue(value);
-    variable.setProcessInstance(getProcessInstance());
 
     return variable;
   }
@@ -153,7 +162,7 @@
       variable.setValue(value);
 
     } else if (getParentVariableScope()==null) {
-      createVariable(key, value, null);
+      createVariable(key, value, null, false);
 
     } else {
       getParentVariableScope().setVariable(key,value);
@@ -353,10 +362,14 @@
 
   // customizable methods /////////////////////////////////////////////////////
   
-  public ExecutionImpl getProcessInstance() {
+  public ExecutionImpl getExecution() {
     return null;
   }
 
+  public TaskImpl getTask() {
+    return null;
+  }
+
   public ExecutionImpl getTimerExecution() {
     return null;
   }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -43,6 +43,7 @@
 
   protected String name;
   protected String typeName;
+  protected boolean isHistoryEnabled;
 
   protected String initExpression;
   protected String initLanguage;
@@ -89,4 +90,10 @@
   public void setInitLanguage(String initLanguage) {
     this.initLanguage = initLanguage;
   }
+  public boolean isHistoryEnabled() {
+    return isHistoryEnabled;
+  }
+  public void setHistoryEnabled(boolean isHistoryEnabled) {
+    this.isHistoryEnabled = isHistoryEnabled;
+  }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -26,7 +26,6 @@
 import org.hibernate.Query;
 import org.jbpm.api.history.HistoryProcessInstance;
 import org.jbpm.api.history.HistoryProcessInstanceQuery;
-import org.jbpm.pvm.internal.cmd.CommandService;
 import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
 
 /**
@@ -48,7 +47,7 @@
     hql.append(" as hpi ");
     
     if (processInstanceId!=null) {
-      appendWhereClause(" hpi.id = '"+processInstanceId+"' ", hql);
+      appendWhereClause(" hpi.processInstanceId = '"+processInstanceId+"' ", hql);
     }
     
     if (processDefinitionId!=null) {

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryTaskQueryImpl.java (from rev 5295, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryTaskQueryImpl.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryTaskQueryImpl.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryTaskQueryImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.query;
+
+import java.util.Date;
+import java.util.List;
+
+import org.hibernate.Query;
+import org.jbpm.api.history.HistoryTask;
+import org.jbpm.api.history.HistoryTaskQuery;
+import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryTaskQueryImpl extends AbstractQuery implements HistoryTaskQuery {
+
+  protected String taskId;
+  protected String executionId;
+  protected String assignee;
+  protected String state;
+  protected String outcome;
+  protected Long tookLessThen;
+  protected Long tookLongerThen;
+  protected Date startedBefore;
+  protected Date startedAfter;
+
+  public String hql() {
+    StringBuilder hql = new StringBuilder();
+    hql.append("select ht ");
+    hql.append("from ");
+    hql.append(HistoryTaskImpl.class.getName());
+    hql.append(" as ht ");
+    
+    if (taskId!=null) {
+      appendWhereClause(" ht.dbid = "+taskId+" ", hql);
+    }
+    
+    if (executionId!=null) {
+      appendWhereClause(" ht.executionId = '"+executionId+"' ", hql);
+    }
+    
+    if (assignee!=null) {
+      appendWhereClause(" ht.assignee = '"+assignee+"' ", hql);
+    }
+
+    if (state!=null) {
+      appendWhereClause(" ht.state = '"+state+"' ", hql);
+    }
+
+    if (outcome!=null) {
+      appendWhereClause(" ht.outcome = '"+outcome+"' ", hql);
+    }
+
+    if (tookLessThen!=null) {
+      appendWhereClause(" ht.duration < :tookLessThen ", hql);
+    }
+    
+    if (tookLongerThen!=null) {
+      appendWhereClause(" ht.duration > :tookLongerThen ", hql);
+    }
+    
+    if (startedBefore!=null) {
+      appendWhereClause(" ht.startTime < :startedBefore ", hql);
+    }
+    
+    if (startedAfter!=null) {
+      appendWhereClause(" ht.startTime > :startedAfter ", hql);
+    }
+    
+    return hql.toString();
+  }
+
+  protected void applyParameters(Query query) {
+    if (tookLessThen!=null) {
+      query.setLong("tookLessThen", tookLessThen);
+    }
+    
+    if (tookLongerThen!=null) {
+      query.setLong("tookLongerThen", tookLongerThen);
+    }
+    
+    if (startedBefore!=null) {
+      query.setTime("startedBefore", startedBefore);
+    }
+    
+    if (startedAfter!=null) {
+      query.setTime("startedAfter", startedAfter);
+    }
+  }
+
+  public List<HistoryTask> list() {
+    return (List) untypedList();
+  }
+  
+  public HistoryTask uniqueResult() {
+    return (HistoryTask) untypedUniqueResult();
+  }
+
+  public HistoryTaskQuery taskId(String taskId) {
+    this.taskId = taskId;
+    return this;
+  }
+
+  public HistoryTaskQuery executionId(String executionId) {
+    this.executionId = executionId;
+    return this;
+  }
+
+  public HistoryTaskQuery assignee(String assignee) {
+    this.assignee = assignee;
+    return this;
+  }
+
+  public HistoryTaskQuery state(String state) {
+    this.state = state;
+    return this;
+  }
+
+  public HistoryTaskQuery outcome(String outcome) {
+    this.outcome = outcome;
+    return this;
+  }
+
+  public HistoryTaskQuery orderAsc(String property) {
+    addOrderByClause("ht."+property+" asc");
+    return this;
+  }
+
+  public HistoryTaskQuery orderDesc(String property) {
+    addOrderByClause("ht."+property+" desc");
+    return this;
+  }
+
+  public HistoryTaskQuery page(int firstResult, int maxResults) {
+    this.page = new Page(firstResult, maxResults);
+    return this;
+  }
+
+  public HistoryTaskQuery startedAfter(Date time) {
+    this.startedAfter = time;
+    return this;
+  }
+
+  public HistoryTaskQuery startedBefore(Date time) {
+    this.startedBefore = time;
+    return this;
+  }
+
+  public HistoryTaskQuery tookLessThen(long durationInMillis) {
+    this.tookLessThen = durationInMillis;
+    return this;
+  }
+
+  public HistoryTaskQuery tookLongerThen(long durationInMillis) {
+    this.tookLongerThen = durationInMillis;
+    return this;
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -27,7 +27,6 @@
 
 import javax.script.Bindings;
 
-import org.jbpm.pvm.internal.env.Context;
 import org.jbpm.pvm.internal.env.Environment;
 
 
@@ -36,52 +35,22 @@
  */
 public class EnvironmentBindings implements Bindings {
   
-  protected String[] readContextNames;
-  protected String writeContextName;
-  protected Map<String, WriteBinding> writeBindings;
   protected Environment environment;
 
   public EnvironmentBindings(String[] readContextNames, String writeContextName) {
-    this.readContextNames = readContextNames;
-    this.writeContextName = writeContextName;
-    
     environment = Environment.getCurrent();
   }
 
   public Object get(Object key) {
-    Context context = getReadContext(key);
-    if (context!=null) {
-      return context.get((String) key);
-    }
-    return null;
+    return environment.get((String)key);
   }
 
-  protected Context getReadContext(Object key) {
-    for (String readContextName: readContextNames) {
-      Context readContext = environment.getContext(readContextName);
-      if ( (readContext!=null)
-           && (readContext.has((String) key))
-         ) {
-        return readContext;
-      }
-    }
-    return null;
-  }
-
   public boolean containsKey(Object key) {
-    Context context = getReadContext(key);
-    return (context!=null);
+    return (get(key)!=null);
   }
 
   public Object put(String key, Object value) {
-    if (writeContextName==null) {
-      return null;
-    }
-    Context writeContext = environment.getContext(writeContextName);
-    if (writeContext==null) {
-      return null;
-    }
-    return writeContext.set(key, value);
+    return null;
   }
 
   public void putAll(Map< ? extends String, ? extends Object> toMerge) {

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -57,9 +57,7 @@
         .setString(
           "<objects>" +
           "  <script-manager default-expression-language='juel'" +
-          "                  default-script-language='beanshell' " +
-          "                  read-contexts='execution, environment, process-engine' " +
-          "                  write-context=''>" +
+          "                  default-script-language='beanshell'>" +
           "    <script-language name='juel' factory='org.jbpm.pvm.internal.script.JuelScriptEngineFactory' />" +
           "  </script-manager>" +
           "</objects>"

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -24,7 +24,7 @@
 import java.util.List;
 
 import org.jbpm.api.Execution;
-import org.jbpm.api.task.Task;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.pvm.internal.client.ClientExecution;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.job.JobImpl;
@@ -35,6 +35,7 @@
 import org.jbpm.pvm.internal.query.JobQueryImpl;
 import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
 import org.jbpm.pvm.internal.query.TaskQueryImpl;
+import org.jbpm.pvm.internal.task.TaskImpl;
 
 
 /**
@@ -43,6 +44,8 @@
 public interface DbSession {
 
   void save(Object entity);
+  void update(Object entity);
+  
   <T> T get(Class<T> entityClass, Object primaryKey);
   void delete(Object entity);
   void flush();
@@ -76,7 +79,9 @@
   
   /** create a history activity instance query */
   HistoryActivityInstanceQueryImpl createHistoryActivityInstanceQuery();
-  
+
+  List<HistoryComment> findCommentsByTaskId(String taskId);
+
   /** create a process instance query */
   JobQueryImpl createJobQuery();
   
@@ -90,12 +95,8 @@
   /** the process instance uniquely identified by the given executionKey. */ 
   ClientExecution findProcessInstanceById(String processInstanceId);
   
-  /* find ids for all process instances for a given process definition. */
   List<String> findProcessInstanceIds(String processDefinitionId);
-
-  /** delete the process instance including the history. */
-  void deleteProcessInstance(String processInstanceId);
-
+  
   /** deletes the history information for all process instances for 
    * the given process definition */
   void deleteProcessDefinitionHistory(String processDefinitionId);
@@ -109,12 +110,10 @@
   
   // task methods /////////////////////////////////////////////////////////////
   
-  Task createTask();
+  TaskImpl createTask();
 
-  void saveTask(Task task);
+  TaskImpl findTaskByExecution(Execution execution);
 
-  Task findTaskByExecution(Execution execution);
-
   // job methods //////////////////////////////////////////////////////////////
 
   /** the first job to finish among eligible and non-locked jobs or null if none */

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/TimerSession.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/TimerSession.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/TimerSession.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -36,9 +36,9 @@
    * @param timerImpl
    *          the timer to be executed.
    * @throws IllegalArgumentException
-   *           if the timer is null or if its activity is null or if its dueDate
-   *           is null or if its dueDate is negative or if its dueDate is past
-   *           or if its dueDate is equals to Long.MAX_VALUE
+   *           if the timer is null or if its activity is null or if its duedate
+   *           is null or if its duedate is negative or if its duedate is past
+   *           or if its duedate is equals to Long.MAX_VALUE
    */
   void schedule(Timer timer);
 

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -119,6 +119,10 @@
   public void deleteProcessInstance(String processInstanceId) {
     commandService.execute(new DeleteProcessInstance(processInstanceId));
   }
+  
+  public void deleteProcessInstanceCascade(String processInstanceId) {
+    commandService.execute(new DeleteProcessInstance(processInstanceId, true));
+  }
 
   public Object getVariable(String executionId, String variableName) {
     Set<String> variableNames = new HashSet<String>();

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/HistoryServiceImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/HistoryServiceImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/HistoryServiceImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,17 +21,23 @@
  */
 package org.jbpm.pvm.internal.svc;
 
+import java.util.List;
 import java.util.Map;
 
 import org.jbpm.api.HistoryService;
 import org.jbpm.api.history.HistoryActivityInstanceQuery;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.api.history.HistoryProcessInstanceQuery;
+import org.jbpm.api.history.HistoryTaskQuery;
 import org.jbpm.pvm.internal.cmd.CreateHistoryActivityInstanceQueryCmd;
 import org.jbpm.pvm.internal.cmd.CreateHistoryProcessInstanceQueryCmd;
+import org.jbpm.pvm.internal.cmd.CreateHistoryTaskQueryCmd;
+import org.jbpm.pvm.internal.cmd.GetTaskCommentsCmd;
 import org.jbpm.pvm.internal.query.AvgDurationPerActivityQueryCmd;
 import org.jbpm.pvm.internal.query.ChoiceDistributionQueryCmd;
 import org.jbpm.pvm.internal.query.HistoryActivityInstanceQueryImpl;
 import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
+import org.jbpm.pvm.internal.query.HistoryTaskQueryImpl;
 
 
 /**
@@ -58,4 +64,10 @@
     query.setCommandService(commandService);
     return query;
   }
+
+  public HistoryTaskQuery createHistoryTaskQuery() {
+    HistoryTaskQueryImpl query = commandService.execute(new CreateHistoryTaskQueryCmd());
+    query.setCommandService(commandService);
+    return query;
+  }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -28,7 +28,7 @@
 
 import org.jbpm.api.TaskQuery;
 import org.jbpm.api.TaskService;
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.api.task.Participation;
 import org.jbpm.api.task.Task;
 import org.jbpm.pvm.internal.cmd.AddParticipationCmd;
@@ -78,6 +78,10 @@
   public void deleteTask(String taskId, String reason) {
     commandService.execute(new DeleteTaskCmd(taskId, reason));
   }
+  
+  public void deleteTaskCascade(String taskId) {
+    commandService.execute(new DeleteTaskCmd(taskId, true));
+  }
 
   public void completeTask(String taskId) {
     completeTask(taskId, null);
@@ -136,11 +140,11 @@
     return commandService.execute(new NewTaskCmd(parentTaskId));
   }
 
-  public Comment addTaskComment(String taskId, String message) {
+  public HistoryComment addTaskComment(String taskId, String message) {
     return commandService.execute(new AddTaskCommentCmd(taskId, message));
   }
 
-  public List<Comment> getTaskComments(String taskId) {
+  public List<HistoryComment> getTaskComments(String taskId) {
     return commandService.execute(new GetTaskCommentsCmd(taskId));
   }
 
@@ -148,7 +152,7 @@
     commandService.execute(new DeleteCommentCmd(commentId));
   }
 
-  public Comment addReplyComment(String commentId, String message) {
+  public HistoryComment addReplyComment(String commentId, String message) {
     return commandService.execute(new AddReplyCommentCmd(commentId, message));
   }
 
@@ -176,12 +180,6 @@
     return commandService.execute(new GetTaskVariablesCmd(taskDbid, variableNames));
   }
 
-  public void setVariable(String taskDbid, String name, Object value) {
-    SetTaskVariablesCmd cmd = new SetTaskVariablesCmd(taskDbid);
-    cmd.addVariable(name, value);
-    commandService.execute(cmd);
-  }
-
   public void setVariables(String taskDbid, Map<String, Object> variables) {
     SetTaskVariablesCmd cmd = new SetTaskVariablesCmd(taskDbid);
     cmd.setVariables(variables);

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -39,7 +39,6 @@
   protected List<TaskDefinitionImpl> subTaskDefinitions = new ArrayList<TaskDefinitionImpl>();
   protected int priority = Priority.NORMAL;
   protected SwimlaneDefinitionImpl swimlaneDefinition;
-  protected TaskHandler taskHandler;
 
   public int getPriority() {
     return priority;
@@ -71,10 +70,4 @@
   public void setFormResourceName(String form) {
     this.formResourceName = form;
   }
-  public TaskHandler getTaskHandler() {
-    return taskHandler;
-  }
-  public void setTaskHandler(TaskHandler taskHandler) {
-    this.taskHandler = taskHandler;
-  }
 }

Deleted: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskHandler.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskHandler.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskHandler.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.task;
-
-import java.io.Serializable;
-
-import org.jbpm.pvm.internal.client.ClientExecution;
-
-/** for advanced task customization.
- * 
- * The default implementation can be found in {@link DefaultTaskHandler}.
- * 
- * @author Tom Baeyens
- */
-public class TaskHandler implements Serializable {
-
-  private static final long serialVersionUID = 1L;
-
-  /** called after the task is created according 
-   * to the task definition.  This method allows to 
-   * create subtasks.
-   * @return indicates if the process execution should wait. */
-  public boolean executionCreateTask(TaskImpl task) {
-    task.historyTaskStart();
-    return true;
-  }
-  
-  /** called when the related execution gets a 
-   * signal.  this method must either 
-   * {@link OpenTask#setSignalling(boolean) remove signalling} from this task
-   * or {@link OpenTask#delete(String) cancel} it. */
-  public void executionSignal(TaskImpl task) {
-    task.setSignalling(false);
-  }
-  
-  /** called when the given task is assigned to an actor. */
-  public void taskAssign(TaskImpl task, String userId) {
-    task.historyTaskAssign(userId);
-  }
-
-  /** called when the given task is cancelled. */ 
-  public void taskDelete(TaskImpl task, String reason) {
-    task.historyTaskDelete(reason);
-//    TODO if task is deleted, the related execution should be 
-//         suspended.  But in the API and console, there is no
-//         way yet to resume individual instances.
-//    if (task.getExecution()!=null) {
-//      task.getExecution().suspend();
-//    }
-  }
-  
-  /** called when the given task completes.  The default behaviour 
-   * will send a signal to the execution if this task is still signalling. */
-  public void taskComplete(TaskImpl task, String outcome) {
-    task.historyTaskComplete(outcome);
-    
-    if (task.isSignalling()) {
-      ClientExecution execution = (ClientExecution) task.getExecution();
-      execution.signal(outcome);
-    }
-  }
-
-  /** is called when a subtask completes.  this can be used to 
-   * prematurely signal the execution. e.g. for "5 out of 7" scenarios.*/
-  public void taskSubTaskComplete(TaskImpl task, OpenTask subTask, String outcome) {
-  }
-  
-  /** is called when a variable is updated.  This can be used to 
-   * propagate the execution based on availability of variables. */
-  public void taskVariableUpdate(TaskImpl task, String key, Object value) {
-  }
-}

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -22,27 +22,23 @@
 package org.jbpm.pvm.internal.task;
 
 import java.io.Serializable;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import org.jbpm.api.Execution;
 import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.Comment;
 import org.jbpm.api.model.Event;
 import org.jbpm.api.task.Assignable;
 import org.jbpm.api.task.Participation;
 import org.jbpm.api.task.Swimlane;
 import org.jbpm.api.task.Task;
+import org.jbpm.pvm.internal.client.ClientExecution;
 import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.history.events.TaskAssign;
-import org.jbpm.pvm.internal.history.events.TaskDelete;
+import org.jbpm.pvm.internal.history.HistoryEvent;
 import org.jbpm.pvm.internal.history.events.TaskComplete;
-import org.jbpm.pvm.internal.history.events.TaskStart;
-import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.history.events.TaskDelete;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
@@ -60,8 +56,7 @@
 
   // private static Log log = Log.getLog(TaskImpl.class.getName());
 
-  private static final TaskHandler DEFAULT_TASK_HANDLER = new TaskHandler();
-
+  protected boolean isNew;
   protected String name;
   protected String description;
 
@@ -69,14 +64,11 @@
   protected Set<ParticipationImpl> participations = new HashSet<ParticipationImpl>();
 
   protected String formResourceName;
-  protected Date create;
-  protected Date dueDate;
+  protected Date createTime;
+  protected Date duedate;
   protected Integer progress;
   protected boolean isSignalling;
 
-  // protected VariableMap variableMap;
-  protected List<CommentImpl> comments = new ArrayList<CommentImpl>();
-
   protected int priority = Priority.NORMAL;
 
   protected String state = Task.STATE_OPEN;
@@ -109,6 +101,10 @@
   public ScopeInstanceImpl getParentVariableScope() {
     return execution;
   }
+  
+  public TaskImpl getTask() {
+    return this;
+  }
 
   // assignment ///////////////////////////////////////////////////////////////
 
@@ -123,8 +119,8 @@
     setAssignee(userId, false);
   }
 
-  public void setAssignee(String userId, boolean propagateToSwimlane) {
-    this.assignee = userId;
+  public void setAssignee(String assignee, boolean propagateToSwimlane) {
+    this.assignee = assignee;
     if (propagateToSwimlane) {
       propagateAssigneeToSwimlane();
     }
@@ -191,18 +187,23 @@
   }
 
   public void complete(String outcome) {
-    getTaskHandler().taskComplete(this, outcome);
+    historyTaskComplete(outcome);
+    
+    if (isSignalling()) {
+      ClientExecution execution = (ClientExecution) getExecution();
+      execution.signal(outcome);
+    }
+    
     if (superTask != null) {
       superTask.subTaskComplete(this, outcome);
     }
   }
 
   protected void subTaskComplete(TaskImpl subTask, String outcome) {
-    getTaskHandler().taskSubTaskComplete(this, subTask, outcome);
   }
 
   public void delete(String reason) {
-    getTaskHandler().taskDelete(this, reason);
+    historyTaskDelete(reason);
   }
 
   // state ////////////////////////////////////////////////////////////////////
@@ -217,34 +218,6 @@
     return true;
   }
 
-  // variables ////////////////////////////////////////////////////////////////
-
-  public void setVariable(String key, Object value) {
-    super.setVariable(key, value);
-    getTaskHandler().taskVariableUpdate(this, key, value);
-  }
-
-  // comments /////////////////////////////////////////////////////////////////
-
-  public List<Comment> getComments() {
-    return (List) comments;
-  }
-
-  public Comment createComment(String commentText) {
-    CommentImpl comment = new CommentImpl(commentText);
-    comments.add(comment);
-    return comment;
-  }
-
-  public void removeComment(Comment comment) {
-    if (comment == null) {
-      throw new JbpmException("comment is null");
-    }
-    if (comments.contains(comment)) {
-      comments.remove(comment);
-    }
-  }
-
   // subtasks /////////////////////////////////////////////////////////////////
 
   public Set<Task> getSubTasks() {
@@ -321,27 +294,15 @@
     }
   }
 
-  public void historyTaskStart() {
-    if (execution != null) {
-      execution.fireHistoryEvent(new TaskStart(this));
-    }
-  }
-
-  public void historyTaskAssign(String userId) {
-    if (execution != null) {
-      execution.fireHistoryEvent(new TaskAssign(userId));
-    }
-  }
-
   public void historyTaskDelete(String reason) {
     if (execution != null) {
-      execution.fireHistoryEvent(new TaskDelete(reason));
+      HistoryEvent.fire(new TaskDelete(this, reason), execution);
     }
   }
 
   public void historyTaskComplete(String outcome) {
     if (execution != null) {
-      execution.fireHistoryEvent(new TaskComplete(outcome));
+      HistoryEvent.fire(new TaskComplete(outcome), execution);
     }
   }
 
@@ -351,15 +312,6 @@
     }
   }
 
-  public TaskHandler getTaskHandler() {
-    if ((getTaskDefinition() == null) || (taskDefinition.getTaskHandler() == null)) {
-      return DEFAULT_TASK_HANDLER;
-    }
-
-    TaskHandler taskHandler = taskDefinition.getTaskHandler();
-    return taskHandler;
-  }
-
   // special getters and setters //////////////////////////////////////////////
 
   public TaskDefinitionImpl getTaskDefinition() {
@@ -414,26 +366,22 @@
     this.priority = priority;
   }
 
-  public void setComments(List<CommentImpl> comments) {
-    this.comments = comments;
+  public Date getCreateTime() {
+    return createTime;
   }
 
-  public Date getCreate() {
-    return create;
+  public void setCreateTime(Date create) {
+    this.createTime = create;
   }
 
-  public void setCreate(Date create) {
-    this.create = create;
+  public Date getDuedate() {
+    return duedate;
   }
 
-  public Date getDueDate() {
-    return dueDate;
+  public void setDuedate(Date duedate) {
+    this.duedate = duedate;
   }
 
-  public void setDueDate(Date dueDate) {
-    this.dueDate = dueDate;
-  }
-
   public ExecutionImpl getExecution() {
     return execution;
   }
@@ -533,6 +481,10 @@
   public void setFormResourceName(String form) {
     this.formResourceName = form;
   }
-
-  
+  public boolean isNew() {
+    return isNew;
+  }
+  public void setNew(boolean isNew) {
+    this.isNew = isNew;
+  }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -35,7 +35,7 @@
 
 /** helper class for testing that executes messages and timers
  * in the test runner thread.  This way, the test can simulate 
- * timers and messages being executed.  The dueDate is ignored.
+ * timers and messages being executed.  The duedate is ignored.
  * 
  * @author Tom Baeyens
  */

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -24,7 +24,12 @@
 import java.io.Serializable;
 
 import org.jbpm.api.JbpmException;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.HistorySession;
+import org.jbpm.pvm.internal.history.events.VariableUpdate;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.task.TaskImpl;
 
 /**
  * is a jbpm-internal class that serves as a base class for classes 
@@ -39,9 +44,12 @@
   
   protected String key = null;
   protected Converter converter = null;
-  protected String queryText = null;
-  protected ExecutionImpl processInstance;
+  protected String textValue = null;
+  protected boolean isHistoryEnabled = false;
   
+  protected ExecutionImpl execution;
+  protected TaskImpl task;
+  
   // constructors /////////////////////////////////////////////////////////////
   
   // abstract methods /////////////////////////////////////////////////////////
@@ -80,6 +88,13 @@
       throw new JbpmException("variable instance '"+this.getClass().getName()+"' does not support values of type '"+value.getClass().getName()+"'.  to change the type of a variable, you have to delete it first");
     }
     setObject(value);
+    
+    HistorySession historySession = Environment.getFromCurrent(HistorySession.class, false);
+    if ( isHistoryEnabled 
+         && (historySession!=null)
+       ) {
+      HistoryEvent.fire(new VariableUpdate(this));
+    }
   }
 
   public Object getValue() {
@@ -96,7 +111,7 @@
   public String toString() {
     return "${"+key+"}";
   }
-  
+
   public Type getType() {
     Type type = new Type();
     type.setConverter(converter);
@@ -104,11 +119,18 @@
     return type;
   }
   
+  public ExecutionImpl getProcessInstance() {
+    return (execution!=null ? execution.getProcessInstance() : null);
+  }
+
   // getters and setters //////////////////////////////////////////////////////
 
   public String getKey() {
     return key;
   }
+  public long getDbid() {
+    return dbid;
+  }
   public Converter getConverter() {
     return converter;
   }
@@ -118,10 +140,25 @@
   public void setKey(String key) {
     this.key = key;
   }
-  public ExecutionImpl getProcessInstance() {
-    return processInstance;
+  public String getTextValue() {
+    return textValue;
   }
-  public void setProcessInstance(ExecutionImpl processInstance) {
-    this.processInstance = processInstance;
+  public ExecutionImpl getExecution() {
+    return execution;
   }
+  public void setExecution(ExecutionImpl execution) {
+    this.execution = execution;
+  }
+  public TaskImpl getTask() {
+    return task;
+  }
+  public void setTask(TaskImpl task) {
+    this.task = task;
+  }
+  public boolean isHistoryEnabled() {
+    return isHistoryEnabled;
+  }
+  public void setHistoryEnabled(boolean isHistoryEnabled) {
+    this.isHistoryEnabled = isHistoryEnabled;
+  }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/DateVariable.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/DateVariable.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/DateVariable.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -47,9 +47,9 @@
   public void setObject(Object value) {
     this.date = (Date) value;
     if (value!=null) {
-      this.queryText = new SimpleDateFormat(dateFormat).format(value);
+      this.textValue = new SimpleDateFormat(dateFormat).format(value);
     } else {
-      this.queryText = null;
+      this.textValue = null;
     }
   }
 

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/DoubleVariable.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/DoubleVariable.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/DoubleVariable.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -42,9 +42,9 @@
   public void setObject(Object value) {
     this.d = (Double) value;
     if (value!=null) {
-      this.queryText = value.toString();
+      this.textValue = value.toString();
     } else {
-      this.queryText = null;
+      this.textValue = null;
     }
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/LongVariable.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/LongVariable.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/LongVariable.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -42,9 +42,9 @@
   public void setObject(Object value) {
     this.l = (Long) value;
     if (value!=null) {
-      this.queryText = value.toString();
+      this.textValue = value.toString();
     } else {
-      this.queryText = null;
+      this.textValue = null;
     }
   }
 

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/StringVariable.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/StringVariable.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/StringVariable.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -42,9 +42,9 @@
   public void setObject(Object value) {
     this.string = (String) value;
     if (value!=null) {
-      this.queryText = string;
+      this.textValue = string;
     } else {
-      this.queryText = null;
+      this.textValue = null;
     }
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -239,9 +239,9 @@
 
   /**
    * allows for postponing the creation of this wire context.
-   * @param delayCreate specifies if creation should be postponed till {@link #create()} is called explicitly.
+   * @param delayCreate specifies if creation should be postponed till {@link #createTime()} is called explicitly.
    *   If delayCreate is set to false, creation is done as part of the constructor.  If delayCreate is
-   *   set to true, the {@link #create()} method needs to be called explicitly by the client after
+   *   set to true, the {@link #createTime()} method needs to be called explicitly by the client after
    *   construction is complete.  The use case is creation of environment where the transactionName needs to be
    *   set and the scope needs to be added to the environment before the creation of this wire scope is done.
    * @see JbpmConfiguration#openEnvironment()

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/BusinessCalendarBinding.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/BusinessCalendarBinding.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/BusinessCalendarBinding.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -31,7 +31,7 @@
 import java.util.StringTokenizer;
 import java.util.TimeZone;
 
-import org.jbpm.pvm.internal.cal.BusinessCalendar;
+import org.jbpm.pvm.internal.cal.BusinessCalendarImpl;
 import org.jbpm.pvm.internal.cal.Day;
 import org.jbpm.pvm.internal.cal.DayPart;
 import org.jbpm.pvm.internal.cal.Holiday;
@@ -53,7 +53,7 @@
   }
 
   public Object parse(Element element, Parse parse, Parser parser) {
-    BusinessCalendar businessCalendar = new BusinessCalendar();
+    BusinessCalendarImpl businessCalendarImpl = new BusinessCalendarImpl();
     
     TimeZone timeZone = null;
     if (element.hasAttribute("timezone")) {
@@ -61,7 +61,7 @@
     } else {
       timeZone = TimeZone.getDefault();
     }
-    businessCalendar.setTimeZone(timeZone);
+    businessCalendarImpl.setTimeZone(timeZone);
     
     String hourFormatText = "HH:mm";
     if (element.hasAttribute("hour-format")) {
@@ -70,14 +70,14 @@
     DateFormat hourFormat = new SimpleDateFormat(hourFormatText);
 
     Day[] days = new Day[8];
-    days[Calendar.SUNDAY] = parseDay(element, "sunday", hourFormat, businessCalendar, parse);
-    days[Calendar.MONDAY] = parseDay(element, "monday", hourFormat, businessCalendar, parse);
-    days[Calendar.TUESDAY] = parseDay(element, "tuesday", hourFormat, businessCalendar, parse);
-    days[Calendar.WEDNESDAY] = parseDay(element, "wednesday", hourFormat, businessCalendar, parse);
-    days[Calendar.THURSDAY] = parseDay(element, "thursday", hourFormat, businessCalendar, parse);
-    days[Calendar.FRIDAY] = parseDay(element, "friday", hourFormat, businessCalendar, parse);
-    days[Calendar.SATURDAY] = parseDay(element, "saturday", hourFormat, businessCalendar, parse);
-    businessCalendar.setDays(days);
+    days[Calendar.SUNDAY] = parseDay(element, "sunday", hourFormat, businessCalendarImpl, parse);
+    days[Calendar.MONDAY] = parseDay(element, "monday", hourFormat, businessCalendarImpl, parse);
+    days[Calendar.TUESDAY] = parseDay(element, "tuesday", hourFormat, businessCalendarImpl, parse);
+    days[Calendar.WEDNESDAY] = parseDay(element, "wednesday", hourFormat, businessCalendarImpl, parse);
+    days[Calendar.THURSDAY] = parseDay(element, "thursday", hourFormat, businessCalendarImpl, parse);
+    days[Calendar.FRIDAY] = parseDay(element, "friday", hourFormat, businessCalendarImpl, parse);
+    days[Calendar.SATURDAY] = parseDay(element, "saturday", hourFormat, businessCalendarImpl, parse);
+    businessCalendarImpl.setDays(days);
 
     String dayFormatText = "dd/MM/yyyy";
     if (element.hasAttribute("day-format")) {
@@ -90,18 +90,18 @@
     if (!holidayElements.isEmpty()) {
       holidays = new Holiday[holidayElements.size()];
       for (int i=0; i<holidayElements.size(); i++) {
-        holidays[i] = parseHoliday(holidayElements.get(i), dayFormat, businessCalendar, parse);
+        holidays[i] = parseHoliday(holidayElements.get(i), dayFormat, businessCalendarImpl, parse);
       }
     }
-    businessCalendar.setHolidays(holidays);
+    businessCalendarImpl.setHolidays(holidays);
     
-    ProvidedObjectDescriptor descriptor = new ProvidedObjectDescriptor(businessCalendar, true);
+    ProvidedObjectDescriptor descriptor = new ProvidedObjectDescriptor(businessCalendarImpl, true);
     return descriptor;
   }
 
-  private Day parseDay(Element daysElement, String dayText, DateFormat hourFormat, BusinessCalendar businessCalendar, Parse parse) {
+  private Day parseDay(Element daysElement, String dayText, DateFormat hourFormat, BusinessCalendarImpl businessCalendarImpl, Parse parse) {
     Day day = new Day();
-    day.setBusinessCalendar(businessCalendar);
+    day.setBusinessCalendar(businessCalendarImpl);
 
     Element dayElement = XmlUtil.element(daysElement, dayText);
     if (dayElement!=null) {
@@ -159,7 +159,7 @@
     return day;
   }
   
-  private Holiday parseHoliday(Element holidayElement, DateFormat dayFormat, BusinessCalendar businessCalendar, Parse parse) {
+  private Holiday parseHoliday(Element holidayElement, DateFormat dayFormat, BusinessCalendarImpl businessCalendarImpl, Parse parse) {
     Holiday holiday = new Holiday();
     try {
       if (holidayElement.hasAttribute("period")) {
@@ -191,7 +191,7 @@
 
       // now we are going to set the toDay to the end of the day, rather then the beginning.
       // we take the start of the next day as the end of the toDay.
-      Calendar calendar = businessCalendar.createCalendar();
+      Calendar calendar = businessCalendarImpl.createCalendar();
       calendar.setTime(holiday.getToDay());
       calendar.add(Calendar.DATE, 1);
       Date toDay = calendar.getTime();

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ScriptManagerBinding.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ScriptManagerBinding.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ScriptManagerBinding.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -59,24 +59,6 @@
       descriptor.addInjection("defaultScriptLanguage", new StringDescriptor(defaultLanguage));
     }
 
-    if (element.hasAttribute("read-contexts")) {
-      String readContextsText = element.getAttribute("read-contexts");
-      List<String> readContextList = XmlUtil.parseCommaSeparatedList(readContextsText);
-      String[] readContextNames = readContextList.toArray(new String[readContextList.size()]);
-      descriptor.addInjection("readContextNames", new ProvidedObjectDescriptor(readContextNames));
-      
-    } else {
-      parse.addProblem("'read-contexts' is a required attribute in element <script-manager />", element);
-    }
-
-    if (element.hasAttribute("write-context")) {
-      String writeContextName = element.getAttribute("write-context");
-      descriptor.addInjection("writeContextName", new StringDescriptor(writeContextName));
-      
-    } else {
-      parse.addProblem("'write-context' is a required attribute in element <script-manager />", element);
-    }
-    
     ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
     List<Element> scriptElements = XmlUtil.elements(element, "script-language");
     for (Element scriptElement : scriptElements) {

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/BusinessCalendarDescriptor.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/BusinessCalendarDescriptor.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/BusinessCalendarDescriptor.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,7 +21,7 @@
  */
 package org.jbpm.pvm.internal.wire.descriptor;
 
-import org.jbpm.pvm.internal.cal.BusinessCalendar;
+import org.jbpm.pvm.internal.cal.BusinessCalendarImpl;
 import org.jbpm.pvm.internal.wire.WireContext;
 import org.jbpm.pvm.internal.wire.WireDefinition;
 
@@ -29,20 +29,20 @@
 
   private static final long serialVersionUID = 1L;
 
-  BusinessCalendar businessCalendar;
+  BusinessCalendarImpl businessCalendarImpl;
   
   public BusinessCalendarDescriptor() {
   }
 
-  public BusinessCalendarDescriptor(BusinessCalendar businessCalendar) {
-    this.businessCalendar = businessCalendar;
+  public BusinessCalendarDescriptor(BusinessCalendarImpl businessCalendarImpl) {
+    this.businessCalendarImpl = businessCalendarImpl;
   }
 
   public Object construct(WireContext wireContext) {
-    return businessCalendar;
+    return businessCalendarImpl;
   }
 
   public Class<?> getType(WireDefinition wireDefinition) {
-    return BusinessCalendar.class;
+    return BusinessCalendarImpl.class;
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -26,7 +26,7 @@
  * <p>This {@link Descriptor} creates and initializes an object.
  * Objects can be instantiated from a constructor or from a method invocation.</p>
  *
- * <p>The way to create an object is specified one of these methods (see <a href='#create'>creating objects</a>):
+ * <p>The way to create an object is specified one of these methods (see <a href='#createTime'>creating objects</a>):
  * <ul>
  * <li>className ({@link #setClassName(String)})</li>
  * <li>factoryObjectName ({@link #setFactoryObjectName(String)})</li>
@@ -35,7 +35,7 @@
  * Only one of these methods can be used.
  * </p>
  *
- * <h3 id='create'>Creating objects</h3>
+ * <h3 id='createTime'>Creating objects</h3>
  * <h4>Creating object from a constructor</h4>
  *
  * <p>This method is used when <code>{@link #getClassName()}!=null && {@link #getMethodName()}==null</code>.</p>

Copied: jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.businesscalendar.cfg.xml (from rev 5295, jbpm4/trunk/modules/pvm/src/main/resources/jbpm.businesscalendar.cfg.xml)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.businesscalendar.cfg.xml	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.businesscalendar.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+  <process-engine-context>
+  
+    <business-calendar>
+      <monday    hours="9:00-12:00 and 12:30-17:00"/>
+      <tuesday   hours="9:00-12:00 and 12:30-17:00"/>
+      <wednesday hours="9:00-12:00 and 12:30-17:00"/>
+      <thursday  hours="9:00-12:00 and 12:30-17:00"/>
+      <friday    hours="9:00-12:00 and 12:30-17:00"/>
+      <holiday period="01/07/2008 - 31/08/2008"/>
+    </business-calendar>
+
+  </process-engine-context>
+    
+</jbpm-configuration>

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -19,9 +19,7 @@
     <hibernate-session-factory />
 
     <script-manager default-expression-language="juel"
-                    default-script-language="juel"
-                    read-contexts="execution, environment, process-engine"
-                    write-context="">
+                    default-script-language="juel">
       <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
     </script-manager>
     
@@ -32,15 +30,6 @@
 
     <address-resolver />
 
-    <business-calendar>
-      <monday    hours="9:00-12:00 and 12:30-17:00"/>
-      <tuesday   hours="9:00-12:00 and 12:30-17:00"/>
-      <wednesday hours="9:00-12:00 and 12:30-17:00"/>
-      <thursday  hours="9:00-12:00 and 12:30-17:00"/>
-      <friday    hours="9:00-12:00 and 12:30-17:00"/>
-      <holiday period="01/07/2008 - 31/08/2008"/>
-    </business-calendar>
-    
     <mail-template name='task-notification'>
       <to users="${task.assignee}"/>
       <subject>${task.name}</subject>

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -103,27 +103,6 @@
                  
   </class>
 
-  <!-- ### COMMENTS ####################################################### -->
-  <class name="CommentImpl" table="JBPM4_COMMENT">
-    <id name="dbid" column="DBID_">
-      <generator class="native" />
-    </id>
-    <discriminator column="CLASS_" />
-    <version name="dbversion" column="DBVERSION_" />
-
-    <property name="userId" column="USERID_" />
-    <property name="time" column="TIME_" />
-    <property name="message" column="MESSAGE_" type="text" />
-
-    <list name="comments" 
-          cascade="all-delete-orphan"
-          inverse="false">
-      <key column="PARENT_" foreign-key="none" />
-      <list-index column="PARENT_IDX_" />
-      <one-to-many class="CommentImpl" />
-    </list>
-  </class>
-  
   <!-- ### VARIABLE ####################################################### -->
   <class name="org.jbpm.pvm.internal.type.Variable" abstract="true" discriminator-value=" " table="JBPM4_VARIABLE">
     <!-- discriminator values:
@@ -145,13 +124,17 @@
     <version name="dbversion" column="DBVERSION_" />
     
     <property name="key" column="KEY_"/>
-    <property name="queryText" column="QUERYTEXT_" />
     <property name="converter" type="converter" column="CONVERTER_" />
-    <many-to-one name="processInstance"
-                 column="PROCINST_" 
+    <property name="isHistoryEnabled" column="HIST_" />
+    
+    <many-to-one name="execution"
+                 column="EXECUTION_" 
                  class="org.jbpm.pvm.internal.model.ExecutionImpl"
-                 foreign-key="FK_VAR_PROCINST"
-                 index="IDX_VAR_PROCINST"/>
+                 foreign-key="none"/>
+    <many-to-one name="task"
+                 column="TASK_" 
+                 class="org.jbpm.pvm.internal.task.TaskImpl"
+                 foreign-key="none"/>
   </class>
 
   <subclass name="org.jbpm.pvm.internal.type.variable.DateVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="date">

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.history.hbm.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.history.hbm.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -5,11 +5,12 @@
 
   <!-- ### HISTORY PROCESS INSTANCE ####################################### -->
   <class name="HistoryProcessInstanceImpl" table="JBPM4_HIST_PROCINST">
-    <id name="processInstanceId" column="ID_">
+    <id name="dbid" column="DBID_">
       <generator class="assigned" />
     </id>
     <version name="dbversion" column="DBVERSION_" />
 
+    <property name="processInstanceId" column="ID_" />
     <property name="processDefinitionId" column="PROCDEFID_" />
     <property name="key" column="KEY_" />
     <property name="startTime" column="START_" type="timestamp" />
@@ -18,42 +19,48 @@
     <property name="state" column="STATE_" />
     <property name="endActivityName" column="ENDACTIVITY_" />
 
-    <!-- many-to-one name="processDefinition" 
-                 class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl" 
-                 column="PROCDEF_"
-                 foreign-key="FK_HISTPI_PROCDEF"
-                 index="IDX_HISTPI_PROCDEF" / -->
-                 
+    <property name="nextDetailIndex" column="NEXTIDX_" />
+
     <set name="historyActivityInstances"
          cascade="all">
-      <key>
-         <column name="HPI_" />
+      <key foreign-key="FK_HACTI_HPROCI">
+         <column name="HPROCI_" index="IDX_HACTI_HPROCI" />
       </key>
-      <one-to-many class="HistoryActivityInstanceImpl" />
+      <one-to-many class="HistoryActivityInstanceImpl"  />
     </set>
                  
+    <set name="historyVariables"
+         cascade="all">
+      <key foreign-key="FK_HVAR_HPROCI">
+         <column name="HPROCI_" index="IDX_HVAR_HPROCI" />
+      </key>
+      <one-to-many class="HistoryVariableImpl"  />
+    </set>
+                 
+    <set name="details"
+         cascade="all">
+      <key foreign-key="FK_HDETAIL_HPROCI">
+         <column name="HPROCI_" index="IDX_HDETAIL_HPROCI" />
+      </key>
+      <one-to-many class="HistoryDetailImpl"  />
+    </set>
+                 
   </class>
 
-  <!-- ### HISTORY PROCESS INSTANCE ####################################### -->
-  <class name="HistoryActivityInstanceImpl" table="JBPM4_HIST_ACTINST" discriminator-value="ACT">
+  <!-- ### HISTORY ACTIVITY INSTANCE ####################################### -->
+  <class name="HistoryActivityInstanceImpl" table="JBPM4_HIST_ACTINST" discriminator-value="act">
     <id name="dbid" column="DBID_">
       <generator class="native" />
     </id>
     <discriminator column="CLASS_" />
     <version name="dbversion" column="DBVERSION_" />
 
+    <!-- the foreign-key is set on the other side of the relation: see historyActivityInstances above -->
     <many-to-one name="historyProcessInstance" 
                  class="HistoryProcessInstanceImpl" 
-                 column="HPI_"
-                 foreign-key="FK_HAI_HPI"
-                 index="IDX_HAI_HPI" />
+                 column="HPROCI_"
+                 foreign-key="none" />
 
-    <!-- many-to-one name="activity" 
-                 class="org.jbpm.pvm.internal.model.ActivityImpl" 
-                 column="ACTIVITY_"
-                 foreign-key="FK_HISTAI_ACT"
-                 index="IDX_HISTAI_ACT" / -->
-
     <property name="type" column="TYPE_" />
     <property name="executionId" column="EXECUTION_" />
     <property name="activityName" column="ACTIVITY_NAME_" />
@@ -61,15 +68,174 @@
     <property name="endTime" column="END_" type="timestamp" />
     <property name="duration" column="DURATION_" />
     <property name="transitionName" column="TRANSITION_" />
+    <property name="nextDetailIndex" column="NEXTIDX_" />
 
-    <subclass name="HistoryAutomaticInstanceImpl" discriminator-value="AUT">
-      <subclass name="HistoryDecisionInstanceImpl" discriminator-value="EXCL" />
+    <set name="details"
+         cascade="all">
+      <key foreign-key="FK_HDETAIL_HACTI">
+         <column name="HACTI_" index="IDX_HDETAIL_HACTI" />
+      </key>
+      <one-to-many class="HistoryDetailImpl"  />
+    </set>
+
+    <subclass name="HistoryAutomaticInstanceImpl" discriminator-value="aut">
+      <subclass name="HistoryDecisionInstanceImpl" discriminator-value="excl" />
     </subclass>
     
-    <subclass name="HistoryTaskInstanceImpl" discriminator-value="TASK">
-      <property name="assignee" column="ASSIGNEE_" />
-      <property name="state" column="STATE_" />
+    <subclass name="HistoryTaskInstanceImpl" discriminator-value="task">
+	    <many-to-one name="historyTask" 
+	                 class="HistoryTaskImpl" 
+	                 column="HTASK_"
+	                 cascade="all"
+	                 foreign-key="FK_HTI_HTASK"
+	                 index="IDX_HTI_HTASK" />
     </subclass>
   </class>
+  
+  <!-- ### HISTORY TASK ################################################# -->
+  <class name="HistoryTaskImpl" table="JBPM4_HIST_TASK">
+    <id name="dbid" column="DBID_">
+      <generator class="assigned" />
+    </id>
+    <version name="dbversion" column="DBVERSION_" />
 
+    <property name="executionId" column="EXECUTION_" />
+    <property name="outcome" column="OUTCOME_" />
+    <property name="assignee" column="ASSIGNEE_" />
+    <property name="priority" column="PRIORITY_" />
+    <property name="state" column="STATE_" />
+    <property name="createTime" column="CREATE_" type="timestamp" />
+    <property name="endTime" column="END_" type="timestamp" />
+    <property name="duration" column="DURATION_" />
+    <property name="nextDetailIndex" column="NEXTIDX_" />
+    
+    <set name="details"
+         cascade="all">
+      <key foreign-key="FK_HDETAIL_HTASK">
+         <column name="HTASK_" index="IDX_HDETAIL_HTASK" />
+      </key>
+      <one-to-many class="HistoryDetailImpl"  />
+    </set>
+
+    <set name="historyVariables"
+         cascade="all">
+      <key foreign-key="FK_HVAR_HTASK">
+         <column name="HTASK_" index="IDX_HVAR_HTASK" />
+      </key>
+      <one-to-many class="HistoryVariableImpl"  />
+    </set>
+                 
+    <set name="subTasks" cascade="all-delete-orphan">
+      <key column="SUPERTASK_" foreign-key="FK_HSUPERT_SUB" />
+      <one-to-many class="HistoryTaskImpl"  />
+    </set>
+    
+  </class>
+  
+  <!-- ### HISTORY VARIABLE ################################################# -->
+  <class name="HistoryVariableImpl" table="JBPM4_HIST_VAR">
+    <id name="dbid" column="DBID_">
+      <generator class="assigned" />
+    </id>
+    <version name="dbversion" column="DBVERSION_" />
+
+    <property name="processInstanceId" column="PROCINSTID_" />
+    <property name="executionId" column="EXECUTIONID_" />
+    <property name="variableName" column="VARNAME_" />
+    <property name="value" column="VALUE_" />
+
+    <!-- the foreign-key is set on the other side of the relation: see historyVariables above in HistoryProcessInstanceImpl -->
+    <many-to-one name="historyProcessInstance" 
+                 class="HistoryProcessInstanceImpl" 
+                 column="HPROCI_"
+                 foreign-key="none" />
+
+    <!-- the foreign-key is set on the other side of the relation: see historyVariables above in HistoryTaskImpl -->
+    <many-to-one name="historyTask" 
+                 class="HistoryTaskImpl" 
+                 column="HTASK_"
+                 foreign-key="none" />
+
+    <set name="details"
+         cascade="all">
+      <key foreign-key="FK_HDETAIL_HVAR">
+         <column name="HVAR_" index="IDX_HDETAIL_HVAR" />
+      </key>
+      <one-to-many class="HistoryDetailImpl"  />
+    </set>
+
+  </class>
+  
+  <!-- ### HISTORY COMMENTS ################################################# -->
+  <class name="HistoryDetailImpl" table="JBPM4_HIST_DETAIL">
+    <id name="dbid" column="DBID_">
+      <generator class="native" />
+    </id>
+    <discriminator column="CLASS_" />
+    <version name="dbversion" column="DBVERSION_" />
+
+    <property name="userId" column="USERID_" />
+    <property name="time" column="TIME_" />
+    
+    <many-to-one name="historyProcessInstance"
+                 class="HistoryProcessInstanceImpl"
+                 column="HPROCI_"
+                 foreign-key="FK_HDET_HPROCI"
+                 index="IDX_HDET_HPROCI" />
+    <property name="historyProcessInstanceIndex" column="HPROCIIDX_" />
+
+    <many-to-one name="historyActivityInstance"
+                 class="HistoryActivityInstanceImpl"
+                 column="HACTI_"
+                 foreign-key="FK_HDET_HACTI"
+                 index="IDX_HDET_HACTI" />
+    <property name="historyActivityInstanceIndex" column="HACTIIDX_" />
+
+    <many-to-one name="historyTask"
+                 class="HistoryTaskImpl"
+                 column="HTASK_"
+                 foreign-key="FK_HDET_HTASK"
+                 index="IDX_HDET_HTASK" />
+    <property name="historyTaskIndex" column="HTASKIDX_" />
+
+    <many-to-one name="historyVariable"
+                 class="HistoryVariableImpl"
+                 column="HVAR_"
+                 foreign-key="FK_HDET_HVAR"
+                 index="IDX_HDET_HVAR" />
+    <property name="historyVariableIndex" column="HVARIDX_" />
+    
+    <subclass name="HistoryCommentImpl" discriminator-value="comment">
+	    <property name="message" column="MESSAGE_" type="text" />
+	    <list name="replies" 
+	          cascade="all-delete-orphan"
+	          inverse="false">
+	      <key column="PARENT_" foreign-key="none" />
+	      <list-index column="PARENT_IDX_" />
+	      <one-to-many class="HistoryCommentImpl" />
+	    </list>
+    </subclass>
+
+    <subclass name="HistoryPriorityUpdateImpl" discriminator-value="priority-update">
+      <property name="oldPriority" column="OLD_INT_" />
+      <property name="newPriority" column="NEW_INT_" />
+    </subclass>
+    
+    <subclass name="HistoryTaskAssignmentImpl" discriminator-value="assignment">
+      <property name="oldAssignee" column="OLD_STR_" />
+      <property name="newAssignee" column="NEW_STR_" />
+    </subclass>
+    
+    <subclass name="HistoryTaskDuedateUpdateImpl" discriminator-value="duedate-update">
+      <property name="oldDuedate" column="OLD_TIME_" type="timestamp" />
+      <property name="newDuedate" column="NEW_TIME_" type="timestamp" />
+    </subclass>
+    
+    <subclass name="HistoryVariableUpdateImpl" discriminator-value="variable-update">
+      <property name="oldValue" column="OLD_STR_" />
+      <property name="newValue" column="NEW_STR_" />
+    </subclass>
+    
+  </class>
+  
 </hibernate-mapping>
\ No newline at end of file

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -27,8 +27,8 @@
     </set>
     
     <property name="priority" column="PRIORITY_"/>
-    <property name="create" column="CREATE_"/>
-    <property name="dueDate" column="DUEDATE_"/>
+    <property name="createTime" column="CREATE_"/>
+    <property name="duedate" column="DUEDATE_"/>
     <property name="progress" column="PROGRESS_"/>
     <property name="isSignalling" column="SIGNALLING_"/>
     
@@ -68,12 +68,6 @@
 
     <property name="taskDefinitionName" column="TASKDEFNAME_"/>
 
-		<list name="comments" cascade="all-delete-orphan">
-			<key column="TASK_" />
-			<list-index column="TASK_IDX_" />
-			<one-to-many class="org.jbpm.pvm.internal.model.CommentImpl" />
-		</list>
-
     <set name="subTasks" cascade="all-delete-orphan">
       <key column="SUPERTASK_" />
       <one-to-many class="TaskImpl" />

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -46,9 +46,7 @@
         "<jbpm-configuration>" +
         "  <process-engine-context>" +
         "    <script-manager default-expression-language='juel'" +
-        "                    default-script-language='juel'" +
-        "                    read-contexts='execution, environment, process-engine' " +
-        "                    write-context='execution'>" +
+        "                    default-script-language='juel'>" +
         "      <script-language name='groovy' factory='com.sun.script.groovy.GroovyScriptEngineFactory' />" +
         "    </script-manager>" +
         "  </process-engine-context>" +

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -43,9 +43,7 @@
         "<jbpm-configuration>" +
         "  <process-engine-context>" +
         "    <script-manager default-expression-language='juel'" +
-        "                    default-script-language='juel'" +
-        "                    read-contexts='execution, environment, process-engine' " +
-        "                    write-context='execution'>" +
+        "                    default-script-language='juel'>" +
         "      <script-language name='juel' factory='com.sun.script.juel.JuelScriptEngineFactory' />" +
         "    </script-manager>" +
         "  </process-engine-context>" +

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/AutoWireTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/AutoWireTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/AutoWireTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -38,7 +38,7 @@
 
   public static class PieceOfCake {
 
-    // auto-wire means that when an object like this is create,
+    // auto-wire means that when an object like this is createTime,
     // that the WireScope will try to look for objects with
     // the same name as the fields in the class.  If it finds
     // an object with that name, and if it is assignable to the

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -31,7 +31,8 @@
 import org.jbpm.pvm.internal.cmd.CommandService;
 import org.jbpm.pvm.internal.env.Environment;
 import org.jbpm.pvm.internal.env.Transaction;
-import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.type.variable.StringVariable;
 import org.jbpm.test.JbpmTestCase;
 
@@ -51,7 +52,7 @@
     commandService.execute(new Command<Object>() {
       public Object execute(Environment environment) {
         Session session = environment.get(Session.class);
-        session.save(new CommentImpl("if i only had the time to write code"));
+        session.save(new HistoryCommentImpl("if i only had the time to write code"));
         return null;
       }
     });
@@ -59,7 +60,7 @@
     commandService.execute(new Command<Object>() {
       public Object execute(Environment environment) {
         Session session = environment.get(Session.class);
-        List<CommentImpl> comments = session.createQuery("from " + CommentImpl.class.getName()).list();
+        List<HistoryCommentImpl> comments = session.createQuery("from " + HistoryCommentImpl.class.getName()).list();
         assertEquals("if i only had the time to write code", comments.get(0).getMessage());
         session.delete(comments.get(0));
         return null;
@@ -76,7 +77,7 @@
 
         public Object execute(Environment environment) {
           Session session = environment.get(Session.class);
-          session.save(new CommentImpl("if i only had the time to write code"));
+          session.save(new HistoryCommentImpl("if i only had the time to write code"));
           throw new MyOwnRuntimeException();
         }
       });
@@ -89,7 +90,7 @@
 
       public Object execute(Environment environment) {
         Session session = environment.get(Session.class);
-        List<CommentImpl> comments = session.createQuery("from " + CommentImpl.class.getName()).list();
+        List<HistoryDetailImpl> comments = session.createQuery("from " + HistoryDetailImpl.class.getName()).list();
         assertEquals(0, comments.size());
         return null;
       }
@@ -105,7 +106,7 @@
 
         public Object execute(Environment environment) throws Exception {
           Session session = environment.get(Session.class);
-          session.save(new CommentImpl("if i only had the time to write code"));
+          session.save(new HistoryCommentImpl("if i only had the time to write code"));
           throw new MyOwnCheckedException();
         }
       });
@@ -119,7 +120,7 @@
 
       public Object execute(Environment environment) {
         Session session = environment.get(Session.class);
-        List<CommentImpl> comments = session.createQuery("from " + CommentImpl.class.getName()).list();
+        List<HistoryDetailImpl> comments = session.createQuery("from " + HistoryDetailImpl.class.getName()).list();
         assertEquals(0, comments.size());
         return null;
       }
@@ -129,11 +130,8 @@
   public static class SuccessfulSynchronization implements Synchronization {
 
     public void beforeCompletion() {
-      Environment environment = Environment.getCurrent();
-      Session session = environment.get(Session.class);
-      StringVariable stringVariable = new StringVariable();
-      stringVariable.setValue("hello");
-      session.save(stringVariable);
+      Session session = Environment.getFromCurrent(Session.class);
+      session.save(new HistoryCommentImpl("b) hello from before completion"));
     }
 
     public void afterCompletion(int arg0) {
@@ -144,7 +142,7 @@
     commandService.execute(new Command<Object>() {
       public Object execute(Environment environment) throws Exception {
         Session session = environment.get(Session.class);
-        session.save(new CommentImpl("if i only had the time to write code"));
+        session.save(new HistoryCommentImpl("a) if i only had the time to write code"));
         Transaction transaction = environment.get(Transaction.class);
         SuccessfulSynchronization successfulSynchronization = new SuccessfulSynchronization();
         transaction.registerSynchronization(successfulSynchronization);
@@ -155,12 +153,13 @@
     commandService.execute(new Command<Object>() {
       public Object execute(Environment environment) {
         Session session = environment.get(Session.class);
-        List<CommentImpl> comments = session.createQuery("from " + CommentImpl.class.getName()).list();
-        assertEquals("if i only had the time to write code", comments.get(0).getMessage());
+        List<HistoryCommentImpl> comments = session.createQuery(
+          "from " + HistoryCommentImpl.class.getName()+" as hc " +
+          "order by hc.message asc ").list();
+        assertEquals("a) if i only had the time to write code", comments.get(0).getMessage());
+        assertEquals("b) hello from before completion", comments.get(1).getMessage());
         session.delete(comments.get(0));
-        List<StringVariable> stringVariables = session.createQuery("from " + StringVariable.class.getName()).list();
-        assertEquals("hello", stringVariables.get(0).getValue());
-        session.delete(stringVariables.get(0));
+        session.delete(comments.get(1));
         return null;
       }
     });
@@ -169,11 +168,8 @@
   public static class UnsuccessfulSynchronization implements Synchronization {
 
     public void beforeCompletion() {
-      Environment environment = Environment.getCurrent();
-      Session session = environment.get(Session.class);
-      StringVariable stringVariable = new StringVariable();
-      stringVariable.setValue("hello");
-      session.save(stringVariable);
+      Session session = Environment.getFromCurrent(Session.class);
+      session.save(new HistoryCommentImpl("b) hello from before completion"));
       throw new MyOwnRuntimeException();
     }
 
@@ -187,7 +183,7 @@
 
         public Object execute(Environment environment) throws Exception {
           Session session = environment.get(Session.class);
-          session.save(new CommentImpl("if i only had the time to write code"));
+          session.save(new HistoryCommentImpl("a) if i only had the time to write code"));
           Transaction transaction = environment.get(Transaction.class);
           UnsuccessfulSynchronization unsuccessfulSynchronization = new UnsuccessfulSynchronization();
           transaction.registerSynchronization(unsuccessfulSynchronization);
@@ -207,10 +203,8 @@
 
       public Object execute(Environment environment) {
         Session session = environment.get(Session.class);
-        List<CommentImpl> comments = session.createQuery("from " + CommentImpl.class.getName()).list();
+        List<HistoryDetailImpl> comments = session.createQuery("from " + HistoryDetailImpl.class.getName()).list();
         assertEquals(0, comments.size());
-        List<StringVariable> stringVariables = session.createQuery("from " + StringVariable.class.getName()).list();
-        assertEquals(0, stringVariables.size());
         return null;
       }
     });

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.hibernate.cfg.xml" />
 
 </jbpm-configuration>

Modified: jbpm4/branches/jimma/trunk/modules/pvm/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/pvm/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/pvm/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -23,9 +23,7 @@
 
     
     <script-manager default-expression-language="juel"
-                    default-script-language="juel"
-                    read-contexts="execution, environment, process-engine"
-                    write-context="">
+                    default-script-language="juel">
         <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
     </script-manager>
     

Copied: jbpm4/branches/jimma/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmCustomCfgTestCase.java (from rev 5295, jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmCustomCfgTestCase.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmCustomCfgTestCase.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmCustomCfgTestCase.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test;
+
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class JbpmCustomCfgTestCase extends JbpmTestCase {
+
+  protected synchronized void initialize() {
+    String cfgResource = getClass().getPackage().getName().replace(".", "/")+"/jbpm.cfg.xml";
+    initialize(cfgResource);
+  }
+
+}

Modified: jbpm4/branches/jimma/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -79,19 +79,34 @@
 
   protected synchronized void initialize() {
     if (processEngine==null) {
+      String jbpmTestCfgType = System.getProperty("jbpm.test.cfg.type");
+      String jbpmTestCfgResource = System.getProperty("jbpm.test.cfg.resource");
+      initialize(jbpmTestCfgType, jbpmTestCfgResource);
+    }
+  }
 
-      String jbpmTestCfgType = System.getProperty("jbpm.test.cfg.type");
+  protected synchronized void initialize(String jbpmTestCfgResource) {
+    if (processEngine==null) {
+      initialize(jbpmTestCfgResource, null);
+    }
+  }
+
+  protected synchronized void initialize(String jbpmTestCfgResource, String jbpmTestCfgType) {
+    if (processEngine==null) {
+
+      if (log.isDebugEnabled()) {
+        log.debug("building "+
+                  (jbpmTestCfgType!=null ? jbpmTestCfgType+" " : "")+
+                  "ProcessEngine "+
+                  (jbpmTestCfgResource!=null ? "from resource "+jbpmTestCfgResource : "from default resource jbpm.cfg.xml"));
+      }
+
       Configuration configuration = new Configuration(jbpmTestCfgType);
-
-      String jbpmTestCfgResource = System.getProperty("jbpm.test.cfg.resource");
       if (jbpmTestCfgResource!=null) {
         configuration.setResource(jbpmTestCfgResource);
       }
-
       processEngine = configuration.buildProcessEngine();
       
-      log.debug("using ProcessEngine "+System.identityHashCode(processEngine));
-
       repositoryService = processEngine.get(RepositoryService.class);
       executionService = processEngine.getExecutionService();
       historyService = processEngine.getHistoryService();
@@ -100,7 +115,7 @@
       identityService = processEngine.getIdentityService();
     }
   }
-
+  
   protected void tearDown() throws Exception {
     for (String deploymentId : registeredDeployments) {
       repositoryService.deleteDeploymentCascade(deploymentId);

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg (from rev 5295, jbpm4/trunk/modules/test-cfg)


Property changes on: jbpm4/branches/jimma/trunk/modules/test-cfg
___________________________________________________________________
Name: svn:ignore
   + target


Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/.classpath
===================================================================
--- jbpm4/trunk/modules/test-cfg/.classpath	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/.classpath	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-  <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
-  <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
-	<classpathentry kind="output" path="target/classes"/>
-</classpath>

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/.classpath (from rev 5295, jbpm4/trunk/modules/test-cfg/.classpath)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/.classpath	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/.classpath	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+  <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+  <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/.project
===================================================================
--- jbpm4/trunk/modules/test-cfg/.project	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/.project	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>test-cfg</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.maven.ide.eclipse.maven2Nature</nature>
-	</natures>
-</projectDescription>

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/.project (from rev 5295, jbpm4/trunk/modules/test-cfg/.project)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/.project	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/.project	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>test-cfg</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/pom.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/pom.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ====================================================================== -->
-<!--                                                                        -->
-<!--  JBoss, the OpenSource J2EE webOS                                      -->
-<!--                                                                        -->
-<!--  Distributable under LGPL license.                                     -->
-<!--  See terms of license at http://www.gnu.org.                           -->
-<!--                                                                        -->
-<!-- ====================================================================== -->
-
-<!-- $Id: pom.xml 5246 2009-07-06 11:07:48Z tom.baeyens at jboss.com $ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-  <modelVersion>4.0.0</modelVersion>
-  <name>jBPM 4 - Test Cfg</name>
-  <groupId>org.jbpm.jbpm4</groupId>
-  <artifactId>jbpm-test-cfg</artifactId>
-  <packaging>jar</packaging>
-
-  <!-- Parent -->
-  <parent>
-    <groupId>org.jbpm.jbpm4</groupId>
-    <artifactId>jbpm</artifactId>
-    <version>4.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <!-- Dependencies -->
-  <dependencies>
-
-    <dependency>
-      <groupId>org.jbpm.jbpm4</groupId>
-      <artifactId>jbpm-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.jbpm.jbpm4</groupId>
-      <artifactId>jbpm-test-base</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.jbpm.jbpm4</groupId>
-      <artifactId>jbpm-jpdl</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.jbpm.jbpm4</groupId>
-      <artifactId>jbpm-test-base</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring</artifactId>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.jbpm.jbpm4</groupId>
-      <artifactId>jbpm-console-reports</artifactId>
-      <scope>test</scope>
-    </dependency>    
-
-  </dependencies>
-  
-</project>

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/pom.xml (from rev 5295, jbpm4/trunk/modules/test-cfg/pom.xml)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/pom.xml	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/pom.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!--  JBoss, the OpenSource J2EE webOS                                      -->
+<!--                                                                        -->
+<!--  Distributable under LGPL license.                                     -->
+<!--  See terms of license at http://www.gnu.org.                           -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+
+<!-- $Id: pom.xml 5246 2009-07-06 11:07:48Z tom.baeyens at jboss.com $ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+  <name>jBPM 4 - Test Cfg</name>
+  <groupId>org.jbpm.jbpm4</groupId>
+  <artifactId>jbpm-test-cfg</artifactId>
+  <packaging>jar</packaging>
+
+  <!-- Parent -->
+  <parent>
+    <groupId>org.jbpm.jbpm4</groupId>
+    <artifactId>jbpm</artifactId>
+    <version>4.0-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+
+  <!-- Dependencies -->
+  <dependencies>
+
+    <dependency>
+      <groupId>org.jbpm.jbpm4</groupId>
+      <artifactId>jbpm-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jbpm.jbpm4</groupId>
+      <artifactId>jbpm-test-base</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jbpm.jbpm4</groupId>
+      <artifactId>jbpm-jpdl</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jbpm.jbpm4</groupId>
+      <artifactId>jbpm-test-base</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jbpm.jbpm4</groupId>
+      <artifactId>jbpm-console-reports</artifactId>
+      <scope>test</scope>
+    </dependency>    
+
+  </dependencies>
+  
+</project>

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src (from rev 5295, jbpm4/trunk/modules/test-cfg/src)

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test)

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/java)

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/java/org)

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm)

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test)

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg)

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.custombusinesscalendarcfg;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-import org.jbpm.api.ProcessInstance;
-import org.jbpm.api.job.Job;
-import org.jbpm.pvm.internal.util.Clock;
-import org.jbpm.test.JbpmCustomCfgTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CustomBusinessCalendarCfgTest extends JbpmCustomCfgTestCase {
-
-  public void testCustomBusinessCalendarCfg() {
-    deployJpdlXmlString(
-      "<process name='CustomBusinessCalendarCfg'>" +
-      "  <start>" +
-      "    <transition to='a' />" +
-      "  </start>" +
-      "  <state name='a'>" +
-      "    <transition to='b' />" +
-      "    <transition name='timeout' to='escalate'>" +
-      "      <timer duedate='8 business hours' />" +
-      "    </transition>" +
-      "  </state>" +
-      "  <state name='b' />" +
-      "  <end name='escalate' />" +
-      "</process>"
-    );
-    
-    GregorianCalendar gregorianCalendar = new GregorianCalendar();
-    gregorianCalendar.set(2009, Calendar.JANUARY, 30, 11, 0, 0);
-    Date clockDate = gregorianCalendar.getTime();
-    Clock.setCurrentTime(clockDate);
-
-    ProcessInstance processInstance = executionService.startProcessInstanceByKey("CustomBusinessCalendarCfg");
-
-    Job job = managementService.createJobQuery()
-      .processInstanceId(processInstance.getId())
-      .uniqueResult();
-    
-    Date duedate = job.getDueDate();
-    
-    gregorianCalendar = new GregorianCalendar();
-    gregorianCalendar.setTime(duedate);
-    assertEquals(2009, gregorianCalendar.get(Calendar.YEAR));
-    assertEquals(Calendar.NOVEMBER, gregorianCalendar.get(Calendar.MONTH));
-    assertEquals(2, gregorianCalendar.get(Calendar.DAY_OF_MONTH));
-    assertEquals(10, gregorianCalendar.get(Calendar.HOUR_OF_DAY));
-    assertEquals(0, gregorianCalendar.get(Calendar.MINUTE));
-    assertEquals(0, gregorianCalendar.get(Calendar.SECOND));
-    
-  }
-}

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarcfg/CustomBusinessCalendarCfgTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.custombusinesscalendarcfg;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.job.Job;
+import org.jbpm.pvm.internal.util.Clock;
+import org.jbpm.test.JbpmCustomCfgTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CustomBusinessCalendarCfgTest extends JbpmCustomCfgTestCase {
+
+  public void testCustomBusinessCalendarCfg() {
+    deployJpdlXmlString(
+      "<process name='CustomBusinessCalendarCfg'>" +
+      "  <start>" +
+      "    <transition to='a' />" +
+      "  </start>" +
+      "  <state name='a'>" +
+      "    <transition to='b' />" +
+      "    <transition name='timeout' to='escalate'>" +
+      "      <timer duedate='8 business hours' />" +
+      "    </transition>" +
+      "  </state>" +
+      "  <state name='b' />" +
+      "  <end name='escalate' />" +
+      "</process>"
+    );
+    
+    GregorianCalendar gregorianCalendar = new GregorianCalendar();
+    gregorianCalendar.set(2009, Calendar.JANUARY, 30, 11, 0, 0);
+    Date clockDate = gregorianCalendar.getTime();
+    Clock.setCurrentTime(clockDate);
+
+    ProcessInstance processInstance = executionService.startProcessInstanceByKey("CustomBusinessCalendarCfg");
+
+    Job job = managementService.createJobQuery()
+      .processInstanceId(processInstance.getId())
+      .uniqueResult();
+    
+    Date duedate = job.getDueDate();
+    
+    gregorianCalendar = new GregorianCalendar();
+    gregorianCalendar.setTime(duedate);
+    assertEquals(2009, gregorianCalendar.get(Calendar.YEAR));
+    assertEquals(Calendar.NOVEMBER, gregorianCalendar.get(Calendar.MONTH));
+    assertEquals(2, gregorianCalendar.get(Calendar.DAY_OF_MONTH));
+    assertEquals(10, gregorianCalendar.get(Calendar.HOUR_OF_DAY));
+    assertEquals(0, gregorianCalendar.get(Calendar.MINUTE));
+    assertEquals(0, gregorianCalendar.get(Calendar.SECOND));
+    
+  }
+}

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl)

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.custombusinesscalendarimpl;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-import org.jbpm.pvm.internal.cal.BusinessCalendar;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CustomBusinessCalendar implements BusinessCalendar {
-  
-  public Date add(Date date, String duration) {
-    if ("my next birthday".equals(duration)) {
-      GregorianCalendar gregorianCalendar = new GregorianCalendar();
-      gregorianCalendar.set(Calendar.MONTH, Calendar.JULY);
-      gregorianCalendar.set(Calendar.DAY_OF_MONTH, 21);
-      return gregorianCalendar.getTime();
-    }
-    return null;
-  }
-}

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendar.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.custombusinesscalendarimpl;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import org.jbpm.pvm.internal.cal.BusinessCalendar;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CustomBusinessCalendar implements BusinessCalendar {
+  
+  public Date add(Date date, String duration) {
+    if ("my next birthday".equals(duration)) {
+      GregorianCalendar gregorianCalendar = new GregorianCalendar();
+      gregorianCalendar.set(Calendar.MONTH, Calendar.JULY);
+      gregorianCalendar.set(Calendar.DAY_OF_MONTH, 21);
+      return gregorianCalendar.getTime();
+    }
+    return null;
+  }
+}

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.custombusinesscalendarimpl;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-import org.jbpm.api.ProcessInstance;
-import org.jbpm.api.job.Job;
-import org.jbpm.pvm.internal.cal.BusinessCalendar;
-import org.jbpm.test.JbpmCustomCfgTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CustomBusinessCalendarImplTest extends JbpmCustomCfgTestCase {
-
-  public void testCustomBusinessCalendar() {
-    BusinessCalendar customBusinessCalendar = processEngine.get(BusinessCalendar.class);
-    assertNotNull(customBusinessCalendar);
-    assertEquals(CustomBusinessCalendar.class, customBusinessCalendar.getClass());
-  }
-
-  public void testCustomBusinessCalendarUsage() {
-    deployJpdlXmlString(
-      "<process name='CustomBusinessCalendar'>" +
-      "  <start>" +
-      "    <transition to='a' />" +
-      "  </start>" +
-      "  <state name='a'>" +
-      "    <transition to='b' />" +
-      "    <transition name='timeout' to='escalate'>" +
-      "      <timer duedate='my next birthday' />" +
-      "    </transition>" +
-      "  </state>" +
-      "  <state name='b' />" +
-      "  <end name='escalate' />" +
-      "</process>"
-    );
-
-    ProcessInstance processInstance = executionService.startProcessInstanceByKey("CustomBusinessCalendar");
-
-    Job job = managementService.createJobQuery()
-      .processInstanceId(processInstance.getId())
-      .uniqueResult();
-    
-    Date duedate = job.getDueDate();
-    
-    GregorianCalendar gregorianCalendar = new GregorianCalendar();
-    gregorianCalendar.setTime(duedate);
-    assertEquals(Calendar.JULY, gregorianCalendar.get(Calendar.MONTH));
-    assertEquals(21, gregorianCalendar.get(Calendar.DAY_OF_MONTH));
-  }
-}

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custombusinesscalendarimpl/CustomBusinessCalendarImplTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.custombusinesscalendarimpl;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.job.Job;
+import org.jbpm.pvm.internal.cal.BusinessCalendar;
+import org.jbpm.test.JbpmCustomCfgTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CustomBusinessCalendarImplTest extends JbpmCustomCfgTestCase {
+
+  public void testCustomBusinessCalendar() {
+    BusinessCalendar customBusinessCalendar = processEngine.get(BusinessCalendar.class);
+    assertNotNull(customBusinessCalendar);
+    assertEquals(CustomBusinessCalendar.class, customBusinessCalendar.getClass());
+  }
+
+  public void testCustomBusinessCalendarUsage() {
+    deployJpdlXmlString(
+      "<process name='CustomBusinessCalendar'>" +
+      "  <start>" +
+      "    <transition to='a' />" +
+      "  </start>" +
+      "  <state name='a'>" +
+      "    <transition to='b' />" +
+      "    <transition name='timeout' to='escalate'>" +
+      "      <timer duedate='my next birthday' />" +
+      "    </transition>" +
+      "  </state>" +
+      "  <state name='b' />" +
+      "  <end name='escalate' />" +
+      "</process>"
+    );
+
+    ProcessInstance processInstance = executionService.startProcessInstanceByKey("CustomBusinessCalendar");
+
+    Job job = managementService.createJobQuery()
+      .processInstanceId(processInstance.getId())
+      .uniqueResult();
+    
+    Date duedate = job.getDueDate();
+    
+    GregorianCalendar gregorianCalendar = new GregorianCalendar();
+    gregorianCalendar.setTime(duedate);
+    assertEquals(Calendar.JULY, gregorianCalendar.get(Calendar.MONTH));
+    assertEquals(21, gregorianCalendar.get(Calendar.DAY_OF_MONTH));
+  }
+}

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources)

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/jbpm.hibernate.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.hibernate.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!DOCTYPE hibernate-configuration PUBLIC
-          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
-  <session-factory>
-  
-     <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
-     <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
-     <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
-     <property name="hibernate.connection.username">sa</property>
-     <property name="hibernate.connection.password"></property>
-     <property name="hibernate.hbm2ddl.auto">create-drop</property>
-     <property name="hibernate.format_sql">true</property>
-     
-     <mapping resource="jbpm.repository.hbm.xml" />
-     <mapping resource="jbpm.execution.hbm.xml" />
-     <mapping resource="jbpm.history.hbm.xml" />
-     <mapping resource="jbpm.task.hbm.xml" />
-     <mapping resource="jbpm.identity.hbm.xml" />
-     
-  </session-factory>
-</hibernate-configuration>

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.hibernate.cfg.xml (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/jbpm.hibernate.cfg.xml)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.hibernate.cfg.xml	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.hibernate.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+  <session-factory>
+  
+     <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+     <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+     <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
+     <property name="hibernate.connection.username">sa</property>
+     <property name="hibernate.connection.password"></property>
+     <property name="hibernate.hbm2ddl.auto">create-drop</property>
+     <property name="hibernate.format_sql">true</property>
+     
+     <mapping resource="jbpm.repository.hbm.xml" />
+     <mapping resource="jbpm.execution.hbm.xml" />
+     <mapping resource="jbpm.history.hbm.xml" />
+     <mapping resource="jbpm.task.hbm.xml" />
+     <mapping resource="jbpm.identity.hbm.xml" />
+     
+  </session-factory>
+</hibernate-configuration>

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.mail.properties
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/jbpm.mail.properties	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.mail.properties	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,3 +0,0 @@
-mail.smtp.host	localhost
-mail.smtp.port	2525
-mail.from		noreply at jbpm.org
\ No newline at end of file

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.mail.properties (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/jbpm.mail.properties)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.mail.properties	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/jbpm.mail.properties	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,3 @@
+mail.smtp.host	localhost
+mail.smtp.port	2525
+mail.from		noreply at jbpm.org
\ No newline at end of file

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/logging.properties	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/logging.properties	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,18 +0,0 @@
-handlers= java.util.logging.ConsoleHandler
-redirect.commons.logging = enabled
-
-java.util.logging.ConsoleHandler.level = FINE
-java.util.logging.ConsoleHandler.formatter = org.jbpm.internal.log.LogFormatter
-
-org.jbpm.level=FINE
-# org.jbpm.pvm.internal.tx.level=FINE
-# org.jbpm.pvm.internal.wire.level=FINE
-# org.jbpm.pvm.internal.util.level=FINE
-
-org.hibernate.level=INFO
-org.hibernate.cfg.SettingsFactory.level=SEVERE
-org.hibernate.cfg.HbmBinder.level=SEVERE
-# org.hibernate.SQL.level=FINEST
-# org.hibernate.type.level=FINEST
-# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
-# org.hibernate.transaction.level=FINEST
\ No newline at end of file

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/logging.properties (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/logging.properties)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/logging.properties	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/logging.properties	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,18 @@
+handlers= java.util.logging.ConsoleHandler
+redirect.commons.logging = enabled
+
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = org.jbpm.internal.log.LogFormatter
+
+org.jbpm.level=FINE
+# org.jbpm.pvm.internal.tx.level=FINE
+# org.jbpm.pvm.internal.wire.level=FINE
+# org.jbpm.pvm.internal.util.level=FINE
+
+org.hibernate.level=INFO
+org.hibernate.cfg.SettingsFactory.level=SEVERE
+org.hibernate.cfg.HbmBinder.level=SEVERE
+# org.hibernate.SQL.level=FINEST
+# org.hibernate.type.level=FINEST
+# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
+# org.hibernate.transaction.level=FINEST
\ No newline at end of file

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/org)

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm)

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test)

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg)

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
-  <import resource="jbpm.default.cfg.xml" />
-  <import resource="jbpm.tx.hibernate.cfg.xml" />
-  <import resource="jbpm.jpdl.cfg.xml" />
-  <import resource="jbpm.identity.cfg.xml" />
-
-  <process-engine-context>
-    <business-calendar>
-      <monday    hours="9:00-18:00"/>
-      <tuesday   hours="9:00-18:00"/>
-      <wednesday hours="9:00-18:00"/>
-      <thursday  hours="9:00-18:00"/>
-      <friday    hours="9:00-18:00"/>
-      <holiday period="01/02/2009 - 31/10/2009"/>
-    </business-calendar>
-  </process-engine-context>
-
-</jbpm-configuration>

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/jbpm.cfg.xml (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/jbpm.cfg.xml)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/jbpm.cfg.xml	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarcfg/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+  <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.tx.hibernate.cfg.xml" />
+  <import resource="jbpm.jpdl.cfg.xml" />
+  <import resource="jbpm.identity.cfg.xml" />
+
+  <process-engine-context>
+    <business-calendar>
+      <monday    hours="9:00-18:00"/>
+      <tuesday   hours="9:00-18:00"/>
+      <wednesday hours="9:00-18:00"/>
+      <thursday  hours="9:00-18:00"/>
+      <friday    hours="9:00-18:00"/>
+      <holiday period="01/02/2009 - 31/10/2009"/>
+    </business-calendar>
+  </process-engine-context>
+
+</jbpm-configuration>

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl)

Deleted: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
-  <import resource="jbpm.default.cfg.xml" />
-  <import resource="jbpm.tx.hibernate.cfg.xml" />
-  <import resource="jbpm.jpdl.cfg.xml" />
-  <import resource="jbpm.identity.cfg.xml" />
-
-  <process-engine-context>
-    <object class="org.jbpm.test.custombusinesscalendarimpl.CustomBusinessCalendar" />
-  </process-engine-context>
-
-</jbpm-configuration>

Copied: jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml (from rev 5295, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/custombusinesscalendarimpl/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+  <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.tx.hibernate.cfg.xml" />
+  <import resource="jbpm.jpdl.cfg.xml" />
+  <import resource="jbpm.identity.cfg.xml" />
+
+  <process-engine-context>
+    <object class="org.jbpm.test.custombusinesscalendarimpl.CustomBusinessCalendar" />
+  </process-engine-context>
+
+</jbpm-configuration>

Modified: jbpm4/branches/jimma/trunk/modules/test-concurrent/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-concurrent/src/test/resources/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-concurrent/src/test/resources/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   
   <!-- we need to remove the retry interceptor, so we cant use the default 

Modified: jbpm4/branches/jimma/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/pom.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/pom.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -101,6 +101,7 @@
             <artifactId>maven-antrun-plugin</artifactId>
             <executions>
               <execution>
+                <id>database-test-cfg-customization</id>
                 <phase>test-compile</phase>
                 <goals>
                   <goal>run</goal>
@@ -108,11 +109,12 @@
                 <configuration>
                   <tasks>
                     <copy file="../../qa/jdbc/${database}.properties" 
-                          tofile="target/test-classes/jdbc.properties" />
+                          tofile="target/test-classes/jdbc.properties"
+                          overwrite="true" />
                     <copy file="${user.home}/.jbpm4/jdbc/${database}.properties" 
                           tofile="target/test-classes/jdbc.properties"
                           overwrite="true"
-                          failonerror="true "/>
+                          failonerror="false"/>
                     <copy file="../../modules/distro/src/main/files/db/hibernate.cfg/${database}.hibernate.cfg.xml" 
                           tofile="target/test-classes/jbpm.hibernate.cfg.xml" 
                           overwrite="true">
@@ -182,6 +184,7 @@
             <artifactId>maven-antrun-plugin</artifactId>
             <executions>
               <execution>
+                <id>integration-test-cfg-customization</id>
                 <phase>test-compile</phase>
                 <goals>
                   <goal>run</goal>
@@ -200,17 +203,6 @@
             </executions>
           </plugin>
 
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <failIfNoTests>false</failIfNoTests>
-              <trimStackTrace>false</trimStackTrace>
-              <excludes>
-                <!-- doesn't run for the moment. see https://jira.jboss.org/jira/browse/JBPM-2354 -->
-                <exclude>org/jbpm/test/reporting/SQLStmtTest.java</exclude>
-              </excludes>
-            </configuration>
-          </plugin>
         </plugins>
       </build>
     </profile>

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -35,9 +35,9 @@
   }
 
   protected void tearDown() throws Exception {
-    taskService.deleteTask(taskLaundryId);
-    taskService.deleteTask(taskDishesId);
-    taskService.deleteTask(taskIronId);
+    taskService.deleteTaskCascade(taskLaundryId);
+    taskService.deleteTaskCascade(taskDishesId);
+    taskService.deleteTaskCascade(taskIronId);
     
     super.tearDown();
   }

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/ConcurrentEndTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/ConcurrentEndTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/ConcurrentEndTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -24,6 +24,7 @@
 import org.jbpm.api.Execution;
 import org.jbpm.api.ProcessInstance;
 import org.jbpm.test.JbpmTestCase;
+import org.jbpm.test.activities.PassThroughActivity;
 
 
 /**
@@ -68,4 +69,31 @@
     ProcessInstance processInstance = executionService.startProcessInstanceByKey("ConcurrentEnd");
     assertEquals(Execution.STATE_ENDED, processInstance.getState());
   }
+  
+  public void testConcurrentEndScenario3() {
+    deployJpdlXmlString(
+      "<process name='ConcurrentEnd'>" +
+      " <start>" +
+      " <transition to='f' />" +
+      " </start>" +
+      " <fork name='f'>" +
+      " <transition to='a' />" +
+      " <transition to='b' />" +
+      " </fork>" +
+      " <custom name='a' class='"+PassThroughActivity.class.getName()+"'>" +
+      " <transition to='join' />" +
+      " </custom>" +
+      " <custom name='b' class='"+PassThroughActivity.class.getName()+"'>" +
+      " <transition to='join' />" +
+      " </custom>" +
+      " <join name='join'>" +
+      " <transition to='end' />" +
+      " </join>" +
+      " <end name='end' />" +
+      "</process>"
+    );
+
+    ProcessInstance processInstance = executionService.startProcessInstanceByKey("ConcurrentEnd");
+    assertEquals(Execution.STATE_ENDED, processInstance.getState());
+  } 
 }

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/reporting/SQLStmtTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/reporting/SQLStmtTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/reporting/SQLStmtTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,6 +21,8 @@
  */
 
 import junit.framework.TestCase;
+
+import org.hibernate.cfg.Configuration;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -55,16 +57,14 @@
 
   protected void setUp() throws Exception
   {
-    InputStream in =
-        Thread.currentThread().getContextClassLoader()
-            .getResourceAsStream("jbpm.hibernate.cfg.xml");
+    // hibernate configuration is leveraged to parse the 
+    // properties as plain jdk dom parsing results in 
+    // in an exception when running without internet connection 
+    // when the hibernate dtd being retrieved from the url, 
+    Properties jdbcProps = new Configuration()
+      .configure("jbpm.hibernate.cfg.xml")
+      .getProperties();
 
-    if(null==in)
-      fail("Failed to read jbpm.hibernate.cfg.xml");
-
-    Document hibnCfg = parseTemplate(in);
-    Properties jdbcProps = getConnectionSettings(hibnCfg);
-
     // create connection
     Class.forName(jdbcProps.getProperty("hibernate.connection.driver_class"));
     this.conn = DriverManager.getConnection(
@@ -156,32 +156,6 @@
     return props;
   }
 
-  private Properties getConnectionSettings(Document doc)
-    {
-      List<Element> props = new ArrayList<Element>();
-      dfsElementSearch(props, doc.getDocumentElement(),
-          new Filter()
-          {
-            public boolean select(Element candidate)
-            {
-              return candidate.getNodeName().equals("property")
-                  && DOMUtils.getAttributeValue(candidate, "name").startsWith("hibernate.connection");
-            }
-          });
-
-      Properties connectionSettings = new Properties();
-      for(Element el : props)
-      {
-        connectionSettings.put(
-            DOMUtils.getAttributeValue(el, "name"),
-            el.getTextContent()
-        );
-      }
-
-      return connectionSettings;
-    }
-
-
   private Document parseTemplate(InputStream in)
       throws ParserConfigurationException, SAXException, IOException
   {

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -34,7 +34,7 @@
  */
 public class SubTaskTest extends JbpmTestCase {
 
-  public void testTaskParticipants() {
+  public void testSubTasks() {
     
     // create top level task
     // * clean da house
@@ -116,7 +116,7 @@
     assertEquals(expectedTaskNames, subTaskNames);
     
     // delete task dishes
-    taskService.deleteTask(dishesTaskId);
+    taskService.deleteTaskCascade(dishesTaskId);
 
     // verify all the sub tasks of 'clean da house' and 'sweep floor'
     
@@ -139,8 +139,8 @@
 
     // delete laundry and delete sweep floor
     // NOTE: deleting sweep floor should recursively delete the subtasks
-    taskService.deleteTask(laundryTaskId);
-    taskService.deleteTask(sweepFloorTaskId);
+    taskService.deleteTaskCascade(laundryTaskId);
+    taskService.deleteTaskCascade(sweepFloorTaskId);
 
     subTaskNames = getTaskNames(taskService.getSubTasks(taskId));
 
@@ -152,7 +152,7 @@
     expectedTaskNames = new HashSet<String>();
     assertEquals(expectedTaskNames, subTaskNames);
     
-    taskService.deleteTask(taskId);
+    taskService.deleteTaskCascade(taskId);
   }
 
   private Set<String> getTaskNames(List<Task> tasks) {

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -23,7 +23,7 @@
 
 import java.util.List;
 
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.api.task.Task;
 import org.jbpm.test.JbpmTestCase;
 
@@ -42,7 +42,7 @@
     //   - what! you had a party while i was out ?!
     //      - euh yes.  it was a great party :-)
     // i'll clean up the mess
-    Comment comment = taskService.addTaskComment(taskId, "what a party yesterday");
+    HistoryComment comment = taskService.addTaskComment(taskId, "what a party yesterday");
     String whatAPartyId = comment.getId();
     comment = taskService.addReplyComment(whatAPartyId, "what! you had a party while i was out ?!");
     String youHadAPartyId = comment.getId();
@@ -50,14 +50,14 @@
 
     taskService.addTaskComment(taskId, "i'll clean up the mess");
     
-    List<Comment> taskComments = taskService.getTaskComments(taskId);
+    List<HistoryComment> taskComments = taskService.getTaskComments(taskId);
     assertEquals("what a party yesterday", taskComments.get(0).getMessage());
     assertEquals("i'll clean up the mess", taskComments.get(1).getMessage());
     
-    taskComments = taskComments.get(0).getComments();
+    taskComments = taskComments.get(0).getReplies();
     assertEquals("what! you had a party while i was out ?!", taskComments.get(0).getMessage());
     
-    taskComments = taskComments.get(0).getComments();
+    taskComments = taskComments.get(0).getReplies();
     assertEquals("euh yes.  it was a great party :-)", taskComments.get(0).getMessage());
     
     taskService.deleteComment(whatAPartyId);
@@ -65,13 +65,12 @@
     taskComments = taskService.getTaskComments(taskId);
     assertEquals("i'll clean up the mess", taskComments.get(0).getMessage());
     
-    // the following should delete the remaining comment.  if not, this 
-    // will show up as a fixme.
-    taskService.deleteTask(taskId);
+    // the following should delete the remaining comment.  if not, this will show up as a fixme.
+    taskService.deleteTaskCascade(taskId);
   }
-  
+
   public void testGetTaskCommentsWithUnexistingTaskId() {
-    List<Comment> comments = taskService.getTaskComments("-1234");
+    List<HistoryComment> comments = taskService.getTaskComments("-1234");
     assertTrue(comments.isEmpty());
   }
   

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -47,16 +47,16 @@
     assertNotNull("expected non-null task", task);
     // make some change
     Date dueDate = new Date();
-    task.setDueDate(dueDate);
+    task.setDuedate(dueDate);
     taskService.saveTask(task);
     // verify change is applied
     task = taskService.getTask(taskId);
     
     // task.getDueDate() return an java.sql.Timestamp
     DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
-    assertEquals(df.format(dueDate), df.format(task.getDueDate()));
+    assertEquals(df.format(dueDate), df.format(task.getDuedate()));
     
-    taskService.deleteTask(taskId);
+    taskService.deleteTaskCascade(taskId);
   }
 
   public void testDeleteTask() {
@@ -66,7 +66,7 @@
     // task was made persistent
     assertNotNull("expected non-null task", taskService.getTask(taskId));
     // delete task and verify it does not exist
-    taskService.deleteTask(taskId);
+    taskService.deleteTaskCascade(taskId);
     task = taskService.getTask(taskId);
     assertNull("expected null, but was " + task, task);
   }

Deleted: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,151 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.task;
-
-import org.jbpm.api.Execution;
-import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.task.OpenTask;
-import org.jbpm.pvm.internal.task.TaskHandler;
-import org.jbpm.pvm.internal.task.TaskImpl;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TaskHandlerTest extends JbpmTestCase {
-
-  public static class ReviewHandler extends TaskHandler {
-    private static final long serialVersionUID = 1L;
-    public boolean executionCreateTask(TaskImpl task) {
-      task.getExecution().setVariable("isExecutionCreateTaskCalled", "true");
-      return super.executionCreateTask(task);
-    }
-
-    public void executionSignal(TaskImpl task) {
-      task.getExecution().setVariable("isExecutionSignalledCalled", "true");
-      super.executionSignal(task);
-    }
-
-    public void taskDelete(TaskImpl task, String reason) {
-      task.getExecution().setVariable("isTaskCancelCalled", "true");
-      super.taskDelete(task, reason);
-    }
-
-    public void taskComplete(TaskImpl task, String outcome) {
-      task.getExecution().setVariable("isTaskCompleteCalled", "true");
-      super.taskComplete(task, outcome);
-    }
-
-    public void taskSubTaskComplete(TaskImpl task, OpenTask subTask, String outcome) {
-      task.getExecution().setVariable("isSubTaskCompleteCalled", "true");
-      super.taskSubTaskComplete(task, subTask, outcome);
-    }
-
-    public void taskVariableUpdate(TaskImpl task, String key, Object value) {
-      task.getExecution().setVariable("isTaskVariableUpdateCalled", "true");
-      super.taskVariableUpdate(task, key, value);
-    }
-  }
-
-  public void testTaskHandlerBasicScenario() {
-    deployJpdlXmlString(
-      "<process name='TaskHandler'>" +
-      "  <start>" +
-      "    <transition to='review' />" +
-      "  </start>" +
-      "  <task name='review'>" +
-      "    <task-handler class='"+ReviewHandler.class.getName()+"' />" +
-      "    <transition to='wait' />" +
-      "  </task>" +
-      "  <state name='wait'/>" +
-      "</process>"
-    );
-    
-    String processInstanceId = executionService.startProcessInstanceByKey("TaskHandler").getId();
-    
-    assertEquals("true", executionService.getVariable(processInstanceId, "isExecutionCreateTaskCalled"));
-    
-    Task task = taskService.createTaskQuery().list().get(0);
-    
-    String taskId = task.getId();
-    taskService.setVariable(taskId, "checked", "true");
-    
-    assertEquals("true", executionService.getVariable(processInstanceId, "isExecutionCreateTaskCalled"));
-    
-    Task subTask = taskService.newTask(taskId);
-    String subTaskId = taskService.saveTask(subTask);
-    taskService.completeTask(subTaskId);
-    
-    assertEquals("true", executionService.getVariable(processInstanceId, "isSubTaskCompleteCalled"));
-
-    taskService.completeTask(taskId);
-
-    assertEquals("true", executionService.getVariable(processInstanceId, "isTaskCompleteCalled"));
-  }
-
-  public void testTaskHandlerCancelScenario() {
-    deployJpdlXmlString(
-      "<process name='TaskHandler'>" +
-      "  <start>" +
-      "    <transition to='review' />" +
-      "  </start>" +
-      "  <task name='review'>" +
-      "    <task-handler class='"+ReviewHandler.class.getName()+"' />" +
-      "    <transition to='wait' />" +
-      "  </task>" +
-      "  <state name='wait'/>" +
-      "</process>"
-    );
-    
-    String processInstanceId = executionService.startProcessInstanceByKey("TaskHandler").getId();
-    
-    Task task = taskService.createTaskQuery().list().get(0);
-    String taskId = task.getId();
-
-    taskService.deleteTask(taskId);
-    
-    assertEquals("true", executionService.getVariable(processInstanceId, "isTaskCancelCalled"));
-  }
-
-  public void testTaskHandlerExecutionSignalScenario() {
-    deployJpdlXmlString(
-      "<process name='TaskHandler'>" +
-      "  <start>" +
-      "    <transition to='review' />" +
-      "  </start>" +
-      "  <task name='review'>" +
-      "    <task-handler class='"+ReviewHandler.class.getName()+"' />" +
-      "    <transition to='wait' />" +
-      "  </task>" +
-      "  <state name='wait'/>" +
-      "</process>"
-    );
-    
-    Execution execution = executionService.startProcessInstanceByKey("TaskHandler");
-    String executionId = execution.getId();
-    
-    executionService.signalExecutionById(executionId);
-    
-    assertEquals("true", executionService.getVariable(executionId, "isExecutionSignalledCalled"));
-  }
-}

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -68,10 +68,10 @@
 
     assertEquals(3, taskList.size());
     
-    taskService.deleteTask(startBusinessTaskId);
-    taskService.deleteTask(capitalTaskId);
-    taskService.deleteTask(ideaTaskId);
-    taskService.deleteTask(laundryTaskId);
+    taskService.deleteTaskCascade(startBusinessTaskId);
+    taskService.deleteTaskCascade(capitalTaskId);
+    taskService.deleteTaskCascade(ideaTaskId);
+    taskService.deleteTaskCascade(laundryTaskId);
   }
 
   public void testPersonalTaskListDefaultSortOrder() {
@@ -117,10 +117,10 @@
 
     assertEquals(5, taskList.size());
 
-    taskService.deleteTask(profitTaskId);
-    taskService.deleteTask(dayOffTaskId);
-    taskService.deleteTask(startBusinessTaskId);
-    taskService.deleteTask(capitalTaskId);
-    taskService.deleteTask(ideaTaskId);
+    taskService.deleteTaskCascade(profitTaskId);
+    taskService.deleteTaskCascade(dayOffTaskId);
+    taskService.deleteTaskCascade(startBusinessTaskId);
+    taskService.deleteTaskCascade(capitalTaskId);
+    taskService.deleteTaskCascade(ideaTaskId);
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -93,7 +93,7 @@
 
     assertEquals(expectedIds, candidateGroupIds);
     
-    taskService.deleteTask(taskId);
+    taskService.deleteTaskCascade(taskId);
   }
 
   public Set<String> extractParticipatingUserIds(List<Participation> taskParticipations, String participationType) {

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -90,9 +90,9 @@
     groupTasks = taskService.findGroupTasks("jackblack");
     assertEquals(0, groupTasks.size());
     
-    taskService.deleteTask(taskId);
-    taskService.deleteTask(johnsOtherTaskId);
-    taskService.deleteTask(joesOtherTaskId);
+    taskService.deleteTaskCascade(taskId);
+    taskService.deleteTaskCascade(johnsOtherTaskId);
+    taskService.deleteTaskCascade(joesOtherTaskId);
   }
 
   public void testGroupCandidate() {
@@ -123,8 +123,8 @@
     groupTasks = taskService.findGroupTasks("jackblack");
     assertEquals(0, groupTasks.size());
     
-    taskService.deleteTask(taskId);
-    taskService.deleteTask(johnsOtherTaskId);
-    taskService.deleteTask(joesOtherTaskId);
+    taskService.deleteTaskCascade(taskId);
+    taskService.deleteTaskCascade(johnsOtherTaskId);
+    taskService.deleteTaskCascade(joesOtherTaskId);
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -69,10 +69,10 @@
 
     assertEquals(4, taskList.size());
     
-    taskService.deleteTask(capitalTaskId);
-    taskService.deleteTask(startBusinessTaskId);
-    taskService.deleteTask(dyperTaskId);
-    taskService.deleteTask(laudryTaskId);
+    taskService.deleteTaskCascade(capitalTaskId);
+    taskService.deleteTaskCascade(startBusinessTaskId);
+    taskService.deleteTaskCascade(dyperTaskId);
+    taskService.deleteTaskCascade(laudryTaskId);
   }
 
   public void testSimplestTaskQuerySortBy() {
@@ -112,9 +112,9 @@
 
     assertEquals(4, taskList.size());
 
-    taskService.deleteTask(capitalTaskId);
-    taskService.deleteTask(startBusinessTaskId);
-    taskService.deleteTask(dyperTaskId);
-    taskService.deleteTask(laudryTaskId);
+    taskService.deleteTaskCascade(capitalTaskId);
+    taskService.deleteTaskCascade(startBusinessTaskId);
+    taskService.deleteTaskCascade(dyperTaskId);
+    taskService.deleteTaskCascade(laudryTaskId);
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,6 +21,9 @@
  */
 package org.jbpm.test.task;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.jbpm.api.task.Task;
 import org.jbpm.test.JbpmTestCase;
 
@@ -35,12 +38,15 @@
     task.setName("clean da house");
     String taskId = taskService.saveTask(task);
     
-    taskService.setVariable(taskId, "text", "hello");
-    taskService.setVariable(taskId, "number", new Integer(5));
+    Map<String, Object> variables = new HashMap<String, Object>();
+    variables.put("text", "hello");
+    variables.put("number", new Integer(5));
+
+    taskService.setVariables(taskId, variables);
     
     assertEquals("hello", taskService.getVariable(taskId, "text"));
     assertEquals(new Integer(5), taskService.getVariable(taskId, "number"));
     
-    taskService.deleteTask(taskId);
+    taskService.deleteTaskCascade(taskId);
   }
 }

Copied: jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskReassignTest.java (from rev 5295, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskReassignTest.java)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskReassignTest.java	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskReassignTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.taskactivity;
+
+import java.util.List;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryTask;
+import org.jbpm.api.task.Task;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskReassignTest extends JbpmTestCase {
+
+  public void testReassignHistory() {
+    deployJpdlXmlString(
+      "<process name='ReassignTest' xmlns='"+JpdlParser.JPDL_NAMESPACE+"'>" +
+      "  <start>" +
+      "    <transition to='write email'/>" +
+      "  </start>" +
+      "  <task name='write email' assignee='shekharv'>" +
+      "    <transition to='end'/>" +
+      "  </task>" +
+      "  <end name='end'/>" +
+      "</process>"
+    );
+    
+    ProcessInstance pi = executionService.startProcessInstanceByKey("ReassignTest");
+
+    List<Task> tasks = taskService.findPersonalTasks("shekharv");
+    assertTrue(tasks.size() == 1);
+
+    String taskId = tasks.get(0).getId();
+
+    taskService.assignTask(taskId, "johndoe");
+    
+    List<Task> tasksAfterReassignment = taskService.findPersonalTasks("shekharv");
+    assertTrue("shekharv should not have any tasks.", tasksAfterReassignment.size() == 0);
+
+    List<Task> tasksForNewAssignee = taskService.findPersonalTasks("johndoe");
+    assertTrue("johndoe should have 1 task.", tasksForNewAssignee.size() == 1);
+
+    assertEquals("johndoe", taskService.getTask(taskId).getAssignee());
+
+    taskService.completeTask(taskId);
+    
+    HistoryTask historyTask = historyService
+      .createHistoryTaskQuery()
+      .taskId(taskId)
+      .uniqueResult();
+
+    assertEquals("John Doe completed the Task, but someone else got the credit", "johndoe", historyTask.getAssignee());
+  }
+}

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.hibernate.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.identity.cfg.xml" />

Modified: jbpm4/branches/jimma/trunk/modules/test-db/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-db/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-db/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.identity.cfg.xml" />
 

Modified: jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -26,12 +26,12 @@
 import java.util.List;
 
 import org.hibernate.Session;
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.CommentImpl;
 import org.jbpm.pvm.internal.session.MessageSession;
 
 
@@ -70,9 +70,9 @@
 
       public Object execute(Environment environment) throws Exception {
         Session session = environment.get(Session.class);
-        List<Comment> comments = session.createQuery("from " + CommentImpl.class.getName()).list();
+        List<HistoryComment> comments = session.createQuery("from " + HistoryDetailImpl.class.getName()).list();
         
-        for (Comment comment : comments) {
+        for (HistoryComment comment : comments) {
           log.debug("retrieved message: "+comment.getMessage());
           Integer messageId = new Integer(comment.getMessage());
           assertTrue("message " + messageId + " committed twice", failOnceMessageIds.remove(messageId));

Modified: jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,13 +21,12 @@
  */
 package org.jbpm.test.load.async;
 
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.model.CommentImpl;
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
 import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
@@ -58,7 +57,7 @@
     DbSession dbSession = environment.get(DbSession.class);
 
     // this message execution should be rolled back
-    Comment comment = new CommentImpl(Integer.toString(messageId));
+    HistoryComment comment = new HistoryCommentImpl(Integer.toString(messageId));
     dbSession.save(comment);
 
     if (!FailOnceMessageTest.failOnceMessageIds.contains(messageId)) {

Modified: jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -28,8 +28,8 @@
 import org.jbpm.api.job.Job;
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.CommentImpl;
 import org.jbpm.pvm.internal.session.MessageSession;
 
 
@@ -65,7 +65,7 @@
         throw new JbpmException("todo get the jobs with exception");
 
 //        Session session = environment.get(Session.class);
-//        List commands = session.createQuery("from " + CommentImpl.class.getName()).list();
+//        List commands = session.createQuery("from " + HistoryCommentImpl.class.getName()).list();
 //        assertTrue("command insertion should have been rolled back", commands.isEmpty());
 //        return null;
       }

Modified: jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -21,11 +21,11 @@
  */
 package org.jbpm.test.load.async;
 
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.CommentImpl;
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
 
@@ -41,8 +41,8 @@
     DbSession dbSession = environment.get(DbSession.class);
     
     // this message execution should be rolled back
-    Comment comment = new CommentImpl("failing update");
-    dbSession.save(comment);
+//    HistoryComment comment = new HistoryDetailImpl("failing update");
+//    dbSession.save(comment);
     
     throw new RuntimeException("ooops"); 
   }

Modified: jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -26,8 +26,9 @@
 import org.hibernate.Session;
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.CommentImpl;
 import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
 import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
 
@@ -57,7 +58,7 @@
   }
 
   public Void execute(Environment environment) throws Exception {
-    CommentImpl comment = new CommentImpl(Integer.toString(messageId));
+    HistoryDetailImpl comment = new HistoryCommentImpl(Integer.toString(messageId));
     Session session = environment.get(Session.class);
     session.save(comment);
     return null;

Modified: jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -25,12 +25,12 @@
 import java.util.List;
 
 import org.hibernate.Session;
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
 import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.pvm.internal.model.CommentImpl;
 import org.jbpm.pvm.internal.session.MessageSession;
 import org.jbpm.test.Db;
 
@@ -67,8 +67,8 @@
       public List<Integer> execute(Environment environment) {
         List<Integer> processedMessageNumbers = new ArrayList<Integer>();
         Session session = environment.get(Session.class);
-        List<Comment> comments = session.createCriteria(CommentImpl.class).list();
-        for (Comment comment: comments) {
+        List<HistoryComment> comments = session.createCriteria(HistoryDetailImpl.class).list();
+        for (HistoryComment comment: comments) {
           int processedMessageNumber = Integer.parseInt(comment.getMessage());
           processedMessageNumbers.add(processedMessageNumber);
           // make sure the db stays clean

Modified: jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -24,7 +24,7 @@
 import org.hibernate.Session;
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 
 /**
  * @author Tom Baeyens
@@ -36,10 +36,10 @@
   protected String message;
 
   public Void execute(Environment environment) throws Exception {
-    CommentImpl comment = new CommentImpl(message);
-    Session session = environment.get(Session.class);
-    session.save(comment);
-    MessageProcessingTest.commentAdded();
+//    HistoryDetailImpl comment = new HistoryDetailImpl(message);
+//    Session session = environment.get(Session.class);
+//    session.save(comment);
+//    MessageProcessingTest.commentAdded();
     return null;
   }
 }

Modified: jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java	2009-07-15 05:27:19 UTC (rev 5296)
@@ -25,15 +25,15 @@
 import java.util.List;
 
 import org.hibernate.Session;
-import org.jbpm.api.model.Comment;
+import org.jbpm.api.history.HistoryComment;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.cmd.CompositeCmd;
 import org.jbpm.pvm.internal.cmd.SendMessageCmd;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
 import org.jbpm.pvm.internal.job.CommandMessage;
 import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.pvm.internal.model.CommentImpl;
 import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
 import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
 import org.jbpm.test.load.LoadTestCase;
@@ -119,8 +119,8 @@
       public List<Integer> execute(Environment environment) {
         List<Integer> processedMessageNumbers = new ArrayList<Integer>();
         Session session = environment.get(Session.class);
-        List<Comment> comments = session.createCriteria(CommentImpl.class).list();
-        for (Comment comment: comments) {
+        List<HistoryComment> comments = session.createCriteria(HistoryDetailImpl.class).list();
+        for (HistoryComment comment: comments) {
           int processedMessageNumber = Integer.parseInt(comment.getMessage());
           processedMessageNumbers.add(processedMessageNumber);
           // make sure the db stays clean

Modified: jbpm4/branches/jimma/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.hibernate.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.identity.cfg.xml" />

Modified: jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.gpd.site.png
===================================================================
(Binary files differ)

Copied: jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/images/gpd.runtime.location.png (from rev 5295, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.runtime.location.png)
===================================================================
(Binary files differ)

Modified: jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/master.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/master.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -9,7 +9,7 @@
   <!ENTITY ch06-Jpdl               SYSTEM "modules/ch06-Jpdl.xml">
   <!ENTITY ch07-Variables          SYSTEM "modules/ch07-Variables.xml">
   <!ENTITY ch08-Scripting          SYSTEM "modules/ch08-Scripting.xml">
-  <!ENTITY ch09-Identity           SYSTEM "modules/ch09-Identity.xml">
+  <!ENTITY ch09-Configuration      SYSTEM "modules/ch09-Configuration.xml">
 ]>
 
 <book lang="en">
@@ -28,6 +28,6 @@
   &ch06-Jpdl;
   &ch07-Variables;
   &ch08-Scripting;
-  &ch09-Identity;
+  &ch09-Configuration;
 
 </book>
\ No newline at end of file

Modified: jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -51,27 +51,9 @@
 
   <section>
     <title>Migration from jBPM 3</title>
-    <para>Migration from jBPM 3 to jBPM 4 is not supported.  
+    <para>Migration from jBPM 3 to jBPM 4 is not supported. Check out the developers 
+    guide for more information about migration.
     </para>
-    <para>jBPM 3 and jBPM 4 can be deployed on the same JVM and
-    on the same database.  Packages are stricktly separated and database 
-    table prefix is changed from <literal>JBPM_</literal> to <literal>JBPM4_</literal> 
-    </para>
-    <itemizedlist>
-      <listitem><emphasis role="bold">jPDL process files</emphasis>: A process file 
-      conversion tool is in the works.  It will be shipped with the distribution 
-      in one of the following releases.
-      </listitem>
-      <listitem><emphasis role="bold">API</emphasis>: The jBPM API has completely 
-      changed.  Where jBPM 3 exposed the internal object model and didn't have 
-      a session facade API, the supported API of jBPM 4 are the services, which are 
-      in fact session facades that can be used in any environment that we support.
-      </listitem>
-      <listitem><emphasis role="bold">Database</emphasis>: The jBPM database also 
-      has drastically changed between version 3 and 4.  There is no migration tool 
-      to convert jBPM 3 runtime database contents to jBPM 4. 
-      </listitem>
-    </itemizedlist>
   </section>
 
 </chapter>

Modified: jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -23,7 +23,7 @@
     <para>jBPM requires a JDK (standard java) version 5 or higher.
     </para>
     <ulink url="http://java.sun.com/javase/downloads/index.jsp">http://java.sun.com/javase/downloads/index.jsp</ulink>
-    <para>To execute the ant scripts, you'll need apache ant version 1.7.0 or higher:
+    <para>To execute the ant scripts, you'll need apache ant version <emphasis role="bold">1.7.0</emphasis> or higher:
     </para>
     <ulink url="http://ant.apache.org/bindownload.cgi">http://ant.apache.org/bindownload.cgi</ulink>
   </section>
@@ -35,8 +35,8 @@
     </para>
     <para>If you have previously downloaded jboss-5.0.0.GA.zip, create a downloads directory 
     in your jBPM home directory and place the zip file in there. Otherwise the script will download 
-    it for you. The same is true for eclipse-jee-ganymede-SR2-win32.zip 
-    (or eclipse-jee-ganymede-SR2-linux-gtk(-x86_64).tar.gz on Linux and eclipse-jee-ganymede-SR2-macosx-carbon.tar.gz on Mac OSX)
+    it for you. The same is true for eclipse-jee-galileo-win32.zip 
+    (or eclipse-jee-galileo-linux-gtk(-x86_64).tar.gz on Linux and eclipse-jee-galileo-macosx-carbon.tar.gz on Mac OSX)
     </para>
     <para>Open a command prompt and go do directory <literal>${jbpm.home}/jboss</literal>.  Then 
     run
@@ -58,7 +58,7 @@
     <para>After this is done JBoss will be running in the background.  Once eclipse has started, you can continue 
     to follow the instructions of <xref linkend="graphicalprocessdesigner" /> 
     </para>
-    <para>And you can surf to <ulink url="http://localhost:8080/gwt-console">the jBPM console</ulink>
+    <para>And you can surf to <ulink url="http://localhost:8080/jbpm-console">the jBPM console</ulink>
     You can login as one of the following users:
     </para>
     <table><title>Example console users:</title>
@@ -101,7 +101,7 @@
 	  <para>As part of the installation, the jBPM configuration 
 	  files will be deployed to the target environment.  Those jBPM configuration 
 	  files themselves should not be changed after installation.  Instead
-	  the installation scripts take a specific configuration parameters 
+	  the installation scripts take specific configuration parameters 
 	  that will build a valid configuration on the target environment.
 	  </para>
 	  
@@ -144,6 +144,15 @@
     </para>
   </section>
 
+  <section id="librarydependenciesandconfigurationfiles">
+    <title>Library dependencies and configuration files</title>
+    <para>We provide support for installations of jBPM through our automatic ant  
+    scripts.  Those scripts will be put the right libs and the right configuration 
+    files in the right location for you. If you want to create your own installation of 
+    jBPM in your application, see the developers guide for more information.      
+    </para>
+  </section>
+
   <section id="jboss">
     <title>JBoss</title>
     <para>The build file <literal>${jbpm.home}/jboss/build.xml</literal> contains scripts for 
@@ -155,27 +164,24 @@
     </para>
   </section>
 
+  <section id="tomcat">
+    <title>Tomcat</title>
+    <para>ETA for Tomcat is 4.1: <ulink url="https://jira.jboss.org/jira/browse/JBPM-2397">See JBPM-2397</ulink></para>
+  </section>
+
   <section id="database">
     <title>Database</title>
     <para>The build file <literal>${jbpm.home}/db/build.xml</literal> contains scripts for 
     DB operations like creating and dropping the schema.  Navigate to that directory and run <literal>ant -p</literal>
     for more details.
     </para>
+    <para>To create the schema in your database:</para>
+    <itemizedlist>
+      <listitem>First, update the properties file of your database in <literal>${jbpm.home}/db/jdbc</literal></listitem>
+      <listitem>Then run target <literal>ant create.jbpm.schema</literal> in the db directory</listitem>
+    </itemizedlist>
   </section>
 
-  <section id="tomcat">
-    <title>Tomcat</title>
-    <para>TODO: this will contain a description of how to use the 
-    installer to install jbpm on tomcat</para>
-  </section>
-
-  <section id="configurationfiles">
-    <title>Configuration files</title>
-    <para>If you're not deploying in JBoss, then the example configuration files 
-    in the examples <literal>src</literal> are the best starting point.  
-    </para>
-  </section>
-
   <section id="graphicalprocessdesigner">
     <title>Graphical Process Designer (GPD)</title>
     <para>Eclipse is used as the platform to host the jPDL graphical process
@@ -183,11 +189,11 @@
     how to install the GPD plugin in Eclipse.</para>
     <section>
       <title>Get Eclipse</title>
-      <para>You'll need Eclipse 3.4.2.
+      <para>You'll need Eclipse 3.5.0.
       </para>
       <para>Use the <link linkend="gettingstarted">demo setup</link> or download 
       eclipse manually:      
-      <ulink url="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR2">Eclipse IDE for Java EE Developers (163 MB)</ulink>.
+      <ulink url="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo">Eclipse IDE for Java EE Developers (163 MB)</ulink>.
       </para>
       <para>The classic version of eclipse will not be sufficient as it does 
       not have an XML editor.  Eclipse for Java developers should also 
@@ -195,7 +201,7 @@
       </para>
     </section>
     <section>
-      <title>Add the update site <literal>gpd/jbpm-gpd-site.zip</literal></title>
+      <title>Install the GPD plugin into eclipse</title>
       <para>The installation of the GPD uses the Eclipse Software Update 
       mechanism and is pretty straightforward. There is an archived update 
       site included in the runtime installation of jBPM when you unzip it 
@@ -204,25 +210,38 @@
       <para>To add the update site to eclipse:
       </para>
       <itemizedlist>
-        <listitem><literal>Help</literal> --> <literal>Software Updates</literal></listitem> 
-        <listitem>Select tab <literal>Available Software</literal></listitem>
-        <listitem>Click <literal>Add Site...</literal> </listitem>
+        <listitem><literal>Help</literal> --> <literal>Install New Software...</literal></listitem> 
+        <listitem>Click <literal>Add...</literal> </listitem>
         <listitem>In dialog <literal>Add Site</literal> dialog, click <literal>Archive...</literal></listitem>
-        <listitem>Navigate to <literal>gpd/jbpm-gpd-site.zip</literal></listitem>
-        <listitem>Clicking <literal>OK</literal> will bring you back to the dialog 'Software Updates and Add-ons'</listitem>
+        <listitem>Navigate to <literal>gpd/jbpm-gpd-site.zip</literal> and click 'Open'</listitem>
+        <listitem>Clicking <literal>OK</literal> in the <literal>Add Site</literal> dialog will bring you back to the dialog 'Install'</listitem>
         <listitem>Select the <literal>jPDL 4 GPD Update Site</literal> that has appeared</listitem>
-        <listitem>Click <literal>Install...</literal> </listitem>
-        <listitem>In dialog <literal>Install</literal>, select <literal>Flow Common Feature</literal> 
-          and <literal>jPDL 4 Feature</literal></listitem>
-        <listitem>Click <literal>Next</literal></listitem>
-        <listitem>Select <literal>Accept</literal> and click <literal>Finish</literal></listitem>
-        <listitem>Restart eclipse</listitem>
+        <listitem>Click <literal>Next...</literal> and then <literal>Finish</literal></listitem>
+        <listitem>Approve the license</listitem>
+        <listitem>Restart eclipse when that is asked</listitem>
       </itemizedlist>
       <figure id="gpd.install.gpd.site">
         <title>Adding the GPD local archive site</title>
         <mediaobject><imageobject><imagedata align="center" fileref="images/gpd.install.gpd.site.png"/></imageobject></mediaobject>
       </figure>
     </section>
+
+    <section>
+      <title>Configuring the jBPM runtime</title>
+      <itemizedlist>
+        <listitem>Click <literal>Window</literal> --> <literal>Preferences</literal> </listitem>
+        <listitem>Select <literal>JBoss jBPM</literal> --> <literal>jBPM 4</literal> --> <literal>Runtime Locations</literal> </listitem>
+        <listitem>Click <literal>Add...</literal> </listitem>
+        <listitem>In the <literal>Add Location</literal> dialog, enter a name like e.g. <literal>jbpm-4.0</literal> and then click <literal>Search...</literal> </listitem>
+        <listitem>In the <literal>Browse For Folder</literal> dialog, select your jbpm home directory and click <literal>OK</literal> </listitem>
+        <listitem>Click <literal>OK</literal> in the <literal>Add Location</literal> dialog</listitem>
+      </itemizedlist>
+      <figure id="gpd.runtime.location">
+        <title>Defining jBPM Libraries</title>
+        <mediaobject><imageobject><imagedata align="center" fileref="images/gpd.runtime.location.png"/></imageobject></mediaobject>
+      </figure>
+    </section>
+
     <section id="definejbpmuserlibraries">
       <title>Define the jBPM User Library</title>
       <para>This section shows how to define a user library for your workspace

Modified: jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch04-DeployingBusinessArchives.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch04-DeployingBusinessArchives.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch04-DeployingBusinessArchives.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -144,6 +144,12 @@
     <para>In case of the examples, an examples.jar file is created with 
     all the classes and it is put in the <literal>lib</literal> directory of the JBoss 
     server configuration.</para>
+    <para>If you want process classloading so that user defined classes can be deployed 
+    in and loaded from the business archive, vote for it in 
+    <ulink url="https://jira.jboss.org/jira/browse/JBPM-2200">JIRA issue JBPM-2200</ulink>.
+    We'll prioritize this depending on the number of votes and on the use cases that 
+    you can add as a comment in which you explain why you need it.
+    </para>
   </section>
 
 </chapter>

Modified: jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1227,6 +1227,69 @@
             </tbody>
           </tgroup>
         </table>
+        <table><title><literal>notification</literal> attributes:</title>
+          <tgroup cols="5" rowsep="1" colsep="1">
+            <thead>
+              <row>
+                <entry>Attribute</entry>
+                <entry>Type</entry>
+                <entry>Default</entry>
+                <entry>Required?</entry>
+                <entry>Description</entry>
+              </row>
+            </thead>
+            <tbody>
+              <row>
+                <entry><literal>continue</literal></entry>
+                <entry>{sync | async | exclusive}</entry>
+                <entry>sync</entry>
+                <entry>optional</entry>
+                <entry>Specifies if an asynchronous continuation should be introduced 
+                right before sending this notification email.
+                </entry>
+              </row>
+            </tbody>
+          </tgroup>
+        </table>
+        <table><title><literal>reminder</literal> attributes:</title>
+          <tgroup cols="5" rowsep="1" colsep="1">
+            <thead>
+              <row>
+                <entry>Attribute</entry>
+                <entry>Type</entry>
+                <entry>Default</entry>
+                <entry>Required?</entry>
+                <entry>Description</entry>
+              </row>
+            </thead>
+            <tbody>
+              <row>
+                <entry><literal>duedate</literal></entry>
+                <entry>duration (plain string or containing expression)</entry>
+                <entry></entry>
+                <entry><emphasis role="bold">required</emphasis></entry>
+                <entry>Delay before a reminder email should be send.
+                </entry>
+              </row>
+              <row>
+                <entry><literal>repeat</literal></entry>
+                <entry>duration (plain string or containing expression)</entry>
+                <entry></entry>
+                <entry>optional</entry>
+                <entry>Delay after a subsequent reminder email should be send</entry>
+              </row>
+              <row>
+                <entry><literal>continue</literal></entry>
+                <entry>{sync | async | exclusive}</entry>
+                <entry>sync</entry>
+                <entry>optional</entry>
+                <entry>Specifies if an asynchronous continuation should be introduced 
+                right before sending this notification email.
+                </entry>
+              </row>
+            </tbody>
+          </tgroup>
+        </table>
         <para>Here is a basic example that accepts the default templates.</para>
         <programlisting><![CDATA[<task name="review" 
       assignee="#{order.owner}"
@@ -1516,7 +1579,9 @@
         <para>Then we set a variable on the task.  This is typically done through a form.  But 
         here we'll show how it is done programmatically.
         </para>
-        <programlisting>taskService.setVariable(task.getDbid(), &quot;result&quot;, &quot;accept&quot;);</programlisting>
+        <programlisting>Map&lt;String, Object&gt; variables = new HashMap&lt;String, Object&gt;();
+variables.put(&quot;result&quot;, &quot;accept&quot;);
+taskService.setVariables(task.getDbid(), variables);</programlisting>
         <para>Completing this task, will cause the sub process instance to end.
         </para>
         <programlisting>taskService.completeTask(task.getDbid());</programlisting>
@@ -1591,9 +1656,10 @@
         <para>Then the <literal>result</literal> variable is set and 
         the task is completed.
         </para>
-        <programlisting>taskService.setVariable(task.getDbid(), &quot;result&quot;, &quot;ok&quot;);
-taskService.completeTask(task.getDbid());
-        </programlisting>
+        <programlisting>Map&lt;String, Object&gt; variables = new HashMap&lt;String, Object&gt;();
+variables.put(quot;resultquot;, quot;okquot;);
+taskService.setVariables(task.getId(), variables);
+taskService.completeTask(task.getDbid());</programlisting>
         <para>In this scenario, the <literal>ok</literal> transition is taken in 
         the parent process out of the sub-process review activity.  The example 
         test case also shows other scenarios. 
@@ -2329,26 +2395,15 @@
 &lt;/process&gt;     	
      	</programlisting>
       </para>
-      
       <para>
-      	The examples in the distribution contain some processes using the mail
-      	activity. If you want to change the SMTP server, you can adjust the
-      	<emphasis role="bold">jbpm.mail.properties</emphasis> file, which is
-      	imported in the examples jBPM configuration file as follows:
-      	
-      	<programlisting>
-&lt;transaction-context&gt;
-   ...
-    &lt;mail-session&gt;
-      &lt;mail-server&gt;
-        &lt;session-properties resource=&quot;jbpm.mail.properties&quot; /&gt;
-      &lt;/mail-server&gt;
-    &lt;/mail-session&gt;
-&lt;/transaction-context&gt;
-      	</programlisting>
+      	The default configuration after installation contains a 
+      	<literal>jbpm.mail.properties</literal> for specifying the mail server 
+      	to be used by jBPM.  To use another mail server then localhost,  
+      	property <literal>mail.smtp.host</literal> can be updated in that 
+      	configuration file. 
       </para>
-      
-      <para>Refer to the Developers Guide for advanced mail configuration and usage.</para>
+      <para>Refer to the Developers Guide for (unsupported) advanced mail 
+      configuration and usage.</para>
     </section>
 
   </section>

Copied: jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch09-Configuration.xml (from rev 5295, jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch09-Configuration.xml)
===================================================================
--- jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch09-Configuration.xml	                        (rev 0)
+++ jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch09-Configuration.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -0,0 +1,36 @@
+<chapter id="configuration">
+  <title>Configuration</title>
+
+  <section>
+    <title>Business calendar</title>
+    <para>To customize the business calendar configuration,
+    remove the import of the default business calendar configuration
+    and replace it with your customized calendar configuration. E.g.
+    </para>
+    <programlisting>&lt;jbpm-configuration&gt;
+    
+  &lt;import resource=&quot;jbpm.default.cfg.xml&quot; /&gt;
+  ...
+
+  &lt;process-engine-context&gt;
+    &lt;business-calendar&gt;
+      &lt;monday    hours=&quot;9:00-18:00&quot;/&gt;
+      &lt;tuesday   hours=&quot;9:00-18:00&quot;/&gt;
+      &lt;wednesday hours=&quot;9:00-18:00&quot;/&gt;
+      &lt;thursday  hours=&quot;9:00-18:00&quot;/&gt;
+      &lt;friday    hours=&quot;9:00-18:00&quot;/&gt;
+      &lt;holiday period=&quot;01/02/2009 - 31/10/2009&quot;/&gt;
+    &lt;/business-calendar&gt;
+  &lt;/process-engine-context&gt;
+
+&lt;/jbpm-configuration&gt;</programlisting>
+    
+  </section>
+  
+  <section>
+    <title>Email</title>
+    <para>TODO document supported config customization 
+    of the jbpm.mail.properties</para>
+  </section>  
+
+</chapter>

Deleted: jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch09-Identity.xml
===================================================================
--- jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch09-Identity.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/modules/userguide/src/main/docbook/en/modules/ch09-Identity.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,38 +0,0 @@
-<chapter id="identity">
-  <title>Identity</title>
-  
-  <para>The default jBPM identity component is based on 
-  <ulink url="http://www.jboss.org/community/docs/DOC-13258">JBoss IDM</ulink>.  
-  Configuration is like this:
-  </para>
-  
-  <programlisting>&lt;jbpm-configuration xmlns=&quot;http://jbpm.org/xsd/cfg&quot;&gt;
-
-  <emphasis role="bold">&lt;process-engine-context&gt;</emphasis>
-    ...
-    &lt;identity-service /&gt;
-    ...
-  &lt;/process-engine-context&gt;
-
-  &lt;transaction-context&gt;
-    ...
-    <emphasis role="bold">&lt;identity-session realm=&quot;realm://jbpm-identity&quot; /&gt;</emphasis>
-  &lt;/transaction-context&gt;
-
-&lt;/jbpm-configuration&gt;</programlisting>
-
-  <para>To replace the identity component, keep the identity-service declaration, 
-  implement org.jbpm.session.IdentitySession and configure your identity session in 
-  the transaction context like this:
-  </para>
-
-  <programlisting>&lt;jbpm-configuration xmlns=&quot;http://jbpm.org/xsd/cfg&quot;&gt;
-  ...
-  &lt;transaction-context&gt;
-    ...
-    &lt;object class="your.package.YourIdentitySession" /&gt;
-  &lt;/transaction-context&gt;
-
-&lt;/jbpm-configuration&gt;</programlisting>
-
-</chapter>

Modified: jbpm4/branches/jimma/trunk/qa/hudson-jbpm4-jboss.bat
===================================================================
--- jbpm4/branches/jimma/trunk/qa/hudson-jbpm4-jboss.bat	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/qa/hudson-jbpm4-jboss.bat	2009-07-15 05:27:19 UTC (rev 5296)
@@ -7,7 +7,7 @@
 
 cmd /C ant -f qa/build.xml -Djbpm.debug=true integration.testrun.setup
 
-cmd /C mvn -U -Djboss.bind.address=localhost test
+cmd /C mvn -U -Djboss.bind.address=localhost -Ddatabase=hsqldb test
 
 cmd /C ant -f qa/build.xml integration.testrun.teardown
 

Modified: jbpm4/branches/jimma/trunk/qa/hudson-jbpm4-jboss.sh
===================================================================
--- jbpm4/branches/jimma/trunk/qa/hudson-jbpm4-jboss.sh	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/qa/hudson-jbpm4-jboss.sh	2009-07-15 05:27:19 UTC (rev 5296)
@@ -17,6 +17,8 @@
 
 ant -f qa/build.xml $ANT_PROPERTIES integration.testrun.setup
 
-mvn -U -Djboss.bind.address=localhost test
+# -Ddatabase=$DATABASE is necessary for the reporting tests in module test-db
+# that test uses the jbpm.hibernate.cfg.xml resource on the classpath to connect to the db
+mvn -U -Djboss.bind.address=localhost -Ddatabase=$DATABASE test
 
 ant -f qa/build.xml $ANT_PROPERTIES integration.testrun.teardown

Modified: jbpm4/branches/jimma/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.jta.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.jboss.idm.cfg.xml" />

Modified: jbpm4/branches/jimma/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/jimma/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml	2009-07-15 05:27:19 UTC (rev 5296)
@@ -3,6 +3,7 @@
 <jbpm-configuration>
 
   <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.tx.jta.cfg.xml" />
   <import resource="jbpm.jpdl.cfg.xml" />
   <import resource="jbpm.identity.cfg.xml" />

Modified: jbpm4/branches/jimma/trunk/qa/test.demo.setup.bat
===================================================================
--- jbpm4/branches/jimma/trunk/qa/test.demo.setup.bat	2009-07-14 20:06:49 UTC (rev 5295)
+++ jbpm4/branches/jimma/trunk/qa/test.demo.setup.bat	2009-07-15 05:27:19 UTC (rev 5296)
@@ -1,5 +1,5 @@
 echo To run this, make sure that at least you have jbpm.parent.dir specified in your ${user.home}/.jbpm4/build.properties
-cmd /C mvn -U -Pdistro clean install
+cmd /C mvn -U -Pdistro,schemadocs clean install
 cmd /C ant -f qa/build.xml reinstall.jbpm
 cmd /C ant -f modules/distro/src/main/files/jboss/build.xml demo.setup
 




More information about the jbpm-commits mailing list