Commits

masini  committed 2364949

Issue number: WF-412

  • Participants
  • Parent commits cfbd0d1

Comments (0)

Files changed (1)

File src/java/com/opensymphony/workflow/spi/hibernate/AbstractHibernateWorkflowStore.java

  * @since 2005-9-23
  * 
  */
-public abstract class AbstractHibernateWorkflowStore /* extends HibernateDaoSupport */implements WorkflowStore {
+public abstract class AbstractHibernateWorkflowStore implements WorkflowStore {
     // ~ Instance fields ////////////////////////////////////////////////////////
 
     private PropertySetDelegate propertySetDelegate;
         });
     }
     
+    protected void delete(final Object entry) throws StoreException {
+        execute(new InternalCallback() {
+            public Object doInHibernate(Session session) throws HibernateException {
+                session.delete(entry);
+                
+                return null;
+            }
+        });
+    }
+    
     public void setEntryState(final long entryId, final int state) throws StoreException {
         loadEntry(entryId).setState(state);
     }
         final HibernateHistoryStep hStep = new HibernateHistoryStep(currentStep);
         
         entry.removeCurrentSteps(currentStep);
+        delete(currentStep);
         entry.addHistorySteps(hStep);
         // We need to save here because we soon will need the stepId 
         // that hibernate calculate on save or flush
         case FieldExpression.NAME:
             return "workflowName";
 
+        case FieldExpression.DUE_DATE:
+            return "dueDate";
+            
         default:
             return "1";
         }