Update of /cvsroot/metamorphosis/krysalis-sandbox/workflow/src/java/org/krysalis/workflow
In directory sc8-pr-cvs1:/tmp/cvs-serv29172/src/java/org/krysalis/workflow
Modified Files:
WorkFlow.java WorkFlowAction.java WorkFlowCondition.java
WorkFlowManager.java WorkFlowStore.java
Added Files:
DefaultWorkFlowState.java WorkFlowMapper.java
Log Message:
Finished concept of the workflow manager.
--- NEW FILE: DefaultWorkFlowState.java ---
/*****************************************************************************
* Copyright (C) The Krysalis project. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Krysalis Patchy *
* Software License version 1.1_01, a copy of which has been included *
* at the bottom of this file. *
*****************************************************************************/
package org.krysalis.workflow;
import java.util.HashMap;
import java.util.Map;
/**
* Reference implementation of a state.
*
* @author <a href="mailto:[email protected]">Stephan Michels</a>
*/
public class DefaultWorkFlowState implements WorkFlowState {
private String resource;
private String state;
private HashMap attributes;
public DefaultWorkFlowState(String resource)
{
this.resource = resource;
}
public DefaultWorkFlowState(String resource, String state)
{
this.resource = resource;
this.state = state;
}
public String getResource()
{
return resource;
}
public void setState(String state)
{
this.state = state;
}
public String getState()
{
return state;
}
public void setAttribute(String name, Object value)
{
attributes.put(name, value);
}
public Object getAttribute(String name)
{
return attributes.get(name);
}
public Map getAttributes()
{
return attributes;
}
}
/*
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2002 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
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 for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Metamorphosis" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Metamorphosis", nor may "Krysalis" appear in their name,
without prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in
respect of this licence.
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 KRYSALIS PROJECT 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.
====================================================================*/
--- NEW FILE: WorkFlowMapper.java ---
/*****************************************************************************
* Copyright (C) The Krysalis project. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Krysalis Patchy *
* Software License version 1.1_01, a copy of which has been included *
* at the bottom of this file. *
*****************************************************************************/
package org.krysalis.workflow;
import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.thread.ThreadSafe;
public interface WorkFlowMapper extends Component, ThreadSafe
{
public final static String ROLE = WorkFlowMapper.class.getName();
public String getWorkFlow(String resource);
public String getWorkFlowStore(String resource);
}
Index: WorkFlow.java
===================================================================
RCS file: /cvsroot/metamorphosis/krysalis-sandbox/workflow/src/java/org/krysalis/workflow/WorkFlow.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WorkFlow.java 12 Mar 2003 13:32:42 -0000 1.1
--- WorkFlow.java 14 Mar 2003 09:17:27 -0000 1.2
***************
*** 21,24 ****
--- 21,26 ----
public interface WorkFlow extends Component, ThreadSafe {
+ public final static String ROLE = WorkFlow.class.getName();
+
WorkFlowState process(WorkFlowState state, WorkFlowEvent event);
}
Index: WorkFlowAction.java
===================================================================
RCS file: /cvsroot/metamorphosis/krysalis-sandbox/workflow/src/java/org/krysalis/workflow/WorkFlowAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WorkFlowAction.java 12 Mar 2003 13:32:42 -0000 1.1
--- WorkFlowAction.java 14 Mar 2003 09:17:27 -0000 1.2
***************
*** 21,24 ****
--- 21,26 ----
public interface WorkFlowAction extends Component, ThreadSafe {
+ public final static String ROLE = WorkFlowAction.class.getName();
+
/**
* Execute the action.
Index: WorkFlowCondition.java
===================================================================
RCS file: /cvsroot/metamorphosis/krysalis-sandbox/workflow/src/java/org/krysalis/workflow/WorkFlowCondition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WorkFlowCondition.java 12 Mar 2003 13:32:42 -0000 1.1
--- WorkFlowCondition.java 14 Mar 2003 09:17:27 -0000 1.2
***************
*** 21,24 ****
--- 21,26 ----
public interface WorkFlowCondition extends Component, ThreadSafe {
+ public final static String ROLE = WorkFlowAction.class.getName();
+
/**
* Test this condition.
Index: WorkFlowManager.java
===================================================================
RCS file: /cvsroot/metamorphosis/krysalis-sandbox/workflow/src/java/org/krysalis/workflow/WorkFlowManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** WorkFlowManager.java 12 Mar 2003 13:32:42 -0000 1.3
--- WorkFlowManager.java 14 Mar 2003 09:17:27 -0000 1.4
***************
*** 21,24 ****
--- 21,26 ----
public interface WorkFlowManager extends Component, ThreadSafe {
+ public final static String ROLE = WorkFlowManager.class.getName();
+
void process(String resource, WorkFlowEvent event);
Index: WorkFlowStore.java
===================================================================
RCS file: /cvsroot/metamorphosis/krysalis-sandbox/workflow/src/java/org/krysalis/workflow/WorkFlowStore.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WorkFlowStore.java 12 Mar 2003 13:32:42 -0000 1.1
--- WorkFlowStore.java 14 Mar 2003 09:17:27 -0000 1.2
***************
*** 20,23 ****
--- 20,25 ----
public interface WorkFlowStore extends Component, ThreadSafe {
+ public final static String ROLE = WorkFlowStore.class.getName();
+
WorkFlowState lookup(String resource);
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.