001: /*
002: * $Id: WfResource.java,v 1.1 2003/08/17 09:29:33 ajzeneski Exp $
003: *
004: * Copyright (c) 2001, 2002 The Open For Business Project - www.ofbiz.org
005: *
006: * Permission is hereby granted, free of charge, to any person obtaining a
007: * copy of this software and associated documentation files (the "Software"),
008: * to deal in the Software without restriction, including without limitation
009: * the rights to use, copy, modify, merge, publish, distribute, sublicense,
010: * and/or sell copies of the Software, and to permit persons to whom the
011: * Software is furnished to do so, subject to the following conditions:
012: *
013: * The above copyright notice and this permission notice shall be included
014: * in all copies or substantial portions of the Software.
015: *
016: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
017: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
018: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
019: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
020: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
021: * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
022: * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
023: *
024: */
025: package org.ofbiz.workflow;
026:
027: import java.util.Iterator;
028: import java.util.List;
029:
030: /**
031: * WfResource - Workflow Resource Interface
032: *
033: * @author <a href="mailto:jaz@ofbiz.org">Andy Zeneski</a>
034: * @version $Revision: 1.1 $
035: * @since 2.0
036: */
037: public interface WfResource {
038:
039: /**
040: * Gets the number of work items
041: * @throws WfException
042: * @return Count of work items
043: */
044: public int howManyWorkItem() throws WfException;
045:
046: /**
047: * Gets an iterator of work items
048: * @throws WfException
049: * @return Iterator of work items
050: */
051: public Iterator getIteratorWorkItem() throws WfException;
052:
053: /**
054: * Gets the work items
055: * @param maxNumber
056: * @throws WfException
057: * @return List of WfAssignment objects.
058: */
059: public List getSequenceWorkItem(int maxNumber) throws WfException;
060:
061: /**
062: * Checks if an assignment object is associated with this resource
063: * @param member The assignment object to check
064: * @throws WfException
065: * @return true if assignment is part of the work list
066: */
067: public boolean isMemberOfWorkItems(WfAssignment member)
068: throws WfException;
069:
070: /**
071: * Gets the resource key.
072: * @throws WfException
073: * @return String of the resouce key.
074: */
075: public String resourceKey() throws WfException;
076:
077: /**
078: * Gets the resource name
079: * @throws WfException
080: * @return String of the resource name
081: */
082: public String resourceName() throws WfException;
083:
084: /**
085: * Gets the role id of this resource
086: * @throws WfException
087: * @return String role id of this participant or null if none
088: */
089: public String resourceRoleId() throws WfException;
090:
091: /**
092: * Gets the party id of this resource
093: * @throws WfException
094: * @return String party id of this participant or null if none
095: */
096: public String resourcePartyId() throws WfException;
097:
098: /**
099: * Release the resouce from the assignement
100: * @param fromAssigment
101: * @param releaseInfo
102: * @throws WfException
103: * @throws NotAssigned
104: */
105: public void release(WfAssignment fromAssignment, String releaseInfo)
106: throws WfException, NotAssigned;
107:
108: } // interface WfResourceOperations
|