Index: src/modules-core/workflow/java/src/org/apache/lenya/workflow/impl/WorkflowEngineImpl.java =================================================================== --- src/modules-core/workflow/java/src/org/apache/lenya/workflow/impl/WorkflowEngineImpl.java (revision 530042) +++ src/modules-core/workflow/java/src/org/apache/lenya/workflow/impl/WorkflowEngineImpl.java (working copy) @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; +import org.apache.lenya.cms.workflow.LenyaVersion; import org.apache.lenya.workflow.Action; import org.apache.lenya.workflow.Condition; import org.apache.lenya.workflow.Transition; @@ -88,7 +89,7 @@ protected Version createNewVersion(Workflowable workflowable, Workflow workflow, String event, String destination) throws WorkflowException { Version latestVersion = workflowable.getLatestVersion(); - Version newVersion = new VersionImpl(event, destination); + Version newVersion = new LenyaVersion(event, destination); String[] variableNames = workflow.getVariableNames(); for (int i = 0; i < variableNames.length; i++) { String name = variableNames[i]; @@ -156,4 +157,4 @@ return canFire; } -} \ No newline at end of file +} Index: src/modules-core/workflow/java/src/org/apache/lenya/workflow/impl/VersionImpl.java =================================================================== --- src/modules-core/workflow/java/src/org/apache/lenya/workflow/impl/VersionImpl.java (revision 530039) +++ src/modules-core/workflow/java/src/org/apache/lenya/workflow/impl/VersionImpl.java (working copy) @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/* $Id$ */ - -package org.apache.lenya.workflow.impl; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import org.apache.lenya.workflow.Version; - -/** - * A version of the workflow history. - */ -public class VersionImpl implements Version { - - private String event; - private String state; - private Map variableValues = new HashMap(); - - /** - * @see org.apache.lenya.workflow.Version#getEvent() - */ - public String getEvent() { - return this.event; - } - - /** - * @see org.apache.lenya.workflow.Version#getState() - */ - public String getState() { - return this.state; - } - - private Date date; - private String userId; - private String ipAddress; - - /** - * Returns the date. - * @return A string. - */ - public Date getDate() { - return this.date; - } - - /** - * Sets the date. - * @param _date A date. - */ - public void setDate(Date _date) { - this.date = _date; - } - - /** - * Returns the user ID. - * @return A string. - */ - public String getUserId() { - return this.userId; - } - - /** - * Sets the user ID. - * @param _userId A user ID. - */ - public void setUserId(String _userId) { - this.userId = _userId; - } - - /** - * Returns the ip address. - * @return A string. - */ - public String getIPAddress() { - return this.ipAddress; - } - - /** - * Sets the ip address. - * @param _ipaddress A ip address. - */ - public void setIPAddress(String _ipaddress){ - this.ipAddress = _ipaddress; - } - - /** - * Ctor. - * @param _event The event that caused the version change. - * @param _state The destination state. - */ - public VersionImpl(String _event, String _state) { - this.event = _event; - this.state = _state; - } - - /** - * @see org.apache.lenya.workflow.Version#getValue(java.lang.String) - */ - public boolean getValue(String variableName) { - Boolean value = (Boolean) this.variableValues.get(variableName); - if (value == null) { - throw new RuntimeException("No value set for variable [" + variableName + "]"); - } - return value.booleanValue(); - } - - /** - * @see org.apache.lenya.workflow.Version#setValue(java.lang.String, boolean) - */ - public void setValue(String variableName, boolean value) { - this.variableValues.put(variableName, Boolean.valueOf(value)); - } - -}