001/*
002 *  Copyright 2017 Anyware Services
003 *
004 *  Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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.ametys.plugins.bpm;
017
018import java.util.Date;
019
020import org.ametys.core.user.UserIdentity;
021import org.ametys.plugins.explorer.resources.ResourceCollection;
022import org.ametys.plugins.repository.AmetysRepositoryException;
023
024/**
025 * Common interface for a Process in the Business Process Management
026 */
027public interface WorkflowProcess
028{
029    /**
030     * Get the process title
031     * @return The process title
032     * @throws AmetysRepositoryException If a repository error occurred
033     */
034    public String getTitle() throws AmetysRepositoryException;
035    
036    /**
037     * Set the process title
038     * @param title The title
039     * @throws AmetysRepositoryException If a repository error occurred
040     */
041    public void setTitle(String title) throws AmetysRepositoryException;
042    
043    /**
044     * Get the workflow linked to this process
045     * @return The workflow id
046     * @throws AmetysRepositoryException If a repository error occurred
047     */
048    public String getWorkflow() throws AmetysRepositoryException;
049    
050    /**
051     * Set the workflow linked to this process
052     * @param workflowId The workflow id
053     * @throws AmetysRepositoryException If a repository error occurred
054     */
055    public void setWorkflow(String workflowId) throws AmetysRepositoryException;
056    
057    /**
058     * Get the process description
059     * @return The description
060     * @throws AmetysRepositoryException If a repository error occurred
061     */
062    public String getDescription() throws AmetysRepositoryException;
063    
064    /**
065     * Set the process description
066     * @param description The description
067     * @throws AmetysRepositoryException If a repository error occurred
068     */
069    public void setDescription(String description) throws AmetysRepositoryException;
070    
071    /**
072     * Get the creator of the process
073     * @return The creator
074     * @throws AmetysRepositoryException If a repository error occurred
075     */
076    public UserIdentity getCreator() throws AmetysRepositoryException;
077    
078    /**
079     * Set the creator of the process
080     * @param creator The creator
081     * @throws AmetysRepositoryException If a repository error occurred
082     */
083    public void setCreator(UserIdentity creator) throws AmetysRepositoryException;
084    
085    /**
086     * Get the site where the process was created
087     * @return The site
088     * @throws AmetysRepositoryException If a repository error occurred
089     */
090    public String getSite() throws AmetysRepositoryException;
091    
092    /**
093     * Set the site where the process was created
094     * @param site The site
095     * @throws AmetysRepositoryException If a repository error occurred
096     */
097    public void setSite(String site) throws AmetysRepositoryException;
098    
099    /**
100     * Get the creation date of the process
101     * @return The creation date
102     * @throws AmetysRepositoryException If a repository error occurred
103     */
104    public Date getCreationDate() throws AmetysRepositoryException;
105    
106    /**
107     * Set the creation date of the process
108     * @param creationDate The creation date
109     * @throws AmetysRepositoryException If a repository error occurred
110     */
111    public void setCreationDate(Date creationDate) throws AmetysRepositoryException;
112    
113    /**
114     * Retrieves the attachments root node
115     * @param create True to create the node if it does not exist
116     * @return The attachments root node.
117     * @throws AmetysRepositoryException if an error occurs.
118     */
119    public ResourceCollection getRootAttachments(boolean create) throws AmetysRepositoryException;
120}