ITK Function Reference

(V10000.1.0.60_20160308.00)
dispatcher_itk.h
Go to the documentation of this file.
1 /*
2  Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
3  ==================================================
4  Copyright 2008.
5  Siemens Product Lifecycle Management Software Inc.
6  All Rights Reserved.
7  ==================================================
8  Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
9 */
10 
19 #ifndef DISPATCHER_ITK_H
20 #define DISPATCHER_ITK_H
21 
22 /* ========================================================================= */
23 /* ==== INCLUDES =========================================================== */
24 /* ========================================================================= */
25 
26 #include <dispatcher/libdispatcher_exports.h>
28 
29 #include <time.h>
30 
31 /*
32  * A OOTB supported translation argument that supports override of the
33  * configured setting for update of existing data.
34  */
35 #define DISPATCHER_UPDATE_EXISTING "ETSUpdOvr"
36 //#define DISPATCHER_REQUEST_ARG_MIN_SIZE 3
37 
38 #define DISPATCHER_PREF_SUCCESSFUL_STATES "TS_successful_states";
39 #define DISPATCHER_PREF_UNSUCCESSFUL_STATES "TS_unsuccessful_states";
40 #define DISPATCHER_PREF_INPROCESS_STATES "TS_inprocess_states";
41 
42 /* ========================================================================= */
43 /* The following ETS related #define's have been DEPRECATED and will be removed
44  * in the next release of Teamcenter.
45  *
46  * Please remove any instances you may have of these and replace them with the
47  * similar functionality available within Dispatcher Management.
48  *
49  */
50 
51 #define ETS_translation_arg_size_c 255
52 #define ETS_TRANSLATION_ARG_NV_SEP "="
53 #define ETS_TRANSLATION_ARG_MIN_SIZE 3
54 
55 /* The original create API trigger argument */
56 #define ETS_TRANSLATION_ARG_NAME_TRIGGER "ETSTrigger"
57 
58 /*
59  * A OOTB supported translation argument that supports override of the
60  * configured ETS setting for update of existing translated data.
61  */
62 #define ETS_TRANSLATION_ARG_NAME_UPDATE_OVR "ETSUpdOvr"
63 
64 /*
65  * Common value definitions
66  */
67 #define ETS_TRANSLATION_ARG_VALUE_TRUE "true"
68 #define ETS_TRANSLATION_ARG_VALUE_FALSE "false"
69 
70 /* ========================================================================= */
71 
72 #ifdef __cplusplus
73 extern "C"
74 {
75 #endif
76 
77 /*
78  * Dispatcher ITK Methods
79  */
80 
81 /*******************************************************************************
82  * NAME: DISPATCHER_create_request
83  * AUTHOR(S): David Hollins
84  *
85  * DESCRIPTION
86  *
87  * This method will create a request object using the specified parameters. The
88  * minimal inputs required to create a request are the provider name, the service
89  * name and a priority. The other remaining inputs can be passed as null values.
90  *
91  * INPUTS
92  *
93  * provider_name - the name of the provider that will process this request
94  * service_name - the name of the service that will process this request
95  * priority - the priority to assign to the request
96  * (0 LOW to 3 HIGH)
97  * start_time - the time at which to start this request
98  * end_time - the time at which no more repeating requests of this same type
99  * will be processed. If the interval option for repeating is NOT
100  * selected, then this paramater is unused
101  * interval - the number of times to repeat this request
102  * 0 - no repeating
103  * 1 2 3 ... - number of times to repeat this task
104  * num_objs - the length of the primary and secondary object arrays
105  * primary_objs - the array of primary objects
106  * secondary_objs - the array of related secondary objects
107  * num_args - the number of request arguments
108  * request_args - the array of request arguments in the format of
109  * <KEY>=<VALUE> (i.e. NAME=John)
110  * type - a string for use by the application creating the request for use in
111  * defining a type for the request (i.e. SYSTEM, THINCLIENT, etc.)
112  * num_datafiles - the number of datafiles you would like to upload
113  * datafiles - the array of key/path value pairs for the datafiles you would
114  * like to upload. The following format needs to be followed when
115  * passing the key/path value pairs:
116  * <KEY>=<PATH> i.e. LogFile=C:/temp/logfile.log
117  *
118  * NOTE: Use forward slashes(/) for the path seperators.
119  *
120  * OUTPUTS
121  *
122  * request - the request that was created
123  *
124  * RETURN
125  *
126  * ITK_ok if no errors, otherwise an error code
127  *
128  ******************************************************************************/
129 extern int DISPATCHER_API
131  const char* provider_name,
132  const char* service_name,
133  const int priority,
134  const time_t start_time,
135  const time_t end_time,
136  const int interval,
137  const int num_objs,
138  const tag_t* primary_objs,
139  const tag_t* secondary_objs,
140  const int num_args,
141  const char** request_args,
142  const char* type,
143  const int num_datafiles,
144  const char** data_file_keys,
145  const char** datafiles,
146  tag_t* request
147  );
148 
149 /*******************************************************************************
150  * NAME: DISPATCHER_query_requests
151  * AUTHOR(S): David Hollins
152  *
153  * DESCRIPTION
154  *
155  * This function allows the user to query for requests based on selected
156  * criteria. All defined inputs are OPTIONAL and if omitted will not become
157  * part of the query.
158  *
159  * INPUTS
160  *
161  * num_providers - number of providers
162  * providers - providers
163  * num_services - number of services
164  * services - services
165  * num_states - number of states
166  * states - states
167  * num_priorities - number of priorities
168  * priorities - priorities
169  * num_users - number of users
170  * owning_users - owning users
171  * num_taskids - number of taskids
172  * task_ids - task IDs
173  *
174  * OUTPUTS
175  *
176  * num_requests - number of requests
177  * queried_requests - requests
178  *
179  * num_requests - the number of requests returned from the query
180  * requests - the requests returned from the query
181  *
182  * RETURN
183  *
184  * ITK_ok if no errors, otherwise an error code
185  *
186  ******************************************************************************/
187 extern int DISPATCHER_API
189  const int num_providers,
190  const char** providers,
191  const int num_services,
192  const char** services,
193  const int num_states,
194  const char** states,
195  const int num_priorities,
196  const int* priorities,
197  const int num_users,
198  const char** owning_users,
199  const int num_taskids,
200  const char** task_ids,
201  int* num_requests,
202  tag_t** queried_requests
203  );
204 
205 /*******************************************************************************
206  * NAME: DISPATCHER_wait_for_request
207  * AUTHOR(S): David Hollins
208  *
209  * DESCRIPTION
210  *
211  * This function allows the user to query for requests based on selected
212  * criteria. All defined inputs are OPTIONAL and if omitted will not become
213  * part of the query.
214  *
215  * INPUTS
216  *
217  * request - tag of the request to wait
218  * interval - interval in seconds defining how often the request state should be checked
219  * time_to_wait - time in seconds to continue checking, 0 = no time limit
220  * is_final - whether or not the request is in a final state, successful or unsuccessful
221  *
222  * OUTPUTS
223  *
224  * complete - logical specifying if the request was complete or not
225  *
226  * RETURN
227  *
228  * ITK_ok if no errors, otherwise an error code
229  *
230  ******************************************************************************/
231 extern int DISPATCHER_API
233  tag_t request,
234  int interval,
235  int time_to_wait,
236  logical* is_final
237  );
238 
239 /*******************************************************************************
240  * NAME: DISPATCHER_delete_request
241  * AUTHOR(S): David Hollins
242  *
243  * DESCRIPTION
244  *
245  * This function allows the user to delete a request. If the user specifies to
246  * check the state, then only states in a final state will be allowed to be
247  * removed.
248  *
249  * INPUTS
250  *
251  * requestToDelete - the tag of the request object to delete
252  * ignoreState - should the state be ignored or validated
253  *
254  * OUTPUTS
255  *
256  *
257  * RETURN
258  *
259  * ITK_ok if no errors, otherwise an error code
260  *
261  ******************************************************************************/
262 extern int DISPATCHER_API
264  tag_t requestToDelete,
265  int ignoreState
266  );
267 
268 /*******************************************************************************
269  * NAME: DISPATCHER_add_files_to_request
270  * AUTHOR(S): David Hollins
271  *
272  * DESCRIPTION
273  *
274  * This function allows the user to attach files to a request with a given key.
275  *
276  * INPUTS
277  *
278  * request - tag of the request
279  * numFiles - number of files to upload
280  * fileKeys - file keys to associate to files
281  * files - absolute paths to files
282  *
283  * OUTPUTS
284  *
285  *
286  * RETURN
287  *
288  * ITK_ok if no errors, otherwise an error code
289  *
290  ******************************************************************************/
291 extern int DISPATCHER_API
293  const tag_t request,
294  const int numFiles,
295  const char** fileKeys,
296  const char** files
297  );
298 
299 /*******************************************************************************
300  * NAME: DISPATCHER_get_files_from_request
301  * AUTHOR(S): David Hollins
302  *
303  * DESCRIPTION
304  *
305  * This function allows the user to get files from a request with a given key.
306  *
307  * INPUTS
308  *
309  * request - tag of the request
310  * numKeys - number of keys to get files
311  * keys - file keys identifying which files to get
312  * path - absolute paths to directory to get files
313  *
314  * OUTPUTS
315  *
316  *
317  * RETURN
318  *
319  * ITK_ok if no errors, otherwise an error code
320  *
321  ******************************************************************************/
322 extern int DISPATCHER_API
324  const tag_t request,
325  const int numKeys,
326  const char** keys,
327  const char* path
328  );
329 
330 /*******************************************************************************
331  * NAME: DISPATCHER_find_request_by_tag
332  * AUTHOR(S): David Hollins
333  *
334  * DESCRIPTION
335  *
336  * This function will return the attributes of a request using its tag.
337  *
338  * INPUTS
339  *
340  * requestTag - tag of the request to load
341  *
342  * OUTPUTS
343  *
344  * task_id - task id
345  * providerName - provider name
346  * serviceName - service name
347  * priority - priority (1, 2 or 3)
348  * currentState - current state
349  * type - type of request
350  * numObjs - number of primary/secondary objects
351  * primaryObjs - primary objects
352  * secondaryObjs - secondary objects
353  * numArgs - number of arguments
354  * argKeys - argument keys
355  * argData - argument data
356  *
357  * RETURN
358  *
359  * ITK_ok if no errors, otherwise an error code
360  *
361  ******************************************************************************/
362 extern int DISPATCHER_API
364  const tag_t requestTag,
365  char** task_id,
366  char** providerName,
367  char** serviceName,
368  int* priority,
369  char** currentState,
370  char** type,
371  int* numObjs,
372  tag_t** primaryObjs,
373  tag_t** secondaryObjs,
374  int* numArgs,
375  char*** argKeys,
376  char*** argData
377  );
378 
379 /*******************************************************************************
380  * NAME: DISPATCHER_is_final_state
381  * AUTHOR(S): David Hollins
382  *
383  * DESCRIPTION
384  *
385  * This function allows the user to check as to whether or not a request is in
386  * a final state.
387  *
388  * INPUTS
389  *
390  * request - tag of the request
391  *
392  * OUTPUTS
393  *
394  * isFinalState - 0 - not final state, 1 - final state
395  *
396  * RETURN
397  *
398  * ITK_ok if no errors, otherwise an error code
399  *
400  ******************************************************************************/
401 extern int DISPATCHER_API
403  const tag_t request,
404  int* isFinalState
405  );
406 
407 /* ========================================================================= */
408 /* DEPRECATED ETS FUNCTIONS
409  *
410  * The following functions have been deprecated and will be removed in the next
411  * release of Teamcenter. Please make the necessary changes to migrate to the
412  * new Dispatcher Management functions defined above.
413  */
414 
415  /*******************************************************************************
416  * NAME: ETS_create_request (DEPRECATED)
417  *
418  * DESCRIPTION
419  *
420  * This function validates a request to create a translation request object.
421  *
422  * NOTE: Please use the replacement method within Dispatcher Management.
423  *
424  ******************************************************************************/
425  extern int DISPATCHER_API
427  const int num_objs, /* <I> */
428  const tag_t *primary_objs, /* <I> */
429  const tag_t *secondary_objs, /* <I> */
430  const int sched_priority, /* <I> */
431  const char *provider_name, /* <I> */
432  const char *translator_name, /* <I> */
433  const char *trigger, /* <I> */
434  tag_t *request /* <O> */
435  );
436 
437  /*******************************************************************************
438  * NAME: ETS_create_request2 (DEPRECATED)
439  *
440  * DESCRIPTION
441  *
442  * This function validates a request to create a translation request object
443  * that contains additional translation arguments.
444  *
445  * NOTE: Please use the replacement method within Dispatcher Management.
446  *
447  ******************************************************************************/
448 
449  extern int DISPATCHER_API ETS_create_request2 (
450  const int num_objs, /* <I> */
451  const tag_t *primary_objs, /* <I> */
452  const tag_t *secondary_objs, /* <I> */
453  const int priority, /* <I> */
454  const char *provider_name, /* <I> */
455  const char *translator_name, /* <I> */
456  const char *trigger, /* <I> */
457  const int num_translation_args, /* <I> */
458  const char **translation_args, /* <I> */
459  tag_t *request /* <O> */
460  );
461 
462  /*******************************************************************************
463  * NAME: ETS_query_requests (DEPRECATED)
464  *
465  * DESCRIPTION
466  *
467  * This function allows the user to query for requests bases in a state.
468  *
469  * NOTE: Please use the replacement method within Dispatcher Management.
470  *
471  ******************************************************************************/
472  extern int DISPATCHER_API ETS_query_requests(
473  const char *translationRequestState, /* <I> */
474  int *numTranslationRequests, /* <O> */
475  tag_t **translationRequests ); /* <OF> */
476 
477 
478  /*******************************************************************************
479  * NAME: ETS_find_request_by_tag (DEPRECATED)
480  *
481  * DESCRIPTION
482  *
483  * This function returns the properties of a request given the tag of the request
484  * object.
485  *
486  * NOTE: Please use the replacement method within Dispatcher Management.
487  *
488  ******************************************************************************/
489  extern int DISPATCHER_API ETS_find_request_by_tag(
490  const tag_t requestTag,
491  char** task_id,
492  char** state,
493  int* num_objs,
494  tag_t** primary_objs,
495  tag_t** secondary_objs,
496  int* priority,
497  char** provider_name,
498  char** translator_name,
499  int* num_trans_args,
500  char*** translation_args
501  );
502 
503  /*******************************************************************************
504  * NAME: ETS_is_final_state (DEPRECATED)
505  *
506  * DESCRIPTION
507  *
508  * This function returns returns an integer representing if the request that
509  * was specified is currently in a final state.
510  *
511  * NOTE: Please use the replacement method within Dispatcher Management.
512  *
513  ******************************************************************************/
514  extern int DISPATCHER_API
516  const tag_t request,
517  int* isFinalState
518  );
519 
520 #ifdef __cplusplus
521 } /* END OF extern "C" */
522 #endif
523 
524 #include <dispatcher/libdispatcher_undef.h>
525 
526 #endif