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

com.adobe.granite.workflow.model.WorkflowModel Maven / Gradle / Ivy

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * __________________
 *
 *  Copyright 2012 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/
package com.adobe.granite.workflow.model;

import java.util.List;

import com.adobe.granite.workflow.HasMetaData;

/**
 * WorkflowModel represents a model/definition of a workflow.
 * 
 * It provides methods for retrieving the entities of the model like
 * {@link WorkflowNode}s and
 * {@link WorkflowTransition}s as well as common model attributes
 * like name, description or version.
 */
public interface WorkflowModel extends HasMetaData {
    /**
     * Returns the ID of the WorkflowModel.
     * 
     * @return The ID of the WorkflowModel.
     */
    String getId();

    /**
     * Returns the title of the WorkflowModel.
     * 
     * @return The title of the WorkflowModel.
     */
    String getTitle();

    /**
     * Sets the title of the WorkflowModel.
     * 
     * @param title
     *            The new title of the WorkflowModel.
     */
    void setTitle(String title);

    /**
     * Returns the description of the WorkflowModel.
     * 
     * @return The description of the WorkflowModel.
     */
    String getDescription();

    /**
     * Sets the description of the WorkflowModel.
     * 
     * @param description
     *            The new description of the WorkflowModel.
     */
    void setDescription(String description);

    /**
     * Returns the version of the WorkflowModel.
     * 
     * @return The version of the WorkflowModel.
     */
    String getVersion();

    /**
     * Returns the list of {@link WorkflowNode}s contained by the
     * WorkflowModel.
     * 
     * @return The list of {@link WorkflowNode}s of the
     *         WorkflowModel.
     */
    List getNodes();

    /**
     * @return the created workflow node
     */
    WorkflowNode createNode();

    /**
     * @param title the title
     * @param type the type
     * @param description the description
     * @return the created workflow node
     */
    WorkflowNode createNode(String title, String type, String description);

    /**
     * @param node the workflow node
     */
    public void setRootNode(WorkflowNode node);

    /**
     * @param node the workflow node
     */
    public void setEndNode(WorkflowNode node);

    /**
     * Returns the {@link WorkflowNode} with the given id
     * 
     * @param id
     *            The ID of the {@link WorkflowNode}.
     * 
     * @return The WorkflowNode or null if not found.
     */
    WorkflowNode getNode(String id);

    /**
     * Returns the root/start {@link WorkflowNode}.
     * 
     * @return The root {@link WorkflowNode}.
     */
    WorkflowNode getRootNode();

    /**
     * Returns the end {@link WorkflowNode}.
     * 
     * @return The end {@link WorkflowNode}.
     */
    WorkflowNode getEndNode();

    /**
     * Returns the list of {@link WorkflowTransition}s contained by
     * the WorkflowModel.
     * 
     * @return The list of {@link WorkflowTransition}s of the
     *         WorkflowModel.
     */
    List getTransitions();

    /**
     * @return the created workflow transition
     */
    WorkflowTransition createTransition();

    /**
     * @param from the workflow node to begin the transition with
     * @param to the workflow node to end the transition with
     * @param rule the rule
     * @return the created workflow transition
     */
    WorkflowTransition createTransition(WorkflowNode from, WorkflowNode to,
            String rule);

    /**
     * Validates the model.
     * 
     * @throws ValidationException in case the validation fails
     */
    void validate() throws ValidationException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy