Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transformation time TU and TO pre-validation #29

Open
fabiocarvalho777 opened this issue Nov 3, 2017 · 0 comments
Open

Add transformation time TU and TO pre-validation #29

fabiocarvalho777 opened this issue Nov 3, 2017 · 0 comments

Comments

@fabiocarvalho777
Copy link
Member

fabiocarvalho777 commented Nov 3, 2017

Problem definition

Every Transformation Utility and Operation input parameters need to be validated before execution. These parameters are the fields that are set during transformation definition time or during transformation execution time (usually based on the transformation context).

If an utility pre-validation fails, an exception should be thrown, the execution should be interrupted, and a perform result of type PRE_VALIDATION should be returned (containing the validation exception).

Potential solutions

There are two potential solutions for this problem:

  1. Using BeanValidations 2.0
  2. Using an abstract method called preValidation. It should be added to TransformationUtility class and be called in the perform method right before execution.

Which exception to throw, TransformationDefinitionException or PreValidationException?

Some TUs and TOs currently are currently throwing TransformationDefinitionException.

Other option would be a new type, called PreValidationException, could be created. It should extend TransformationException, which should extend ButterflyRuntimeException. TransformationUtilityException should also extend TransformationException.

Acceptance criteria

  1. Define a transformation time TU and TO pre-validation .
  2. Implement it for EVERY transformation utility and operation. Move any pre-validation done currently in any utility execution methods to the new mechanism. Notice that in many cases there will be a TODO comment referring to it.
  3. Update EVERY transformation utility and operation unit test adding pre-validation test cases.
  4. If any new exception type is introduced, the exceptions class diagram in Design Documents should be updated accordingly.
  5. Update README and end user documentation accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant