blob: 5d1cb0f31f26eda9a10744f78b67e654ef79ff73 [file] [log] [blame]
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
package org.ofbiz.workflow;
import java.util.List;
import java.util.Iterator;
import java.util.Map;
/**
* WfActivity - Workflow Activity Interface
*/
public interface WfActivity extends WfExecutionObject {
/**
* Retrieve amount of Assignment objects.
* @throws WfException General workflow exception.
* @return Amount of current assignments.
*/
public int howManyAssignment() throws WfException;
/**
* Retrieve the Iterator of Assignments objects.
* @throws WfException General workflow exception.
* @return Assignment Iterator.
*/
public Iterator<WfAssignment> getIteratorAssignment() throws WfException;
/**
* Retrieve all assignments of this activity.
* @param maxNumber the high limit of number of assignment in result set (0 for all).
* @throws WfException General workflow exception.
* @return List of WfAssignment objects.
*/
public List<WfAssignment> getSequenceAssignment(int maxNumber) throws WfException;
/**
* Check if a specific assignment is a member of this activity.
* @param member Assignment object.
* @throws WfException General workflow exception.
* @return true if the assignment is a member of this activity.
*/
public boolean isMemberOfAssignment(WfAssignment member) throws WfException;
/**
* Getter for the process of this activity.
* @throws WfException General workflow exception.
* @return WfProcess Process to which this activity belong.
*/
public WfProcess container() throws WfException;
/**
* Retrieve the Result map of this activity.
* @throws WfException General workflow exception.
* @throws ResultNotAvailable No result is available.
* @return Map of results from this activity
*/
public Map<String, Object> result() throws WfException, ResultNotAvailable;
/**
* Assign Result for this activity.
* @param result New result.
* @throws WfException General workflow exception.
* @throws InvalidData Data is invalid
*/
public void setResult(Map<String, Object> result) throws WfException, InvalidData;
/**
* Complete this activity.
* @throws WfException General workflow exception.
* @throws CannotComplete Cannot complete the activity
*/
public void complete() throws WfException, CannotComplete;
/**
* Activates this activity.
* @throws WfException
* @throws CannotStart
* @throws AlreadyRunning
*/
public void activate() throws WfException, CannotStart, AlreadyRunning;
} // interface WfActivity