001/**
002 * Copyright 2005-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kew.api.peopleflow;
017
018import org.kuali.rice.core.api.mo.common.Identifiable;
019import org.kuali.rice.core.api.mo.common.Versioned;
020import org.kuali.rice.core.api.mo.common.active.Inactivatable;
021
022import java.util.List;
023import java.util.Map;
024
025/**
026 * Contract interface for a PeopleFlowDefinition.  A PeopleFlowDefinition is simply a collections of members and their (optional) delegates.
027 * Each member of a PeopleFlowDefinition has a priority number assigned to it, which indicates the order in which members should
028 * be processed during execution of the flow.
029 *
030 * <p>Priority is ordered by the lowest priority number being the "beginning" of the flow.  It is possible for one or
031 * more members to have the same priority number, in which case they should be processed in parallel.</p>
032 *
033 * <p>Members of a flow can be one of either a principal, group, or role which is defined by the
034 * {@link PeopleFlowMemberContract}.</p>
035 *
036 * @author Kuali Rice Team (rice.collab@kuali.org)
037 */
038public interface PeopleFlowContract extends Identifiable, Inactivatable, Versioned {
039
040    /**
041     * @return the name for this {@link PeopleFlowContract}.  Will never be null.
042     */
043    String getName();
044
045    /**
046     * @return the namespace for this {@link PeopleFlowContract}.  Will never be null.
047     */
048    String getNamespaceCode();
049
050    /**
051     * @return the type id for this {@link PeopleFlowContract}.  Will never be null.
052     */
053    String getTypeId();
054
055    /**
056     * @return the name for this {@link PeopleFlowContract}.  May be null, but not empty.
057     */
058    String getDescription();
059
060    /**
061     * Returns the list of members for this flow, sorted from lowest to highest priority number.
062     *
063     * @return the {@link PeopleFlowMemberContract}s for this {@link PeopleFlowContract}. Will never return null.
064     */
065    List<? extends PeopleFlowMemberContract> getMembers();
066
067    /**
068     * @return the attributes for this {@link PeopleFlowContract}. Will never return null.
069     */
070    Map<String, String> getAttributes();
071
072}