View Javadoc
1   /*
2    * Copyright (c) 2002-2024, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.workflow.modules.appointmentants.business.history;
35  
36  /**
37   * Class that represents the history of a specific / unique ANTS Workflow task.
38   * Used to save the result returned by the task.
39   * 
40   */
41  public class TaskAntsAppointmentHistory
42  {
43  	/**
44  	 * Task's ID
45  	 */
46  	private int _nIdTask;
47  
48  	/**
49  	 * Task's resource history ID
50  	 */
51  	private int _nIdResourceHistory;
52  
53  	/**
54  	 * Result of the task's execution
55  	 */
56  	private boolean _bIsTaskSuccessful;
57  
58  	/**
59  	 * ANTS application numbers used in the task
60  	 */
61  	private String _strAntsApplicationNumbers;
62  
63  	/**
64  	 * Standard constructor
65  	 */
66  	public TaskAntsAppointmentHistory( )
67  	{
68  		_strAntsApplicationNumbers = null;
69  	}
70  
71  	/**
72  	 * Construct a TaskAntsAppointmentHistory object with specific parameters
73  	 * 
74  	 * @param idResourceHistory
75  	 *            Task's resource history ID
76  	 * @param idTask
77  	 *            Task's ID
78  	 * @param taskSuccessState
79  	 *            Task's success state: true = successful, false = failed
80  	 * @param antsApplicationNumbers
81  	 *            ANTS application numbers as a String
82  	 */
83  	public TaskAntsAppointmentHistory( int idResourceHistory, int idTask, boolean taskSuccessState, String antsApplicationNumbers )
84  	{
85  		_nIdResourceHistory = idResourceHistory;
86  		_nIdTask = idTask;
87  		_bIsTaskSuccessful = taskSuccessState;
88  		_strAntsApplicationNumbers = antsApplicationNumbers;
89  	}
90  
91  	/**
92  	 * Get the task's ID
93  	 * 
94  	 * @return The task's ID
95  	 */
96  	public int getIdTask( )
97  	{
98  		return _nIdTask;
99  	}
100 
101 	/**
102 	 * Set the task's ID
103 	 * 
104 	 * @param idTask
105 	 *            Task's ID
106 	 */
107 	public void setIdTask( int idTask )
108 	{
109 		_nIdTask = idTask;
110 	}
111 
112 	/**
113 	 * Get the task's resource history ID
114 	 * 
115 	 * @return The resource history's ID
116 	 */
117 	public int getIdResourceHistory( )
118 	{
119 		return _nIdResourceHistory;
120 	}
121 
122 	/**
123 	 * Set the task's resource history's ID
124 	 * 
125 	 * @param idResourceHistory
126 	 *            Resource history's ID
127 	 */
128 	public void setIdResourceHistory( int idResourceHistory )
129 	{
130 		_nIdResourceHistory = idResourceHistory;
131 	}
132 
133 	/**
134 	 * Get the task's success result
135 	 * 
136 	 * @return The task's success result: true = successful, false = failed
137 	 */
138 	public boolean isTaskSuccessful( )
139 	{
140 		return _bIsTaskSuccessful;
141 	}
142 
143 	/**
144 	 * Set the task's success result: true = successful, false = failed
145 	 * 
146 	 * @param taskSuccessState
147 	 *            The task's success result
148 	 */
149 	public void setTaskSuccessState( boolean taskSuccessState )
150 	{
151 		_bIsTaskSuccessful = taskSuccessState;
152 	}
153 
154 	/**
155 	 * Get the ANTS application numbers used in this task
156 	 * 
157 	 * @return a String containing the application numbers' value
158 	 */
159 	public String getAntsApplicationNumbers( ) {
160 		return _strAntsApplicationNumbers;
161 	}
162 
163 	/**
164 	 * Set the value of the ANTS application numbers
165 	 * 
166 	 * @param antsApplicationNumbers
167 	 *            ANTS application numbers as a String
168 	 */
169 	public void setAntsApplicationNumbers( String antsApplicationNumbers ) {
170 		_strAntsApplicationNumbers = antsApplicationNumbers;
171 	}	
172 }