You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by ep...@apache.org on 2003/09/26 17:05:03 UTC

cvs commit: jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow WorkflowService.java WorkflowInstance.java DefaultWorkflowService.java

epugh       2003/09/26 08:05:03

  Added:       osworkflow/src/java/org/apache/fulcrum/osworkflow
                        WorkflowService.java WorkflowInstance.java
                        DefaultWorkflowService.java
  Log:
  Adding updated classes with fixed package names..
  
  Revision  Changes    Path
  1.1                  jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow/WorkflowService.java
  
  Index: WorkflowService.java
  ===================================================================
  package org.apache.fulcrum.osworkflow;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Turbine" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  import org.apache.avalon.framework.component.Component;
  
  import com.opensymphony.workflow.Workflow;
  import com.opensymphony.workflow.WorkflowException;
  
  /**
   * WorkflowService interface.
   *
   * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
   * @version $Id: WorkflowService.java,v 1.1 2003/09/26 15:05:03 epugh Exp $
   */
  public interface WorkflowService
      extends Component
  {
      /** Avalon role - used to id the component within the manager */
      String ROLE = WorkflowService.class.getName();
  
      /** Retrives a workflow based on the caller */
      public Workflow retrieveWorkflow(String caller);
      
      /** For a specific caller and status, return all the workflows. */
      public long[] retrieveWorkflows(String caller, String status) throws WorkflowException;
      
      /** Retrieves a workflow instance */
     // public WorkflowInstance retrieveWorkflowInstance(Workflow workflow, long id);
      
  
  
  }
  
  
  
  1.1                  jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow/WorkflowInstance.java
  
  Index: WorkflowInstance.java
  ===================================================================
  package org.apache.fulcrum.osworkflow;
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Turbine" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.List;
  import java.util.Map;
  import com.opensymphony.module.propertyset.PropertySet;
  import com.opensymphony.workflow.InvalidInputException;
  import com.opensymphony.workflow.Workflow;
  import com.opensymphony.workflow.WorkflowException;
  import com.opensymphony.workflow.loader.ActionDescriptor;
  import com.opensymphony.workflow.loader.WorkflowDescriptor;
  import com.opensymphony.workflow.query.WorkflowQuery;
  /**
   * WorkflowInstance represents a specific instance of a workflow.  Therefore it has
   * all the context information like what state it is in, what it's actions are etc.
   *
   * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
   * @version $Id: WorkflowInstance.java,v 1.1 2003/09/26 15:05:03 epugh Exp $
   */
  public class WorkflowInstance
  {
      private Workflow workflow;
      private long id;
      /**
       * @return
       */
      public long getId()
      {
          return id;
      }
      private WorkflowInstance()
      {
          // can't use this version
      }
      public WorkflowInstance(Workflow workflow, long id)
      {
          this.workflow = workflow;
          this.id = id;
      }
      /**
       * @param arg0
       * @param arg1
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public boolean canInitialize(String arg0, int arg1) throws WorkflowException
      {
          return workflow.canInitialize(arg0, arg1);
      }
      /**
       * @param arg0
       * @param arg1
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public boolean canModifyEntryState(int arg1) throws WorkflowException
      {
          return workflow.canModifyEntryState(getId(), arg1);
      }
      /**
       * @param arg0
       * @param arg1
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public void changeEntryState(int arg1) throws WorkflowException
      {
          workflow.changeEntryState(getId(), arg1);
      }
      /**
       * @param arg0
       * @param arg1
       * @param arg2
       * @throws com.opensymphony.workflow.InvalidInputException
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public void doAction(int arg1, Map arg2) throws InvalidInputException, WorkflowException
      {
          workflow.doAction(getId(), arg1, arg2);
      }
      /* (non-Javadoc)
       * @see java.lang.Object#equals(java.lang.Object)
       */
      public boolean equals(Object obj)
      {
          return workflow.equals(obj);
      }
      /**
       * @param arg0
       * @param arg1
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public void executeTriggerFunction(int arg1) throws WorkflowException
      {
          workflow.executeTriggerFunction(getId(), arg1);
      }
      /**
       * @param arg0
       * @param arg1
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public int[] getAvailableActions(Map arg1) throws WorkflowException
      {
          return workflow.getAvailableActions(getId(), arg1);
      }
      /**
       * @param arg0
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public List getCurrentSteps() throws WorkflowException
      {
          return workflow.getCurrentSteps(getId());
      }
      /**
       * @param arg0
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public int getEntryState() throws WorkflowException
      {
          return workflow.getEntryState(getId());
      }
      /**
       * @param arg0
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public List getHistorySteps() throws WorkflowException
      {
          return workflow.getHistorySteps(getId());
      }
      /**
       * @param arg0
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public PropertySet getPropertySet() throws WorkflowException
      {
          return workflow.getPropertySet(getId());
      }
      /**
       * @param arg0
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public List getSecurityPermissions() throws WorkflowException
      {
          return workflow.getSecurityPermissions(getId());
      }
      /**
       * @param arg0
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public WorkflowDescriptor getWorkflowDescriptor() throws WorkflowException
      {
          return workflow.getWorkflowDescriptor(getWorkflowName());
      }
      /**
       * @param arg0
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public String getWorkflowName() throws WorkflowException
      {
          return workflow.getWorkflowName(getId());
      }
      /* (non-Javadoc)
       * @see java.lang.Object#hashCode()
       */
      public int hashCode()
      {
          return workflow.hashCode();
      }
      /**
       * @param arg0
       * @return
       * @throws com.opensymphony.workflow.WorkflowException
       */
      public List query(WorkflowQuery arg0) throws WorkflowException
      {
          return workflow.query(arg0);
      }
      /* (non-Javadoc)
       * @see java.lang.Object#toString()
       */
      public String toString()
      {
          return workflow.toString();
      }
      /**
      * @param arg0
      * @return
      * @throws com.opensymphony.workflow.WorkflowException
      */
      public List getAllAvailableActions() throws WorkflowException
      {
          List actions = new ArrayList();
          int actionIds[] = workflow.getAvailableActions(getId(), Collections.EMPTY_MAP);
          for (int i = 0; i < actionIds.length; i++)
          {
              ActionDescriptor action = getWorkflowDescriptor().getAction(actionIds[i]);
              actions.add(action);
          }
          return actions;
      }
  }
  
  
  
  1.1                  jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow/DefaultWorkflowService.java
  
  Index: DefaultWorkflowService.java
  ===================================================================
  package org.apache.fulcrum.osworkflow;
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Turbine" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  import java.util.Iterator;
  import java.util.List;
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import com.opensymphony.workflow.Workflow;
  import com.opensymphony.workflow.WorkflowException;
  import com.opensymphony.workflow.basic.BasicWorkflow;
  import com.opensymphony.workflow.query.WorkflowQuery;
  /**
   * This service provides a link into the OSWorkflow engine.
   *
   * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
   * * @version $Id: DefaultWorkflowService.java,v 1.1 2003/09/26 15:05:03 epugh Exp $
   */
  public class DefaultWorkflowService
      extends AbstractLogEnabled
      implements WorkflowService, Configurable, Initializable, Disposable, ThreadSafe
  {
      /** For a specific caller and status, return all the workflows. */
      public long[] retrieveWorkflows(String caller, String status) throws WorkflowException
      {
          Workflow wf = retrieveWorkflow(caller);
          WorkflowQuery queryLeft =
              new WorkflowQuery(WorkflowQuery.OWNER, WorkflowQuery.CURRENT, WorkflowQuery.EQUALS, caller);
          WorkflowQuery queryRight =
              new WorkflowQuery(WorkflowQuery.STATUS, WorkflowQuery.CURRENT, WorkflowQuery.EQUALS, status);
          WorkflowQuery query = new WorkflowQuery(queryLeft, WorkflowQuery.AND, queryRight);
          List workflows = wf.query(query);
          long workflowIds[] = new long[workflows.size()];
          int counter = 0;
          for (Iterator i = workflows.iterator(); i.hasNext(); counter++)
          {
              Long workflowId = (Long) i.next();
              workflowIds[counter] = workflowId.longValue();
          }
          return workflowIds;
      }
      /** Retrives a workflow based on the caller */
      public Workflow retrieveWorkflow(String caller)
      {
          return new BasicWorkflow(caller);
      }
      
     
      // ---------------- Avalon Lifecycle Methods ---------------------
      /**
       * Avalon component lifecycle method
       */
      public void configure(Configuration conf) throws ConfigurationException
      {
      }
      public void initialize() throws Exception
      {
      }
      /**
       * Avalon component lifecycle method
       */
      public void dispose()
      {
      }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


RE: cvs commit: jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow WorkflowService.java WorkflowInstance.java DefaultWorkflowService.java

Posted by Eric Pugh <ep...@upstate.com>.
I will go back and put something better in..  I appreciate the nudge.  Also,
i am going to try and tweak eclipse to do better formatting.  I wish that
there was a simple way to configure eclipse to perform formats according to
the turbine rules.

I live in fear of accidentally hitting control f and reformatting all the
source and then having to reapply all my changes to the source!

Eric

> -----Original Message-----
> From: Daniel L. Rall [mailto:dlr@finemaltcoding.com]
> Sent: Friday, September 26, 2003 10:18 PM
> To: Turbine Developers List
> Subject: Re: cvs commit:
> jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum
> /osworkflo
> w WorkflowService.java WorkflowInstance.java
> DefaultWorkflowService.java
>
>
> A lot of the methods in WorkflowService appear to have only
> IDE-generated JavaDoc.
>
>
> epugh@apache.org wrote:
> > epugh       2003/09/26 08:05:03
> >
> >   Added:       osworkflow/src/java/org/apache/fulcrum/osworkflow
> >                         WorkflowService.java WorkflowInstance.java
> >                         DefaultWorkflowService.java
> >   Log:
> >   Adding updated classes with fixed package names..
> >
> >   Revision  Changes    Path
> >   1.1
> jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum
> /osworkflow/WorkflowService.java
> >
> >   Index: WorkflowService.java
> >
> ===================================================================
> >   package org.apache.fulcrum.osworkflow;
> >
> >   /*
> ====================================================================
> >    * The Apache Software License, Version 1.1
> >    *
> >    * Copyright (c) 2001-2003 The Apache Software
> Foundation.  All rights
> >    * reserved.
> >    *
> >    * Redistribution and use in source and binary forms,
> with or without
> >    * modification, are permitted provided that the
> following conditions
> >    * are met:
> >    *
> >    * 1. Redistributions of source code must retain the
> above copyright
> >    *    notice, this list of conditions and the following
> disclaimer.
> >    *
> >    * 2. Redistributions in binary form must reproduce the
> above copyright
> >    *    notice, this list of conditions and the following
> disclaimer in
> >    *    the documentation and/or other materials provided with the
> >    *    distribution.
> >    *
> >    * 3. The end-user documentation included with the redistribution,
> >    *    if any, must include the following acknowledgment:
> >    *       "This product includes software developed by the
> >    *        Apache Software Foundation (http://www.apache.org/)."
> >    *    Alternately, this acknowledgment may appear in the
> software itself,
> >    *    if and wherever such third-party acknowledgments
> normally appear.
> >    *
> >    * 4. The names "Apache" and "Apache Software Foundation" and
> >    *    "Apache Turbine" must not be used to endorse or
> promote products
> >    *    derived from this software without prior written
> permission. For
> >    *    written permission, please contact apache@apache.org.
> >    *
> >    * 5. Products derived from this software may not be
> called "Apache",
> >    *    "Apache Turbine", nor may "Apache" appear in their
> name, without
> >    *    prior written permission of the Apache Software Foundation.
> >    *
> >    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED
> OR IMPLIED
> >    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
> WARRANTIES
> >    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> >    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE
> FOUNDATION OR
> >    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> INCIDENTAL,
> >    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> (INCLUDING, BUT NOT
> >    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> SERVICES; LOSS OF
> >    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> HOWEVER CAUSED AND
> >    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> STRICT LIABILITY,
> >    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
> ANY WAY OUT
> >    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> POSSIBILITY OF
> >    * SUCH DAMAGE.
> >    *
> ====================================================================
> >    *
> >    * This software consists of voluntary contributions made by many
> >    * individuals on behalf of the Apache Software
> Foundation.  For more
> >    * information on the Apache Software Foundation, please see
> >    * <http://www.apache.org/>.
> >    */
> >
> >   import org.apache.avalon.framework.component.Component;
> >
> >   import com.opensymphony.workflow.Workflow;
> >   import com.opensymphony.workflow.WorkflowException;
> >
> >   /**
> >    * WorkflowService interface.
> >    *
> >    * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
> >    * @version $Id: WorkflowService.java,v 1.1 2003/09/26
> 15:05:03 epugh Exp $
> >    */
> >   public interface WorkflowService
> >       extends Component
> >   {
> >       /** Avalon role - used to id the component within the
> manager */
> >       String ROLE = WorkflowService.class.getName();
> >
> >       /** Retrives a workflow based on the caller */
> >       public Workflow retrieveWorkflow(String caller);
> >
> >       /** For a specific caller and status, return all the
> workflows. */
> >       public long[] retrieveWorkflows(String caller, String
> status) throws WorkflowException;
> >
> >       /** Retrieves a workflow instance */
> >      // public WorkflowInstance
> retrieveWorkflowInstance(Workflow workflow, long id);
> >
> >
> >
> >   }
> >
> >
> >
> >   1.1
> jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum
> /osworkflow/WorkflowInstance.java
> >
> >   Index: WorkflowInstance.java
> >
> ===================================================================
> >   package org.apache.fulcrum.osworkflow;
> >   /*
> ====================================================================
> >    * The Apache Software License, Version 1.1
> >    *
> >    * Copyright (c) 2001-2003 The Apache Software
> Foundation.  All rights
> >    * reserved.
> >    *
> >    * Redistribution and use in source and binary forms,
> with or without
> >    * modification, are permitted provided that the
> following conditions
> >    * are met:
> >    *
> >    * 1. Redistributions of source code must retain the
> above copyright
> >    *    notice, this list of conditions and the following
> disclaimer.
> >    *
> >    * 2. Redistributions in binary form must reproduce the
> above copyright
> >    *    notice, this list of conditions and the following
> disclaimer in
> >    *    the documentation and/or other materials provided with the
> >    *    distribution.
> >    *
> >    * 3. The end-user documentation included with the redistribution,
> >    *    if any, must include the following acknowledgment:
> >    *       "This product includes software developed by the
> >    *        Apache Software Foundation (http://www.apache.org/)."
> >    *    Alternately, this acknowledgment may appear in the
> software itself,
> >    *    if and wherever such third-party acknowledgments
> normally appear.
> >    *
> >    * 4. The names "Apache" and "Apache Software Foundation" and
> >    *    "Apache Turbine" must not be used to endorse or
> promote products
> >    *    derived from this software without prior written
> permission. For
> >    *    written permission, please contact apache@apache.org.
> >    *
> >    * 5. Products derived from this software may not be
> called "Apache",
> >    *    "Apache Turbine", nor may "Apache" appear in their
> name, without
> >    *    prior written permission of the Apache Software Foundation.
> >    *
> >    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED
> OR IMPLIED
> >    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
> WARRANTIES
> >    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> >    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE
> FOUNDATION OR
> >    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> INCIDENTAL,
> >    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> (INCLUDING, BUT NOT
> >    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> SERVICES; LOSS OF
> >    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> HOWEVER CAUSED AND
> >    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> STRICT LIABILITY,
> >    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
> ANY WAY OUT
> >    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> POSSIBILITY OF
> >    * SUCH DAMAGE.
> >    *
> ====================================================================
> >    *
> >    * This software consists of voluntary contributions made by many
> >    * individuals on behalf of the Apache Software
> Foundation.  For more
> >    * information on the Apache Software Foundation, please see
> >    * <http://www.apache.org/>.
> >    */
> >   import java.util.ArrayList;
> >   import java.util.Collections;
> >   import java.util.List;
> >   import java.util.Map;
> >   import com.opensymphony.module.propertyset.PropertySet;
> >   import com.opensymphony.workflow.InvalidInputException;
> >   import com.opensymphony.workflow.Workflow;
> >   import com.opensymphony.workflow.WorkflowException;
> >   import com.opensymphony.workflow.loader.ActionDescriptor;
> >   import com.opensymphony.workflow.loader.WorkflowDescriptor;
> >   import com.opensymphony.workflow.query.WorkflowQuery;
> >   /**
> >    * WorkflowInstance represents a specific instance of a
> workflow.  Therefore it has
> >    * all the context information like what state it is in,
> what it's actions are etc.
> >    *
> >    * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
> >    * @version $Id: WorkflowInstance.java,v 1.1 2003/09/26
> 15:05:03 epugh Exp $
> >    */
> >   public class WorkflowInstance
> >   {
> >       private Workflow workflow;
> >       private long id;
> >       /**
> >        * @return
> >        */
> >       public long getId()
> >       {
> >           return id;
> >       }
> >       private WorkflowInstance()
> >       {
> >           // can't use this version
> >       }
> >       public WorkflowInstance(Workflow workflow, long id)
> >       {
> >           this.workflow = workflow;
> >           this.id = id;
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public boolean canInitialize(String arg0, int arg1)
> throws WorkflowException
> >       {
> >           return workflow.canInitialize(arg0, arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public boolean canModifyEntryState(int arg1) throws
> WorkflowException
> >       {
> >           return workflow.canModifyEntryState(getId(), arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public void changeEntryState(int arg1) throws
> WorkflowException
> >       {
> >           workflow.changeEntryState(getId(), arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @param arg2
> >        * @throws com.opensymphony.workflow.InvalidInputException
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public void doAction(int arg1, Map arg2) throws
> InvalidInputException, WorkflowException
> >       {
> >           workflow.doAction(getId(), arg1, arg2);
> >       }
> >       /* (non-Javadoc)
> >        * @see java.lang.Object#equals(java.lang.Object)
> >        */
> >       public boolean equals(Object obj)
> >       {
> >           return workflow.equals(obj);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public void executeTriggerFunction(int arg1) throws
> WorkflowException
> >       {
> >           workflow.executeTriggerFunction(getId(), arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public int[] getAvailableActions(Map arg1) throws
> WorkflowException
> >       {
> >           return workflow.getAvailableActions(getId(), arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public List getCurrentSteps() throws WorkflowException
> >       {
> >           return workflow.getCurrentSteps(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public int getEntryState() throws WorkflowException
> >       {
> >           return workflow.getEntryState(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public List getHistorySteps() throws WorkflowException
> >       {
> >           return workflow.getHistorySteps(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public PropertySet getPropertySet() throws WorkflowException
> >       {
> >           return workflow.getPropertySet(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public List getSecurityPermissions() throws WorkflowException
> >       {
> >           return workflow.getSecurityPermissions(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public WorkflowDescriptor getWorkflowDescriptor()
> throws WorkflowException
> >       {
> >           return workflow.getWorkflowDescriptor(getWorkflowName());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public String getWorkflowName() throws WorkflowException
> >       {
> >           return workflow.getWorkflowName(getId());
> >       }
> >       /* (non-Javadoc)
> >        * @see java.lang.Object#hashCode()
> >        */
> >       public int hashCode()
> >       {
> >           return workflow.hashCode();
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public List query(WorkflowQuery arg0) throws WorkflowException
> >       {
> >           return workflow.query(arg0);
> >       }
> >       /* (non-Javadoc)
> >        * @see java.lang.Object#toString()
> >        */
> >       public String toString()
> >       {
> >           return workflow.toString();
> >       }
> >       /**
> >       * @param arg0
> >       * @return
> >       * @throws com.opensymphony.workflow.WorkflowException
> >       */
> >       public List getAllAvailableActions() throws WorkflowException
> >       {
> >           List actions = new ArrayList();
> >           int actionIds[] =
> workflow.getAvailableActions(getId(), Collections.EMPTY_MAP);
> >           for (int i = 0; i < actionIds.length; i++)
> >           {
> >               ActionDescriptor action =
> getWorkflowDescriptor().getAction(actionIds[i]);
> >               actions.add(action);
> >           }
> >           return actions;
> >       }
> >   }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


RE: cvs commit: jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow WorkflowService.java WorkflowInstance.java DefaultWorkflowService.java

Posted by Eric Pugh <ep...@upstate.com>.
I will go back and put something better in..  I appreciate the nudge.  Also,
i am going to try and tweak eclipse to do better formatting.  I wish that
there was a simple way to configure eclipse to perform formats according to
the turbine rules.

I live in fear of accidentally hitting control f and reformatting all the
source and then having to reapply all my changes to the source!

Eric

> -----Original Message-----
> From: Daniel L. Rall [mailto:dlr@finemaltcoding.com]
> Sent: Friday, September 26, 2003 10:18 PM
> To: Turbine Developers List
> Subject: Re: cvs commit:
> jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum
> /osworkflo
> w WorkflowService.java WorkflowInstance.java
> DefaultWorkflowService.java
>
>
> A lot of the methods in WorkflowService appear to have only
> IDE-generated JavaDoc.
>
>
> epugh@apache.org wrote:
> > epugh       2003/09/26 08:05:03
> >
> >   Added:       osworkflow/src/java/org/apache/fulcrum/osworkflow
> >                         WorkflowService.java WorkflowInstance.java
> >                         DefaultWorkflowService.java
> >   Log:
> >   Adding updated classes with fixed package names..
> >
> >   Revision  Changes    Path
> >   1.1
> jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum
> /osworkflow/WorkflowService.java
> >
> >   Index: WorkflowService.java
> >
> ===================================================================
> >   package org.apache.fulcrum.osworkflow;
> >
> >   /*
> ====================================================================
> >    * The Apache Software License, Version 1.1
> >    *
> >    * Copyright (c) 2001-2003 The Apache Software
> Foundation.  All rights
> >    * reserved.
> >    *
> >    * Redistribution and use in source and binary forms,
> with or without
> >    * modification, are permitted provided that the
> following conditions
> >    * are met:
> >    *
> >    * 1. Redistributions of source code must retain the
> above copyright
> >    *    notice, this list of conditions and the following
> disclaimer.
> >    *
> >    * 2. Redistributions in binary form must reproduce the
> above copyright
> >    *    notice, this list of conditions and the following
> disclaimer in
> >    *    the documentation and/or other materials provided with the
> >    *    distribution.
> >    *
> >    * 3. The end-user documentation included with the redistribution,
> >    *    if any, must include the following acknowledgment:
> >    *       "This product includes software developed by the
> >    *        Apache Software Foundation (http://www.apache.org/)."
> >    *    Alternately, this acknowledgment may appear in the
> software itself,
> >    *    if and wherever such third-party acknowledgments
> normally appear.
> >    *
> >    * 4. The names "Apache" and "Apache Software Foundation" and
> >    *    "Apache Turbine" must not be used to endorse or
> promote products
> >    *    derived from this software without prior written
> permission. For
> >    *    written permission, please contact apache@apache.org.
> >    *
> >    * 5. Products derived from this software may not be
> called "Apache",
> >    *    "Apache Turbine", nor may "Apache" appear in their
> name, without
> >    *    prior written permission of the Apache Software Foundation.
> >    *
> >    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED
> OR IMPLIED
> >    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
> WARRANTIES
> >    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> >    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE
> FOUNDATION OR
> >    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> INCIDENTAL,
> >    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> (INCLUDING, BUT NOT
> >    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> SERVICES; LOSS OF
> >    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> HOWEVER CAUSED AND
> >    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> STRICT LIABILITY,
> >    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
> ANY WAY OUT
> >    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> POSSIBILITY OF
> >    * SUCH DAMAGE.
> >    *
> ====================================================================
> >    *
> >    * This software consists of voluntary contributions made by many
> >    * individuals on behalf of the Apache Software
> Foundation.  For more
> >    * information on the Apache Software Foundation, please see
> >    * <http://www.apache.org/>.
> >    */
> >
> >   import org.apache.avalon.framework.component.Component;
> >
> >   import com.opensymphony.workflow.Workflow;
> >   import com.opensymphony.workflow.WorkflowException;
> >
> >   /**
> >    * WorkflowService interface.
> >    *
> >    * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
> >    * @version $Id: WorkflowService.java,v 1.1 2003/09/26
> 15:05:03 epugh Exp $
> >    */
> >   public interface WorkflowService
> >       extends Component
> >   {
> >       /** Avalon role - used to id the component within the
> manager */
> >       String ROLE = WorkflowService.class.getName();
> >
> >       /** Retrives a workflow based on the caller */
> >       public Workflow retrieveWorkflow(String caller);
> >
> >       /** For a specific caller and status, return all the
> workflows. */
> >       public long[] retrieveWorkflows(String caller, String
> status) throws WorkflowException;
> >
> >       /** Retrieves a workflow instance */
> >      // public WorkflowInstance
> retrieveWorkflowInstance(Workflow workflow, long id);
> >
> >
> >
> >   }
> >
> >
> >
> >   1.1
> jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum
> /osworkflow/WorkflowInstance.java
> >
> >   Index: WorkflowInstance.java
> >
> ===================================================================
> >   package org.apache.fulcrum.osworkflow;
> >   /*
> ====================================================================
> >    * The Apache Software License, Version 1.1
> >    *
> >    * Copyright (c) 2001-2003 The Apache Software
> Foundation.  All rights
> >    * reserved.
> >    *
> >    * Redistribution and use in source and binary forms,
> with or without
> >    * modification, are permitted provided that the
> following conditions
> >    * are met:
> >    *
> >    * 1. Redistributions of source code must retain the
> above copyright
> >    *    notice, this list of conditions and the following
> disclaimer.
> >    *
> >    * 2. Redistributions in binary form must reproduce the
> above copyright
> >    *    notice, this list of conditions and the following
> disclaimer in
> >    *    the documentation and/or other materials provided with the
> >    *    distribution.
> >    *
> >    * 3. The end-user documentation included with the redistribution,
> >    *    if any, must include the following acknowledgment:
> >    *       "This product includes software developed by the
> >    *        Apache Software Foundation (http://www.apache.org/)."
> >    *    Alternately, this acknowledgment may appear in the
> software itself,
> >    *    if and wherever such third-party acknowledgments
> normally appear.
> >    *
> >    * 4. The names "Apache" and "Apache Software Foundation" and
> >    *    "Apache Turbine" must not be used to endorse or
> promote products
> >    *    derived from this software without prior written
> permission. For
> >    *    written permission, please contact apache@apache.org.
> >    *
> >    * 5. Products derived from this software may not be
> called "Apache",
> >    *    "Apache Turbine", nor may "Apache" appear in their
> name, without
> >    *    prior written permission of the Apache Software Foundation.
> >    *
> >    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED
> OR IMPLIED
> >    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
> WARRANTIES
> >    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> >    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE
> FOUNDATION OR
> >    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> INCIDENTAL,
> >    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> (INCLUDING, BUT NOT
> >    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> SERVICES; LOSS OF
> >    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> HOWEVER CAUSED AND
> >    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> STRICT LIABILITY,
> >    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
> ANY WAY OUT
> >    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> POSSIBILITY OF
> >    * SUCH DAMAGE.
> >    *
> ====================================================================
> >    *
> >    * This software consists of voluntary contributions made by many
> >    * individuals on behalf of the Apache Software
> Foundation.  For more
> >    * information on the Apache Software Foundation, please see
> >    * <http://www.apache.org/>.
> >    */
> >   import java.util.ArrayList;
> >   import java.util.Collections;
> >   import java.util.List;
> >   import java.util.Map;
> >   import com.opensymphony.module.propertyset.PropertySet;
> >   import com.opensymphony.workflow.InvalidInputException;
> >   import com.opensymphony.workflow.Workflow;
> >   import com.opensymphony.workflow.WorkflowException;
> >   import com.opensymphony.workflow.loader.ActionDescriptor;
> >   import com.opensymphony.workflow.loader.WorkflowDescriptor;
> >   import com.opensymphony.workflow.query.WorkflowQuery;
> >   /**
> >    * WorkflowInstance represents a specific instance of a
> workflow.  Therefore it has
> >    * all the context information like what state it is in,
> what it's actions are etc.
> >    *
> >    * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
> >    * @version $Id: WorkflowInstance.java,v 1.1 2003/09/26
> 15:05:03 epugh Exp $
> >    */
> >   public class WorkflowInstance
> >   {
> >       private Workflow workflow;
> >       private long id;
> >       /**
> >        * @return
> >        */
> >       public long getId()
> >       {
> >           return id;
> >       }
> >       private WorkflowInstance()
> >       {
> >           // can't use this version
> >       }
> >       public WorkflowInstance(Workflow workflow, long id)
> >       {
> >           this.workflow = workflow;
> >           this.id = id;
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public boolean canInitialize(String arg0, int arg1)
> throws WorkflowException
> >       {
> >           return workflow.canInitialize(arg0, arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public boolean canModifyEntryState(int arg1) throws
> WorkflowException
> >       {
> >           return workflow.canModifyEntryState(getId(), arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public void changeEntryState(int arg1) throws
> WorkflowException
> >       {
> >           workflow.changeEntryState(getId(), arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @param arg2
> >        * @throws com.opensymphony.workflow.InvalidInputException
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public void doAction(int arg1, Map arg2) throws
> InvalidInputException, WorkflowException
> >       {
> >           workflow.doAction(getId(), arg1, arg2);
> >       }
> >       /* (non-Javadoc)
> >        * @see java.lang.Object#equals(java.lang.Object)
> >        */
> >       public boolean equals(Object obj)
> >       {
> >           return workflow.equals(obj);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public void executeTriggerFunction(int arg1) throws
> WorkflowException
> >       {
> >           workflow.executeTriggerFunction(getId(), arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @param arg1
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public int[] getAvailableActions(Map arg1) throws
> WorkflowException
> >       {
> >           return workflow.getAvailableActions(getId(), arg1);
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public List getCurrentSteps() throws WorkflowException
> >       {
> >           return workflow.getCurrentSteps(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public int getEntryState() throws WorkflowException
> >       {
> >           return workflow.getEntryState(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public List getHistorySteps() throws WorkflowException
> >       {
> >           return workflow.getHistorySteps(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public PropertySet getPropertySet() throws WorkflowException
> >       {
> >           return workflow.getPropertySet(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public List getSecurityPermissions() throws WorkflowException
> >       {
> >           return workflow.getSecurityPermissions(getId());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public WorkflowDescriptor getWorkflowDescriptor()
> throws WorkflowException
> >       {
> >           return workflow.getWorkflowDescriptor(getWorkflowName());
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public String getWorkflowName() throws WorkflowException
> >       {
> >           return workflow.getWorkflowName(getId());
> >       }
> >       /* (non-Javadoc)
> >        * @see java.lang.Object#hashCode()
> >        */
> >       public int hashCode()
> >       {
> >           return workflow.hashCode();
> >       }
> >       /**
> >        * @param arg0
> >        * @return
> >        * @throws com.opensymphony.workflow.WorkflowException
> >        */
> >       public List query(WorkflowQuery arg0) throws WorkflowException
> >       {
> >           return workflow.query(arg0);
> >       }
> >       /* (non-Javadoc)
> >        * @see java.lang.Object#toString()
> >        */
> >       public String toString()
> >       {
> >           return workflow.toString();
> >       }
> >       /**
> >       * @param arg0
> >       * @return
> >       * @throws com.opensymphony.workflow.WorkflowException
> >       */
> >       public List getAllAvailableActions() throws WorkflowException
> >       {
> >           List actions = new ArrayList();
> >           int actionIds[] =
> workflow.getAvailableActions(getId(), Collections.EMPTY_MAP);
> >           for (int i = 0; i < actionIds.length; i++)
> >           {
> >               ActionDescriptor action =
> getWorkflowDescriptor().getAction(actionIds[i]);
> >               actions.add(action);
> >           }
> >           return actions;
> >       }
> >   }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow WorkflowService.java WorkflowInstance.java DefaultWorkflowService.java

Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
A lot of the methods in WorkflowService appear to have only IDE-generated JavaDoc.


epugh@apache.org wrote:
> epugh       2003/09/26 08:05:03
> 
>   Added:       osworkflow/src/java/org/apache/fulcrum/osworkflow
>                         WorkflowService.java WorkflowInstance.java
>                         DefaultWorkflowService.java
>   Log:
>   Adding updated classes with fixed package names..
>   
>   Revision  Changes    Path
>   1.1                  jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow/WorkflowService.java
>   
>   Index: WorkflowService.java
>   ===================================================================
>   package org.apache.fulcrum.osworkflow;
>   
>   /* ====================================================================
>    * The Apache Software License, Version 1.1
>    *
>    * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
>    * reserved.
>    *
>    * Redistribution and use in source and binary forms, with or without
>    * modification, are permitted provided that the following conditions
>    * are met:
>    *
>    * 1. Redistributions of source code must retain the above copyright
>    *    notice, this list of conditions and the following disclaimer.
>    *
>    * 2. Redistributions in binary form must reproduce the above copyright
>    *    notice, this list of conditions and the following disclaimer in
>    *    the documentation and/or other materials provided with the
>    *    distribution.
>    *
>    * 3. The end-user documentation included with the redistribution,
>    *    if any, must include the following acknowledgment:
>    *       "This product includes software developed by the
>    *        Apache Software Foundation (http://www.apache.org/)."
>    *    Alternately, this acknowledgment may appear in the software itself,
>    *    if and wherever such third-party acknowledgments normally appear.
>    *
>    * 4. The names "Apache" and "Apache Software Foundation" and
>    *    "Apache Turbine" must not be used to endorse or promote products
>    *    derived from this software without prior written permission. For
>    *    written permission, please contact apache@apache.org.
>    *
>    * 5. Products derived from this software may not be called "Apache",
>    *    "Apache Turbine", nor may "Apache" appear in their name, without
>    *    prior written permission of the Apache Software Foundation.
>    *
>    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
>    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
>    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
>    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>    * SUCH DAMAGE.
>    * ====================================================================
>    *
>    * This software consists of voluntary contributions made by many
>    * individuals on behalf of the Apache Software Foundation.  For more
>    * information on the Apache Software Foundation, please see
>    * <http://www.apache.org/>.
>    */
>   
>   import org.apache.avalon.framework.component.Component;
>   
>   import com.opensymphony.workflow.Workflow;
>   import com.opensymphony.workflow.WorkflowException;
>   
>   /**
>    * WorkflowService interface.
>    *
>    * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
>    * @version $Id: WorkflowService.java,v 1.1 2003/09/26 15:05:03 epugh Exp $
>    */
>   public interface WorkflowService
>       extends Component
>   {
>       /** Avalon role - used to id the component within the manager */
>       String ROLE = WorkflowService.class.getName();
>   
>       /** Retrives a workflow based on the caller */
>       public Workflow retrieveWorkflow(String caller);
>       
>       /** For a specific caller and status, return all the workflows. */
>       public long[] retrieveWorkflows(String caller, String status) throws WorkflowException;
>       
>       /** Retrieves a workflow instance */
>      // public WorkflowInstance retrieveWorkflowInstance(Workflow workflow, long id);
>       
>   
>   
>   }
>   
>   
>   
>   1.1                  jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow/WorkflowInstance.java
>   
>   Index: WorkflowInstance.java
>   ===================================================================
>   package org.apache.fulcrum.osworkflow;
>   /* ====================================================================
>    * The Apache Software License, Version 1.1
>    *
>    * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
>    * reserved.
>    *
>    * Redistribution and use in source and binary forms, with or without
>    * modification, are permitted provided that the following conditions
>    * are met:
>    *
>    * 1. Redistributions of source code must retain the above copyright
>    *    notice, this list of conditions and the following disclaimer.
>    *
>    * 2. Redistributions in binary form must reproduce the above copyright
>    *    notice, this list of conditions and the following disclaimer in
>    *    the documentation and/or other materials provided with the
>    *    distribution.
>    *
>    * 3. The end-user documentation included with the redistribution,
>    *    if any, must include the following acknowledgment:
>    *       "This product includes software developed by the
>    *        Apache Software Foundation (http://www.apache.org/)."
>    *    Alternately, this acknowledgment may appear in the software itself,
>    *    if and wherever such third-party acknowledgments normally appear.
>    *
>    * 4. The names "Apache" and "Apache Software Foundation" and
>    *    "Apache Turbine" must not be used to endorse or promote products
>    *    derived from this software without prior written permission. For
>    *    written permission, please contact apache@apache.org.
>    *
>    * 5. Products derived from this software may not be called "Apache",
>    *    "Apache Turbine", nor may "Apache" appear in their name, without
>    *    prior written permission of the Apache Software Foundation.
>    *
>    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
>    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
>    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
>    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>    * SUCH DAMAGE.
>    * ====================================================================
>    *
>    * This software consists of voluntary contributions made by many
>    * individuals on behalf of the Apache Software Foundation.  For more
>    * information on the Apache Software Foundation, please see
>    * <http://www.apache.org/>.
>    */
>   import java.util.ArrayList;
>   import java.util.Collections;
>   import java.util.List;
>   import java.util.Map;
>   import com.opensymphony.module.propertyset.PropertySet;
>   import com.opensymphony.workflow.InvalidInputException;
>   import com.opensymphony.workflow.Workflow;
>   import com.opensymphony.workflow.WorkflowException;
>   import com.opensymphony.workflow.loader.ActionDescriptor;
>   import com.opensymphony.workflow.loader.WorkflowDescriptor;
>   import com.opensymphony.workflow.query.WorkflowQuery;
>   /**
>    * WorkflowInstance represents a specific instance of a workflow.  Therefore it has
>    * all the context information like what state it is in, what it's actions are etc.
>    *
>    * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
>    * @version $Id: WorkflowInstance.java,v 1.1 2003/09/26 15:05:03 epugh Exp $
>    */
>   public class WorkflowInstance
>   {
>       private Workflow workflow;
>       private long id;
>       /**
>        * @return
>        */
>       public long getId()
>       {
>           return id;
>       }
>       private WorkflowInstance()
>       {
>           // can't use this version
>       }
>       public WorkflowInstance(Workflow workflow, long id)
>       {
>           this.workflow = workflow;
>           this.id = id;
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public boolean canInitialize(String arg0, int arg1) throws WorkflowException
>       {
>           return workflow.canInitialize(arg0, arg1);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public boolean canModifyEntryState(int arg1) throws WorkflowException
>       {
>           return workflow.canModifyEntryState(getId(), arg1);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public void changeEntryState(int arg1) throws WorkflowException
>       {
>           workflow.changeEntryState(getId(), arg1);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @param arg2
>        * @throws com.opensymphony.workflow.InvalidInputException
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public void doAction(int arg1, Map arg2) throws InvalidInputException, WorkflowException
>       {
>           workflow.doAction(getId(), arg1, arg2);
>       }
>       /* (non-Javadoc)
>        * @see java.lang.Object#equals(java.lang.Object)
>        */
>       public boolean equals(Object obj)
>       {
>           return workflow.equals(obj);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public void executeTriggerFunction(int arg1) throws WorkflowException
>       {
>           workflow.executeTriggerFunction(getId(), arg1);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public int[] getAvailableActions(Map arg1) throws WorkflowException
>       {
>           return workflow.getAvailableActions(getId(), arg1);
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public List getCurrentSteps() throws WorkflowException
>       {
>           return workflow.getCurrentSteps(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public int getEntryState() throws WorkflowException
>       {
>           return workflow.getEntryState(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public List getHistorySteps() throws WorkflowException
>       {
>           return workflow.getHistorySteps(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public PropertySet getPropertySet() throws WorkflowException
>       {
>           return workflow.getPropertySet(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public List getSecurityPermissions() throws WorkflowException
>       {
>           return workflow.getSecurityPermissions(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public WorkflowDescriptor getWorkflowDescriptor() throws WorkflowException
>       {
>           return workflow.getWorkflowDescriptor(getWorkflowName());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public String getWorkflowName() throws WorkflowException
>       {
>           return workflow.getWorkflowName(getId());
>       }
>       /* (non-Javadoc)
>        * @see java.lang.Object#hashCode()
>        */
>       public int hashCode()
>       {
>           return workflow.hashCode();
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public List query(WorkflowQuery arg0) throws WorkflowException
>       {
>           return workflow.query(arg0);
>       }
>       /* (non-Javadoc)
>        * @see java.lang.Object#toString()
>        */
>       public String toString()
>       {
>           return workflow.toString();
>       }
>       /**
>       * @param arg0
>       * @return
>       * @throws com.opensymphony.workflow.WorkflowException
>       */
>       public List getAllAvailableActions() throws WorkflowException
>       {
>           List actions = new ArrayList();
>           int actionIds[] = workflow.getAvailableActions(getId(), Collections.EMPTY_MAP);
>           for (int i = 0; i < actionIds.length; i++)
>           {
>               ActionDescriptor action = getWorkflowDescriptor().getAction(actionIds[i]);
>               actions.add(action);
>           }
>           return actions;
>       }
>   }



Re: cvs commit: jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow WorkflowService.java WorkflowInstance.java DefaultWorkflowService.java

Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
A lot of the methods in WorkflowService appear to have only IDE-generated JavaDoc.


epugh@apache.org wrote:
> epugh       2003/09/26 08:05:03
> 
>   Added:       osworkflow/src/java/org/apache/fulcrum/osworkflow
>                         WorkflowService.java WorkflowInstance.java
>                         DefaultWorkflowService.java
>   Log:
>   Adding updated classes with fixed package names..
>   
>   Revision  Changes    Path
>   1.1                  jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow/WorkflowService.java
>   
>   Index: WorkflowService.java
>   ===================================================================
>   package org.apache.fulcrum.osworkflow;
>   
>   /* ====================================================================
>    * The Apache Software License, Version 1.1
>    *
>    * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
>    * reserved.
>    *
>    * Redistribution and use in source and binary forms, with or without
>    * modification, are permitted provided that the following conditions
>    * are met:
>    *
>    * 1. Redistributions of source code must retain the above copyright
>    *    notice, this list of conditions and the following disclaimer.
>    *
>    * 2. Redistributions in binary form must reproduce the above copyright
>    *    notice, this list of conditions and the following disclaimer in
>    *    the documentation and/or other materials provided with the
>    *    distribution.
>    *
>    * 3. The end-user documentation included with the redistribution,
>    *    if any, must include the following acknowledgment:
>    *       "This product includes software developed by the
>    *        Apache Software Foundation (http://www.apache.org/)."
>    *    Alternately, this acknowledgment may appear in the software itself,
>    *    if and wherever such third-party acknowledgments normally appear.
>    *
>    * 4. The names "Apache" and "Apache Software Foundation" and
>    *    "Apache Turbine" must not be used to endorse or promote products
>    *    derived from this software without prior written permission. For
>    *    written permission, please contact apache@apache.org.
>    *
>    * 5. Products derived from this software may not be called "Apache",
>    *    "Apache Turbine", nor may "Apache" appear in their name, without
>    *    prior written permission of the Apache Software Foundation.
>    *
>    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
>    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
>    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
>    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>    * SUCH DAMAGE.
>    * ====================================================================
>    *
>    * This software consists of voluntary contributions made by many
>    * individuals on behalf of the Apache Software Foundation.  For more
>    * information on the Apache Software Foundation, please see
>    * <http://www.apache.org/>.
>    */
>   
>   import org.apache.avalon.framework.component.Component;
>   
>   import com.opensymphony.workflow.Workflow;
>   import com.opensymphony.workflow.WorkflowException;
>   
>   /**
>    * WorkflowService interface.
>    *
>    * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
>    * @version $Id: WorkflowService.java,v 1.1 2003/09/26 15:05:03 epugh Exp $
>    */
>   public interface WorkflowService
>       extends Component
>   {
>       /** Avalon role - used to id the component within the manager */
>       String ROLE = WorkflowService.class.getName();
>   
>       /** Retrives a workflow based on the caller */
>       public Workflow retrieveWorkflow(String caller);
>       
>       /** For a specific caller and status, return all the workflows. */
>       public long[] retrieveWorkflows(String caller, String status) throws WorkflowException;
>       
>       /** Retrieves a workflow instance */
>      // public WorkflowInstance retrieveWorkflowInstance(Workflow workflow, long id);
>       
>   
>   
>   }
>   
>   
>   
>   1.1                  jakarta-turbine-fulcrum/osworkflow/src/java/org/apache/fulcrum/osworkflow/WorkflowInstance.java
>   
>   Index: WorkflowInstance.java
>   ===================================================================
>   package org.apache.fulcrum.osworkflow;
>   /* ====================================================================
>    * The Apache Software License, Version 1.1
>    *
>    * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
>    * reserved.
>    *
>    * Redistribution and use in source and binary forms, with or without
>    * modification, are permitted provided that the following conditions
>    * are met:
>    *
>    * 1. Redistributions of source code must retain the above copyright
>    *    notice, this list of conditions and the following disclaimer.
>    *
>    * 2. Redistributions in binary form must reproduce the above copyright
>    *    notice, this list of conditions and the following disclaimer in
>    *    the documentation and/or other materials provided with the
>    *    distribution.
>    *
>    * 3. The end-user documentation included with the redistribution,
>    *    if any, must include the following acknowledgment:
>    *       "This product includes software developed by the
>    *        Apache Software Foundation (http://www.apache.org/)."
>    *    Alternately, this acknowledgment may appear in the software itself,
>    *    if and wherever such third-party acknowledgments normally appear.
>    *
>    * 4. The names "Apache" and "Apache Software Foundation" and
>    *    "Apache Turbine" must not be used to endorse or promote products
>    *    derived from this software without prior written permission. For
>    *    written permission, please contact apache@apache.org.
>    *
>    * 5. Products derived from this software may not be called "Apache",
>    *    "Apache Turbine", nor may "Apache" appear in their name, without
>    *    prior written permission of the Apache Software Foundation.
>    *
>    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
>    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
>    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
>    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>    * SUCH DAMAGE.
>    * ====================================================================
>    *
>    * This software consists of voluntary contributions made by many
>    * individuals on behalf of the Apache Software Foundation.  For more
>    * information on the Apache Software Foundation, please see
>    * <http://www.apache.org/>.
>    */
>   import java.util.ArrayList;
>   import java.util.Collections;
>   import java.util.List;
>   import java.util.Map;
>   import com.opensymphony.module.propertyset.PropertySet;
>   import com.opensymphony.workflow.InvalidInputException;
>   import com.opensymphony.workflow.Workflow;
>   import com.opensymphony.workflow.WorkflowException;
>   import com.opensymphony.workflow.loader.ActionDescriptor;
>   import com.opensymphony.workflow.loader.WorkflowDescriptor;
>   import com.opensymphony.workflow.query.WorkflowQuery;
>   /**
>    * WorkflowInstance represents a specific instance of a workflow.  Therefore it has
>    * all the context information like what state it is in, what it's actions are etc.
>    *
>    * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
>    * @version $Id: WorkflowInstance.java,v 1.1 2003/09/26 15:05:03 epugh Exp $
>    */
>   public class WorkflowInstance
>   {
>       private Workflow workflow;
>       private long id;
>       /**
>        * @return
>        */
>       public long getId()
>       {
>           return id;
>       }
>       private WorkflowInstance()
>       {
>           // can't use this version
>       }
>       public WorkflowInstance(Workflow workflow, long id)
>       {
>           this.workflow = workflow;
>           this.id = id;
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public boolean canInitialize(String arg0, int arg1) throws WorkflowException
>       {
>           return workflow.canInitialize(arg0, arg1);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public boolean canModifyEntryState(int arg1) throws WorkflowException
>       {
>           return workflow.canModifyEntryState(getId(), arg1);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public void changeEntryState(int arg1) throws WorkflowException
>       {
>           workflow.changeEntryState(getId(), arg1);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @param arg2
>        * @throws com.opensymphony.workflow.InvalidInputException
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public void doAction(int arg1, Map arg2) throws InvalidInputException, WorkflowException
>       {
>           workflow.doAction(getId(), arg1, arg2);
>       }
>       /* (non-Javadoc)
>        * @see java.lang.Object#equals(java.lang.Object)
>        */
>       public boolean equals(Object obj)
>       {
>           return workflow.equals(obj);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public void executeTriggerFunction(int arg1) throws WorkflowException
>       {
>           workflow.executeTriggerFunction(getId(), arg1);
>       }
>       /**
>        * @param arg0
>        * @param arg1
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public int[] getAvailableActions(Map arg1) throws WorkflowException
>       {
>           return workflow.getAvailableActions(getId(), arg1);
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public List getCurrentSteps() throws WorkflowException
>       {
>           return workflow.getCurrentSteps(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public int getEntryState() throws WorkflowException
>       {
>           return workflow.getEntryState(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public List getHistorySteps() throws WorkflowException
>       {
>           return workflow.getHistorySteps(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public PropertySet getPropertySet() throws WorkflowException
>       {
>           return workflow.getPropertySet(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public List getSecurityPermissions() throws WorkflowException
>       {
>           return workflow.getSecurityPermissions(getId());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public WorkflowDescriptor getWorkflowDescriptor() throws WorkflowException
>       {
>           return workflow.getWorkflowDescriptor(getWorkflowName());
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public String getWorkflowName() throws WorkflowException
>       {
>           return workflow.getWorkflowName(getId());
>       }
>       /* (non-Javadoc)
>        * @see java.lang.Object#hashCode()
>        */
>       public int hashCode()
>       {
>           return workflow.hashCode();
>       }
>       /**
>        * @param arg0
>        * @return
>        * @throws com.opensymphony.workflow.WorkflowException
>        */
>       public List query(WorkflowQuery arg0) throws WorkflowException
>       {
>           return workflow.query(arg0);
>       }
>       /* (non-Javadoc)
>        * @see java.lang.Object#toString()
>        */
>       public String toString()
>       {
>           return workflow.toString();
>       }
>       /**
>       * @param arg0
>       * @return
>       * @throws com.opensymphony.workflow.WorkflowException
>       */
>       public List getAllAvailableActions() throws WorkflowException
>       {
>           List actions = new ArrayList();
>           int actionIds[] = workflow.getAvailableActions(getId(), Collections.EMPTY_MAP);
>           for (int i = 0; i < actionIds.length; i++)
>           {
>               ActionDescriptor action = getWorkflowDescriptor().getAction(actionIds[i]);
>               actions.add(action);
>           }
>           return actions;
>       }
>   }



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org