001/*
002 * (C) Copyright 2009 Nuxeo SA (http://nuxeo.com/) and others.
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 *
016 * Contributors:
017 *     arussel
018 */
019package org.nuxeo.ecm.platform.routing.api;
020
021/**
022 * @author arussel
023 */
024public interface DocumentRoutingConstants {
025
026    // web
027    String SEARCH_ROUTE_BY_ATTACHED_DOC_QUERY = "SEARCH_ROUTE_BY_ATTACHED_DOC";
028
029    /**
030     * @since 5.6
031     */
032    String DOC_ROUTING_SEARCH_ALL_ROUTE_MODELS_PROVIDER_NAME = "DOC_ROUTING_SEARCH_ALL_ROUTE_MODELS";
033
034    /**
035     * @since 7.4
036     */
037    String DOC_ROUTING_SEARCH_ROUTE_MODELS_WITH_TITLE_PROVIDER_NAME = "DOC_ROUTING_SEARCH_ROUTE_MODELS_WITH_TITLE";
038
039    String ROUTE_MANAGERS_GROUP_NAME = "routeManagers";
040
041    // document constant
042    String DOCUMENT_ROUTE_INSTANCES_ROOT_DOCUMENT_TYPE = "DocumentRouteInstancesRoot";
043
044    String DOCUMENT_ROUTE_MODELS_ROOT_DOCUMENT_TYPE = "DocumentRouteModelsRoot";
045
046    String DOCUMENT_ROUTE_INSTANCES_ROOT_ID = "document-route-instances-root";
047
048    String DOCUMENT_ROUTE_MODELS_ROOT_ID = "document-route-models-root";
049
050    String DOCUMENT_ROUTE_DOCUMENT_TYPE = "DocumentRoute";
051
052    String DOCUMENT_ROUTE_DOCUMENT_FACET = "DocumentRoute";
053
054    String COMMENTS_INFO_HOLDER_FACET = "CommentsInfoHolder";
055
056    String STEP_DOCUMENT_TYPE = "DocumentRouteStep";
057
058    String STEP_FOLDER_DOCUMENT_TYPE = "StepFolder";
059
060    String STEP_FOLDER_FACET = "StepFolder";
061
062    // @deprecated since 5.9.2 - Use only routes of type 'graph'
063    @Deprecated
064    String CONDITIONAL_STEP_FACET = "ConditionalStepFolder";
065
066    // @deprecated since 5.9.2 - Use only routes of type 'graph'
067    @Deprecated
068    String CONDITIONAL_STEP_DOCUMENT_TYPE = "ConditionalStepFolder";
069
070    String TITLE_PROPERTY_NAME = "dc:title";
071
072    String DESCRIPTION_PROPERTY_NAME = "dc:description";
073
074    String EXECUTION_TYPE_PROPERTY_NAME = "stepf:execution";
075
076    String INITIATOR = "docri:initiator";
077
078    String ATTACHED_DOCUMENTS_PROPERTY_NAME = "docri:participatingDocuments";
079
080    String COMMENTS_NO_PROPERTY_NAME = "info_comments:numberOfComments";
081
082    // @deprecated since 5.9.2 - Use only routes of type 'graph'
083    @Deprecated
084    String STEP_TO_BE_EXECUTED_NEXT_PROPERTY_NAME = "condstepf:posOfChildStepToRunNext";
085
086    // operation constant
087    String OPERATION_CATEGORY_ROUTING_NAME = "Routing";
088
089    String OPERATION_STEP_DOCUMENT_KEY = "document.routing.step";
090
091    String ROUTE_STEP_FACET = "RouteStep";
092
093    String DOCUMENT_ROUTING_ACL = "routing";
094
095    String DOCUMENT_ROUTING_DELEGATION_ACL = "delegation";
096
097    String WORKFLOW_FORCE_RESUME = "_FORCE_RESUME_";
098
099    /*
100     * @since 5.9.3 If this flag is set to Boolean.TRUE in the map of variables to be set on node or workflow, these
101     * variables will be decoded to JSON format
102     */
103    String _MAP_VAR_FORMAT_JSON = "_MAP_VAR_FORMAT_JSON";
104
105    /**
106     * @since 5.6
107     */
108    String TASK_ASSIGNED_NOTIFICATION_TEMPLATE = "taskNotificationTemplate";
109
110    enum ExecutionTypeValues {
111        /** Serial running of children nodes. */
112        serial,
113        /** Parallel running of children nodes. */
114        parallel,
115        /** Running of the nodes decided by the graph state. */
116        graph
117    }
118
119    // event
120    enum Events {
121        /**
122         * before the route is validated, each part of the route is in "Draft" state. The session used is unrestricted.
123         * The element key is the route.
124         */
125        beforeRouteValidated,
126        /**
127         * after the route is validated, each part of the route is in "Validated" state. The session used is
128         * unrestricted. The element key is the route.
129         */
130        afterRouteValidated,
131        /**
132         * before the route is ready, each part of the route is in "Validated" state.The session used is unrestricted.
133         * The element key is the route.
134         */
135        beforeRouteReady,
136        /**
137         * after the route is ready, each part of the route is in "Ready" state.The session used is unrestricted. The
138         * element key is the route.
139         */
140        afterRouteReady,
141        /**
142         * before the route starts. The RouteDocument is in "Running" state, other parts of the route is either in
143         * Ready, Running or Done state.The session used is unrestricted. The element key is the route.
144         */
145        beforeRouteStart,
146        /**
147         * after the route is finished. The route and each part of the route is in Done state.The session used is
148         * unrestricted. The element key is the route.
149         */
150        afterRouteFinish,
151        /**
152         * before the operation chain for this step is called. The step is in "Running" state.The session used is
153         * unrestricted. The element key is the step.
154         */
155        beforeStepRunning,
156        /**
157         * After the operation chain of this step ran and if the step is not done, ie: if we are in a waiting state.The
158         * session used is unrestricted. The element key is the step.
159         */
160        stepWaiting,
161        /**
162         * after the operation chain for this step is called.The step is in "Done" state.The session used is
163         * unrestricted. The element key is the step.
164         */
165        afterStepRunning,
166        /**
167         * before a step is put back to ready state.
168         */
169        beforeStepBackToReady,
170        /**
171         * after a step was put back to ready state.
172         */
173        afterStepBackToReady,
174        /**
175         * before the undo operation is run on the step.
176         */
177        beforeUndoingStep,
178        /**
179         * after the undo operation is run on the step.
180         */
181        afterUndoingStep,
182        /**
183         * @since 2.7.2
184         */
185        workflowCanceled,
186        /**
187         * @since 7.4
188         */
189        afterWorkflowFinish,
190        /**
191         * @since 7.4
192         */
193        afterWorkflowStarted,
194        /**
195         * @since 7.4
196         */
197        beforeWorkflowCanceled,
198        /**
199         * @since 7.4
200         */
201        afterWorkflowTaskEnded,
202        /**
203         * @since 7.4
204         */
205        afterWorkflowTaskCreated,
206        /**
207         * @since 7.4
208         */
209        afterWorkflowTaskReassigned,
210        /**
211         * @since 7.4
212         */
213        afterWorkflowTaskDelegated
214    }
215
216    String DOCUMENT_ELEMENT_EVENT_CONTEXT_KEY = "documentElementEventContextKey";
217
218    String WORKFLOW_TASK_COMPLETION_ACTION_KEY = "workflowTaskCompletionAction";
219
220    String INITIATOR_EVENT_CONTEXT_KEY = "initiator";
221
222    String ROUTING_CATEGORY = "Routing";
223
224    String ROUTING_INITIATOR_ID_KEY = "initiator";
225
226    public static final String TASK_ROUTE_INSTANCE_DOCUMENT_ID_KEY = "routeInstanceDocId";
227
228    public static final String TASK_NODE_ID_KEY = "nodeId";
229
230    public static final String TASK_BUTTONS_KEY = "taskButtons";
231
232    public static final String ROUTING_TASK_FACET_NAME = "RoutingTask";
233
234    /**
235     * @since 7.1
236     */
237    public static final String ROUTING_TASK_DOC_TYPE = "RoutingTask";
238
239    public static final String ROUTE_TASK_LOCAL_ACL = "routingTask";
240
241    /**
242     * @since 7.2
243     */
244    public static final String DOCUMENT_ROUTE_MODEL_LIFECYCLESTATE = "validated";
245
246    /**
247     * @since 7.2
248     */
249    public static final String DOCUMENT_ROUTE_INSTANCE_MODEL_ID = "docri:modelId";
250
251    /**
252     * @since 7.2
253     */
254    public static final String GLOBAL_VAR_SCHEMA_PREFIX = "var_global_";
255
256    /**
257     * @since 7.4
258     */
259    public static final String CAN_DATA_VISU = "DataVisualization";
260}