ITK Function Reference
(V10000.1.0.60_20160308.00)
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
validation
validationrule.h
Go to the documentation of this file.
1
/*==================================================================================================
2
Copyright (c) 2003,2006 Unigraphics Solutions Inc.
3
Unpublished - All rights reserved
4
====================================================================================================*/
11
/* */
12
13
#ifndef VALIDATIONRULE_H
14
#define VALIDATIONRULE_H
15
16
#include <
tc/tc_startup.h
>
17
#include <validation/libvalidation_exports.h>
18
150
typedef
struct
validation_expression_s
{
151
char
*
name
;
152
char
op
;
153
char
*
value
;
154
char
*
value_from_log
;
155
}
validation_expression_t
;
156
162
typedef
struct
validation_events_s
{
163
char
*
class_clause
;
164
char
**
values
;
167
int
num_values
;
168
logical
exclude
;
170
}
validation_events_t
;
171
172
typedef
enum
validation_run_status_e
{
173
up_to_date
,
174
out_of_date
,
175
out_Of_Date_RequirementChanged
,
176
verify_parameter_failed
,
177
missing_report_log
,
178
not_run
,
179
not_required
180
}
validation_run_status_t
;
181
190
typedef
struct
validation_rule_s
{
191
tag_t
checker_obj
;
192
char
*
checker_name
;
193
char
**
dataset_types
;
194
logical
required
;
196
validation_expression_t
*
attributes
;
197
validation_expression_t
*
parameters
;
198
validation_events_t
*
events
;
200
int
num_dataset_types
;
201
int
num_attrs
;
202
int
num_paras
;
203
204
}
validation_rule_t
;
205
209
typedef
struct
candidate_validation_result_s
{
210
validation_run_status_t
status
;
211
tag_t
nx_dataset
;
212
tag_t
result
;
213
validation_rule_t
*
rule
;
214
logical
check_passed
;
215
}
candidate_validation_result_t
;
216
220
typedef
enum
VALIDATIONRULE_parameter_operation_e
{
221
VALIDATIONRULE_operation_equal
= 0,
222
VALIDATIONRULE_operation_regular_exp
,
223
VALIDATIONRULE_operation_not_equal
,
224
VALIDATIONRULE_operation_less_than
,
225
VALIDATIONRULE_operation_lessthan_or_euqal
,
226
VALIDATIONRULE_operation_greater_than
,
227
VALIDATIONRULE_operation_greaterthan_or_equal
,
228
VALIDATIONRULE_operation_begins
,
229
VALIDATIONRULE_operation_contains
230
}
VALIDATIONRULE_parameter_operation_t
;
231
237
typedef
struct
VALIDATIONRULE_parameter_s
{
238
char
*
name
;
239
VALIDATIONRULE_parameter_operation_t
op
;
241
char
*
value
;
242
char
*
value_from_log
;
243
}
VALIDATIONRULE_parameter_t
;
244
245
/*
246
Validation Target structrue defines the available target types for one rule.
247
Any business object could be a validation target, at the meantime, it is able to limit to
248
several sub typs of the specified target type.
249
*/
250
typedef
struct
VALIDATIONRULE_target_s
{
251
char
*
target_type
;
/*The target type, could be any POM object, like Dataset, ItemRevision and BOMLine*/
252
char
**
targets
;
/*The sub types of specified target type, like UGMaster, UGPart*/
253
int
num_targets
;
/*The number of sub types*/
254
}
VALIDATIONRULE_target_t
, *
VALIDATIONRULE_target_p_t
;
255
261
typedef
struct
VALIDATIONRULE_event_s
{
262
char
*
class_clause
;
263
char
*
application
;
264
char
*
apply_to
;
265
logical
exclude
;
267
char
**
values
;
270
int
num_values
;
272
}
VALIDATIONRULE_event_t
;
273
277
typedef
struct
VALIDATIONRULE_rule_s
{
278
tag_t
checker_obj
;
279
char
*
checker_name
;
280
char
*
checker_version
;
281
logical
required
;
283
VALIDATIONRULE_target_t
*
target
;
285
VALIDATIONRULE_parameter_t
*
attributes
;
286
VALIDATIONRULE_parameter_t
*
parameters
;
287
VALIDATIONRULE_event_t
*
events
;
289
int
num_events
;
290
int
num_attrs
;
291
int
num_paras
;
292
293
}
VALIDATIONRULE_rule_t
;
294
295
/*
296
Validation rule set structure.
297
*/
298
typedef
struct
VALIDATIONRULE_rule_set_s
{
299
char
*
name
;
/*The rule set name, TODO:Consider localization*/
300
int
num_rules
;
/*The number of rules*/
301
VALIDATIONRULE_rule_t
*
rules
;
/*The validation rule list*/
302
}
VALIDATIONRULE_rule_set_t
, *
VALIDATIONRULE_rule_set_p_t
;
303
307
typedef
struct
VALIDATIONRULE_candidate_result_s
{
308
validation_run_status_t
status
;
309
tag_t
target_obj
;
310
tag_t
result
;
311
VALIDATIONRULE_rule_t
*
rule
;
312
logical
check_passed
;
313
}
VALIDATIONRULE_candidate_result_t
;
314
315
#ifdef __cplusplus
316
extern
"C"
{
317
#endif
318
325
extern
VALIDATION_API
int
VALIDATIONRULE_get_rules
(
326
char
* rule_item_revision,
327
char
* validation_rule_set,
328
char
* current_event,
329
validation_rule_t
**rules,
330
int
*num
331
);
332
348
extern
VALIDATION_API
int
VALIDATIONRULE_get_candidate_results
(
349
tag_t
* target_obj,
350
int
num_target,
351
validation_rule_t
*rules,
352
int
num_rules,
353
candidate_validation_result_t
**candidates,
354
int
*num_candidates
355
);
356
368
extern
VALIDATION_API
int
VALIDATIONRULE_verify_result
(
369
candidate_validation_result_t
*candidate
370
);
371
375
extern
VALIDATION_API
void
VALIDATIONRULE_free_rules
(
376
validation_rule_t
*rules,
377
int
num_rules
378
);
379
383
extern
VALIDATION_API
void
VALIDATIONRULE_free_results
(
384
candidate_validation_result_t
*candidates,
385
int
num_candidates
386
);
387
394
extern
VALIDATION_API
int
VALIDATIONRULE_check_results
(
395
tag_t
* target_obj,
396
int
num_target,
397
char
* rule_item_revision,
398
char
* validation_rule_set,
399
char
* current_event
400
);
401
408
extern
VALIDATION_API
int
VALIDATIONRULE_get_rules2
(
409
tag_t
rule_revision,
410
char
* validation_rule_set,
411
char
* current_event,
412
validation_rule_t
**rules,
413
int
*num
414
);
415
423
extern
VALIDATION_API
int
VALIDATIONRULE_get_rules3
(
424
char
* rule_item_revision,
425
char
* validation_rule_set,
426
char
* current_event,
427
VALIDATIONRULE_rule_t
**rules,
428
int
*num
429
);
430
438
extern
VALIDATION_API
int
VALIDATIONRULE_get_rules4
(
439
tag_t
rule_revision,
440
char
* validation_rule_set,
441
char
* current_event,
442
VALIDATIONRULE_rule_t
**rules,
443
int
*num
444
);
445
462
extern
VALIDATION_API
int
VALIDATIONRULE_get_candidate_results2
(
463
tag_t
* target_obj,
464
int
num_target,
465
VALIDATIONRULE_rule_t
*rules,
466
int
num_rules,
467
VALIDATIONRULE_candidate_result_t
**candidates,
468
int
*num_candidates
469
);
470
483
extern
VALIDATION_API
int
VALIDATIONRULE_verify_result2
(
484
VALIDATIONRULE_candidate_result_t
*candidate
485
);
486
491
extern
VALIDATION_API
void
VALIDATIONRULE_free_rules2
(
492
VALIDATIONRULE_rule_t
*rules,
493
int
num_rules
494
);
495
500
extern
VALIDATION_API
void
VALIDATIONRULE_free_results2
(
501
VALIDATIONRULE_candidate_result_t
*candidates,
502
int
num_candidates
503
);
504
505
#ifdef __cplusplus
506
}
507
#endif
508
510
#include <validation/libvalidation_undef.h>
511
512
#endif
513