Прочетете на английски Редактиране

Споделяне чрез


ActivityValidationServices.Validate Method

Definition

Verifies that a workflow activity is correctly configured according to the validation logic. This logic can be the CacheMetadata(CodeActivityMetadata) method of the activities to validate, or build and policy constraints.

Overloads

Validate(Activity)

Verifies that a workflow activity is correctly configured according to the validation logic. This logic can be the CacheMetadata(CodeActivityMetadata) method of the activities to validate, or build and policy constraints.

Validate(Activity, ValidationSettings)

Verifies that a workflow activity is correctly configured according to the validation logic. This logic can be the cacheMetadata method of the activities to validate, or build and policy constraints.

Remarks

Custom activity authors can provide validation logic in an activity's CacheMetadata override. Any exceptions that are thrown from CacheMetadata are not treated as validation errors. These exceptions will escape from the call to Validate and must be handled by the caller.

Validate(Activity)

Verifies that a workflow activity is correctly configured according to the validation logic. This logic can be the CacheMetadata(CodeActivityMetadata) method of the activities to validate, or build and policy constraints.

C#
public static System.Activities.Validation.ValidationResults Validate(System.Activities.Activity toValidate);

Parameters

toValidate
Activity

An element from a workflow activity tree.

Returns

A collection of validation errors, each of which can contain the name of the validated activity, a descriptive message, an error code, and other information.

Remarks

Custom activity authors can provide validation logic in an activity's CacheMetadata override. Any exceptions that are thrown from CacheMetadata are not treated as validation errors. These exceptions will escape from the call to Validate and must be handled by the caller.

Applies to

.NET Framework 4.8.1 и други версии
Продукт Версии
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Validate(Activity, ValidationSettings)

Verifies that a workflow activity is correctly configured according to the validation logic. This logic can be the cacheMetadata method of the activities to validate, or build and policy constraints.

C#
public static System.Activities.Validation.ValidationResults Validate(System.Activities.Activity toValidate, System.Activities.Validation.ValidationSettings settings);

Parameters

toValidate
Activity

An activity from a workflow activity tree.

settings
ValidationSettings

An object that determines the behavior of the validation method on the workflow , can suppress the internal validation logic, and can also contain the policy constraints.

Returns

A collection of validation errors, each of which can contain the name of the activity that is configured incorrectly, a descriptive message, an error or warning code , and other information.

Remarks

Custom activity authors can provide validation logic in an activity's CacheMetadata override. Any exceptions that are thrown from CacheMetadata are not treated as validation errors. These exceptions will escape from the call to Validate and must be handled by the caller.

Applies to

.NET Framework 4.8.1 и други версии
Продукт Версии
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1