[jbpm-commits] JBoss JBPM SVN: r3838 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/listener and 7 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Feb 11 12:47:19 EST 2009


Author: tom.baeyens at jboss.com
Date: 2009-02-11 12:47:18 -0500 (Wed, 11 Feb 2009)
New Revision: 3838

Added:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html
Removed:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLog.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogProperty.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogXmlSerializer.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java
Modified:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
Log:
history kickoff

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -30,7 +30,6 @@
 import org.jbpm.model.ObservableElement;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.model.Transition;
-import org.jbpm.processlog.ProcessLog;
 import org.jbpm.session.PvmDbSession;
 
 
@@ -227,11 +226,6 @@
    * registered to parent's of the given eventSource. */
   void fire(String eventName, ObservableElement eventSource);
   
-  // logs /////////////////////////////////////////////////////////////////////
-
-  /** adds a <a href="package-summary.html#logs">log</a> to this execution. */
-  void addLog(ProcessLog processLog);
-
   // extra state information methods //////////////////////////////////////////
   
   /** the current transition indicating the position in the process definition graph.

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -27,7 +27,6 @@
 import org.jbpm.model.ObservableElement;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.model.Transition;
-import org.jbpm.processlog.ProcessLog;
 
 
 /** view upon an {@link Execution path of execution} exposed to 
@@ -48,13 +47,6 @@
    * graph.  Can be null in case no event is being fired. */
   Event getEvent();
 
-  // candidates to be moved to OpenExecution:
-  
-  // logs /////////////////////////////////////////////////////////////////////
-
-  /** adds a <a href="package-summary.html#logs">log</a> to this execution. */
-  void addLog(ProcessLog processLog);
-
   // extra state information methods //////////////////////////////////////////
   
   /** the current transition indicating the position in the process definition graph.

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -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.processlog;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.session.LogSession;
-
-
-/** log session that delegates to a delegate list of log sessions.
- * 
- * @author Tom Baeyens
- */
-public class LogSessionChain implements LogSession {
-
-  protected List<LogSession> delegates = new ArrayList<LogSession>();
-
-  public void add(ProcessLog processLog) {
-    for (LogSession delegate: delegates) {
-      delegate.add(processLog);
-    }
-  }
-
-  public void addLogSession(LogSession logSession) {
-    delegates.add(logSession);
-  }
-}

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -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.processlog;
-
-import org.jbpm.session.LogSession;
-
-
-/** filtering log session.
- * 
- * @author Tom Baeyens
- */
-public class LogSessionFilter implements LogSession {
-  
-  protected LogSession delegate;
-  protected String type;
-
-  public void add(ProcessLog processLog) {
-    if (passes(processLog)){
-      delegate.add(processLog);
-    }
-  }
-
-  /** can be overwritten in case filtering needs to be more 
-   * sophisticated then just type matching. */
-  protected boolean passes(ProcessLog processLog) {
-    return ((type==null) || (type.equals(processLog.getType())));
-  }
-
-  public void setDelegate(LogSession delegate) {
-    this.delegate = delegate;
-  }
-
-  public void setType(String type) {
-    this.type = type;
-  }
-}

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLog.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLog.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLog.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,68 +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.processlog;
-
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.Execution;
-
-/**
- * @author Tom Baeyens
- */
-public interface ProcessLog {
-
-  long getDbid();
-
-  Execution getExecution();
-
-  Execution getProcessInstance();
-
-  /** text id of the type of this process log used for 
-   * XML serialization. */
-  String getType();
-
-  /** xml representation of the process log properties
-   * used for XML serialization.  Properties time, execution 
-   * and processInstance should not be included. This method 
-   * is made abstract to remind and encourage 
-   * implementors to provide XML serialization capabilities to 
-   * the fixed process log XML schema.  But it is allowed to 
-   * return null if XML serialisation if you're sure that 
-   * XML serialization will never be necessary. */
-  List<ProcessLogProperty> getProperties();
-
-  /** provides a text description for this update
-   * which can be used e.g. in the admin web console.
-   * This texts hould not contain time, execution
-   * nor processInstance. 
-   * The default implementation will include the 
-   * {@link #getType() type} and then append all the top 
-   * level properties. */
-  String toString();
-
-  Date getTime();
-
-  void setExecution(Execution execution);
-
-  void setTime(Date currentTime);
-}
\ No newline at end of file

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -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.processlog;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.Execution;
-import org.jbpm.model.OpenExecution;
-import org.jbpm.session.LogSession;
-
-/** base class for process logs.  Process logs are dispatched to the 
- * {@link LogSession} that is configured in the environment.
- * 
- * <p>ProcessLogs that are send to a LogSession is the probe mechanism 
- * provided to listen into the process execution progress and details.
- * It is the mechanism to collect process history and process statistics.
- * </p>
- * 
- * @author Tom Baeyens
- */
-public abstract class ProcessLogImpl implements Serializable, ProcessLog {
-  
-  private static final long serialVersionUID = 1L;
-
-  protected long dbid;
-  protected int index = -1;
-  protected Date time;
-  protected Execution execution;
-  protected Execution processInstance;
-  
-  public ProcessLogImpl() {
-  }
-
-  public void setExecution(OpenExecution execution) {
-    this.execution = execution;
-    this.processInstance = (execution!=null ? execution.getProcessInstance() : null);
-  }
-
-  /** text id of the type of this process log used for 
-   * XML serialization. */
-  public abstract String getType();
-
-  /** xml representation of the process log properties
-   * used for XML serialization.  Properties time, execution 
-   * and processInstance should not be included. This method 
-   * is made abstract to remind and encourage 
-   * implementors to provide XML serialization capabilities to 
-   * the fixed process log XML schema.  But it is allowed to 
-   * return null if XML serialisation if you're sure that 
-   * XML serialization will never be necessary. */
-  public abstract List<ProcessLogProperty> getProperties();
-
-  /** provides a text description for this update
-   * which can be used e.g. in the admin web console.
-   * This texts hould not contain time, execution
-   * nor processInstance. 
-   * The default implementation will include the 
-   * {@link #getType() type} and then append all the top 
-   * level properties. */
-  public String toString() {
-    StringBuffer text = new StringBuffer();
-    text.append(getType());
-    text.append('[');
-    List<ProcessLogProperty> properties = getProperties();
-    if (properties!=null) {
-      for (int i=0; i<properties.size(); i++) {
-        ProcessLogProperty property = properties.get(i);
-        text.append(property.name);
-        if (property.value!=null) {
-          text.append('=');
-          text.append(property.value);
-        }
-        if (i < (properties.size()-1)) {
-          text.append('|');
-        }
-      }
-    }
-    text.append(']');
-    return text.toString();
-  }
-
-  public long getDbid() {
-    return dbid;
-  }
-  public Date getTime() {
-    return time;
-  }
-  public void setTime(Date date) {
-    this.time = date;
-  }
-  public Execution getExecution() {
-    return execution;
-  }
-  public int getIndex() {
-    return index;
-  }
-  public Execution getProcessInstance() {
-    return processInstance;
-  }
-  public void setIndex(int index) {
-    this.index = index;
-  }
-}

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogProperty.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogProperty.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogProperty.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,80 +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.processlog;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessLogProperty {
-
-  protected String name;
-  protected String value;
-  protected List<ProcessLogProperty> properties;
-
-  public ProcessLogProperty(String name) {
-    this.name = name;
-  }
-  
-  public ProcessLogProperty(String name, String value) {
-    this.name = name;
-    this.value = value;
-  }
-  
-  public ProcessLogProperty createProperty(String name) {
-    return createProperty(name, null);
-  }
-
-  public ProcessLogProperty createProperty(String name, String value) {
-    ProcessLogProperty property = new ProcessLogProperty(name, value);
-    addProperty(property);
-    return property;
-  }
-
-  public void addProperty(ProcessLogProperty property) {
-    if (properties==null) {
-      properties = new ArrayList<ProcessLogProperty>();
-    }
-    properties.add(property);
-  }
-
-  public String getName() {
-    return name;
-  }
-  public void setName(String name) {
-    this.name = name;
-  }
-  public String getValue() {
-    return value;
-  }
-  public void setValue(String value) {
-    this.value = value;
-  }
-  public List<ProcessLogProperty> getProperties() {
-    return properties;
-  }
-  public void setProperties(List<ProcessLogProperty> properties) {
-    this.properties = properties;
-  }
-}

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogXmlSerializer.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogXmlSerializer.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogXmlSerializer.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,105 +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.processlog;
-
-import java.text.SimpleDateFormat;
-import java.util.List;
-
-import org.jbpm.Execution;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessLogXmlSerializer {
-  
-  public static final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss,SSS");
-
-  protected List<ProcessLogProperty> properties;
-
-  public void appendLog(Document document, Element parent, ProcessLog processLog) {
-    String logType = getEventType(processLog);
-    String time = getTime(processLog);
-    String executionDbid = getExecutionDbid(processLog);
-    String processInstanceDbid = getProcessInstanceDbid(processLog);
-    String processInstanceKey = getProcessInstanceKey(processLog);
-    
-    Element logElement = document.createElement("log");
-    parent.appendChild(logElement);
-    
-    logElement.setAttribute("type", logType);
-    logElement.setAttribute("time", time);
-    if (executionDbid!=null) {
-      logElement.setAttribute("execution", executionDbid);
-    }
-    if (processInstanceDbid!=null) {
-      logElement.setAttribute("instance", processInstanceDbid);
-    }
-    if (processInstanceKey!=null) {
-      logElement.setAttribute("key", processInstanceKey);
-    }
-    
-    appendProperties(document, logElement, processLog.getProperties());
-  }
-
-  protected void appendProperties(Document document, Element parent, List<ProcessLogProperty> properties) {
-    if (properties!=null) {
-      for (ProcessLogProperty property: properties) {
-        Element propertyElement = document.createElement("property");
-        parent.appendChild(propertyElement);
-        
-        if (property.name!=null) {
-          propertyElement.setAttribute("name", property.name);
-        }
-        if (property.value!=null) {
-          propertyElement.setAttribute("value", property.value);
-        }
-        appendProperties(document, propertyElement, property.getProperties());
-      }
-    }
-  }
-
-  protected String getEventType(ProcessLog processLog) {
-    return processLog.getType();
-  }
-
-  protected String getTime(ProcessLog processLog) {
-    return dateFormatter.format(processLog.getTime());
-  }
-
-  protected String getExecutionDbid(ProcessLog processLog) {
-    Execution execution = processLog.getExecution();
-    return (execution!=null ? Long.toString(execution.getDbid()) : null);
-  }
-
-  protected String getProcessInstanceDbid(ProcessLog processLog) {
-    Execution processInstance = processLog.getProcessInstance();
-    return (processInstance!=null ? Long.toString(processInstance.getDbid()) : null);
-  }
-
-  protected String getProcessInstanceKey(ProcessLog processLog) {
-    Execution processInstance = processLog.getProcessInstance();
-    return (processInstance!=null ? processInstance.getKey() : null);
-  }
-}

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html	2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,4 +0,0 @@
-<body>infrastructure for listening to process event logs that 
-can be used to build up historic information about process 
-executions. 
-</body>
\ No newline at end of file

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,30 +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.session;
-
-import org.jbpm.processlog.ProcessLog;
-
-public interface LogSession {
-  
-  void add(ProcessLog processLog);
-  
-}

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -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;
+
+import java.io.Serializable;
+
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+
+/** base class for process logs.  Process logs are dispatched to the 
+ * {@link HistorySession} that is configured in the environment.
+ * 
+ * <p>ProcessLogs that are send to a LogSession is the probe mechanism 
+ * provided to listen into the process execution progress and details.
+ * It is the mechanism to collect process history and process statistics.
+ * </p>
+ * 
+ * @author Tom Baeyens
+ */
+public abstract class HistoryEvent implements Serializable {
+  
+  private static final long serialVersionUID = 1L;
+
+  protected ExecutionImpl execution;
+  
+  public void setExecution(ExecutionImpl execution) {
+    this.execution = execution;
+  }
+
+  public abstract void process();
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+
+public interface HistorySession {
+  
+  void process(HistoryEvent historyEvent);
+  
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,46 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+/** log session that delegates to a delegate list of log sessions.
+ * 
+ * @author Tom Baeyens
+ */
+public class HistorySessionChain implements HistorySession {
+
+  protected List<HistorySession> delegates = new ArrayList<HistorySession>();
+
+  public void process(HistoryEvent historyEvent) {
+    for (HistorySession delegate: delegates) {
+      delegate.process(historyEvent);
+    }
+  }
+
+  public void addLogSession(HistorySession historySession) {
+    delegates.add(historySession);
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -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;
+
+
+
+/** filtering log session.
+ * 
+ * @author Tom Baeyens
+ */
+public class HistorySessionFilter implements HistorySession {
+  
+  protected HistorySession delegate;
+  protected String type;
+
+  public void process(HistoryEvent historyEvent) {
+    if (passes(historyEvent)){
+      delegate.process(historyEvent);
+    }
+  }
+
+  /** can be overwritten in case filtering needs to be more 
+   * sophisticated then just type matching. */
+  protected boolean passes(HistoryEvent historyEvent) {
+    return true;
+  }
+
+  public void setDelegate(HistorySession delegate) {
+    this.delegate = delegate;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,43 @@
+/*
+ * 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.hibernate.Session;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstance;
+import org.jbpm.pvm.internal.util.Clock;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessInstanceEnd extends HistoryEvent {
+
+  private static final long serialVersionUID = 1L;
+
+  public void process() {
+    long dbid = execution.getDbid();
+    Session session = Environment.getFromCurrent(Session.class);
+    HistoryProcessInstance historyProcessInstance = (HistoryProcessInstance) session.load(HistoryProcessInstance.class, dbid);
+    historyProcessInstance.setEndTime(Clock.getCurrentTime());
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -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.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstance;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessInstanceStart extends HistoryEvent implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+  
+  public void process() {
+    HistoryProcessInstance historyProcessInstance = new HistoryProcessInstance(execution);
+
+    Session session = Environment.getFromCurrent(Session.class);
+    session.save(historyProcessInstance);
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -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.pvm.internal.history.model;
+
+import java.util.Date;
+
+import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.util.Clock;
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryActivityInstance {
+
+  protected long dbid;
+  protected int dbversion;
+  
+  protected ActivityImpl activity;
+  protected String activityName;
+
+  protected Date createTime;
+  protected Date endTime;
+  protected long duration;
+  
+  public HistoryActivityInstance() {
+  }
+
+  public HistoryActivityInstance(ActivityImpl activity) {
+    this.activity = activity;
+    this.createTime = Clock.getCurrentTime();
+  }
+
+  public void setEndTime(Date endTime) {
+    this.endTime = endTime;
+    this.duration = endTime.getTime() - createTime.getTime();
+  }
+
+  
+  public long getDbid() {
+    return dbid;
+  }
+  public ActivityImpl getActivity() {
+    return activity;
+  }
+  public String getActivityName() {
+    return activityName;
+  }
+  public Date getCreateTime() {
+    return createTime;
+  }
+  public Date getEndTime() {
+    return endTime;
+  }
+  public long getDuration() {
+    return duration;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,80 @@
+/*
+ * 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;
+
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.util.Clock;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryProcessInstance {
+  
+  protected long dbid;
+  protected int dbversion;
+  
+  protected ProcessDefinitionImpl processDefinition;
+  protected String id;
+  protected String key;
+  protected Date startTime;
+  protected Date endTime;
+  protected long duration;
+  
+  public HistoryProcessInstance() {
+  }
+
+  public HistoryProcessInstance(ExecutionImpl processInstance) {
+    this.processDefinition = processInstance.getProcessDefinition();
+    this.dbid = processInstance.getDbid();
+    this.id = processInstance.getId();
+    this.key = processInstance.getKey();
+    this.startTime = Clock.getCurrentTime();
+  }
+
+  public void setEndTime(Date endTime) {
+    this.endTime = endTime;
+    this.duration = endTime.getTime() - startTime.getTime();
+  }
+
+  public Date getEndTime() {
+    return endTime;
+  }
+  public long getDbid() {
+    return dbid;
+  }
+  public ProcessDefinitionImpl getProcessDefinition() {
+    return processDefinition;
+  }
+  public Date getStartTime() {
+    return startTime;
+  }
+  public long getDuration() {
+    return duration;
+  }
+  public String getId() {
+    return id;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,41 @@
+/*
+ * 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 org.jbpm.pvm.internal.model.ActivityImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryTaskInstance extends HistoryActivityInstance {
+
+  protected String assignee;
+
+  public HistoryTaskInstance() {
+  }
+
+  public HistoryTaskInstance(ActivityImpl activity, String assignee) {
+    super(activity);
+    this.assignee = assignee;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html	2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,4 @@
+<body>infrastructure for listening to process event logs that 
+can be used to build up historic information about process 
+executions. 
+</body>
\ No newline at end of file


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-02-11 17:47:18 UTC (rev 3838)
@@ -25,9 +25,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Date;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
@@ -43,20 +41,20 @@
 import org.jbpm.client.ClientProcessInstance;
 import org.jbpm.env.Environment;
 import org.jbpm.env.Transaction;
-import org.jbpm.job.Timer;
 import org.jbpm.listener.EventListener;
 import org.jbpm.listener.EventListenerExecution;
 import org.jbpm.log.Log;
+import org.jbpm.model.Activity;
 import org.jbpm.model.Comment;
 import org.jbpm.model.Event;
 import org.jbpm.model.IdGenerator;
-import org.jbpm.model.Activity;
 import org.jbpm.model.ObservableElement;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.model.Transition;
-import org.jbpm.processlog.ProcessLog;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.HistorySession;
+import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
 import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.job.TimerImpl;
 import org.jbpm.pvm.internal.model.op.AtomicOperation;
 import org.jbpm.pvm.internal.model.op.ExecuteActivity;
 import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
@@ -64,18 +62,9 @@
 import org.jbpm.pvm.internal.model.op.ProceedToDestination;
 import org.jbpm.pvm.internal.model.op.Signal;
 import org.jbpm.pvm.internal.model.op.TakeTransition;
-import org.jbpm.pvm.internal.type.Converter;
-import org.jbpm.pvm.internal.type.Type;
-import org.jbpm.pvm.internal.type.Variable;
-import org.jbpm.pvm.internal.type.TypeSet;
-import org.jbpm.pvm.internal.type.variable.NullVariable;
-import org.jbpm.pvm.internal.type.variable.UnpersistableVariable;
-import org.jbpm.pvm.internal.util.Clock;
 import org.jbpm.pvm.internal.util.EqualsUtil;
 import org.jbpm.pvm.internal.util.Priority;
-import org.jbpm.session.LogSession;
 import org.jbpm.session.MessageSession;
-import org.jbpm.session.TimerSession;
 
 /**
  * @author Tom Baeyens
@@ -203,6 +192,9 @@
     }
     this.state = STATE_ACTIVE;
     ExecutionImpl scopedExecution = initializeScopes();
+    
+    
+    fireHistoryEvent(new ProcessInstanceStart());
     fire(Event.START, processDefinition);
     if (activity!=null) {
       scopedExecution.performAtomicOperation(EXECUTE_ACTIVITY);
@@ -930,14 +922,13 @@
   
   ////////////////////////////////////////////////////////////////////////////////
 
-  public void addLog(ProcessLog processLog) {
+  public void fireHistoryEvent(HistoryEvent historyEvent) {
     Environment environment = Environment.getCurrent();
     if (environment!=null) {
-      LogSession logSession = environment.get(LogSession.class);
-      if (logSession!=null) {
-        processLog.setExecution(this);
-        processLog.setTime(Clock.getCurrentTime());
-        logSession.add(processLog);
+      HistorySession historySession = environment.get(HistorySession.class);
+      if (historySession!=null) {
+        historyEvent.setExecution(this);
+        historySession.process(historyEvent);
       }
     }
   }




More information about the jbpm-commits mailing list