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

com.day.cq.workflow.model.WorkflowModel 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.model;

import java.util.List;

import com.day.cq.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();

    /**
     * TODO
     */
    WorkflowNode createNode();

    /**
     * TODO
     */
    WorkflowNode createNode(String title, String type, String description);

    /**
     * TODO
     */
    public void setRootNode(WorkflowNode node);

    /**
     * TODO
     */
    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();

    /**
     * TODO
     */
    WorkflowTransition createTransition();

    /**
     * TODO
     */
    WorkflowTransition createTransition(WorkflowNode from, WorkflowNode to,
            String rule);

    /**
     * Validates the model.
     * 
     * @throws ValidationException
     */
    void validate() throws ValidationException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy