All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.day.cq.workflow.exec.Workflow Maven / Gradle / Ivy

/*
 * Copyright 1997-2008 Day Management AG
 * Barfuesserplatz 6, 4001 Basel, Switzerland
 * All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Day Management AG, ("Confidential Information"). You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Day.
 */
package com.day.cq.workflow.exec;

import java.util.Date;
import java.util.List;

import com.day.cq.workflow.HasMetaData;
import com.day.cq.workflow.exec.filter.WorkItemFilter;
import com.day.cq.workflow.model.WorkflowModel;

/**
 * A Workflow represents the current state of an instance of a
 * {@link WorkflowModel}. In terms of petri nets the state of a
 * workflow instance can be considered as the collections of tokens (or
 * {@link WorkItem}s) that flow through the workflow instance.
 */
public interface Workflow extends HasMetaData {
	/**
	 * Returns the Workflow instance ID.
	 * 
	 * @return The Workflow instance ID.
	 */
	String getId();

	/**
	 * Returns the list of {@link WorkItem}s assigned to the
	 * Workflow instance.
	 * 
	 * @return The list of {@link WorkItem}s assigned to the
	 *         Workflow
	 */
	List getWorkItems();

    /**
	 * Returns a filtered list of {@link WorkItem}s assigned to the
	 * Workflow instance.
	 *
	 * @param filter One is able to filter a subset of the available
     * {@link WorkItem}s by passing a {@link WorkItemFilter} impl.
     *
     * @return The list of {@link WorkItem}s assigned to the
	 *         Workflow
     *
     * @since 5.4
     */
    List getWorkItems(WorkItemFilter filter);

	/**
	 * Returns the {@link WorkflowModel} that defines the
	 * underlying workflow model of the Workflow instance.
	 * 
	 * @return The {@link WorkflowModel} of the
	 *         Workflow.
	 */
	WorkflowModel getWorkflowModel();

	/**
	 * Indicates if the Workflow instance is still active.
	 * 
	 * @return True if active, otherwise false.
	 */
	boolean isActive();

	/**
	 * Returns the workflows state. In the default implementation this could be
	 * one of RUNNING, SUSPENDED,
	 * COMPLETED or ABORTED.
	 * 
	 * @return The current workflows state.
	 */
	String getState();

	/**
	 * Returns the initiator of the Workflow instance.
	 * 
	 * @return The user who initiated the Workflow.
	 */
	String getInitiator();

	/**
	 * Getter for the point in time where the Workflow instance
	 * was started.
	 * 
	 * @return The start time of the Workflow instance.
	 */
	Date getTimeStarted();

	/**
	 * Getter for the point in time where the Workflow was
	 * finished.
	 * 
	 * @return The end time of the Workflow instance.
	 */
	Date getTimeEnded();

	/**
	 * Returns the {@link WorkflowData} object assigned to the
	 * Workflow instance.
	 * 
	 * @return The {@link WorkflowData} object assigned to the
	 *         Workflow instance.
	 */
	WorkflowData getWorkflowData();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy