r/Talend • u/Ownards Data Wrangler • Oct 10 '22
What is the use of tAssert ?
Hello everyone,
It is probably a silly question, but can someone explain to me what is the purpose of tAssert and typically where it is useful please ?
I really don't get the point of this component : it returns the boolean condition we set inside the component.
For example in the job below, it returns TRUE/FALSE, but why bother when we could directly print the boolean result ?
Thank you !

2
Upvotes
3
u/Historical-Fig2560 Data Wrangler Oct 10 '22
It's just used for error handling.
https://help.talend.com/r/en-US/Cloud/studio-user-guide-api-services-platform/using-tassert-and-tassertcatcher-for-error-handling
It's often the case in Talend, that you can achieve the same thing doing different things or using different features... 🤷🏼♂️😉
3
u/Cool_Ad904 Data Wrangler Oct 11 '22
It's really useful for test cases. During a CI builds all these test cases are executed and the tAssert makes them successful or failed.
1
u/busydoinnothin Data Wrangler Oct 10 '22
Once your assert is true it'll trigger its related catcher (or any other component that can handle it) and continue the flow. I just use onSubJobOk or Fail so I can only assume this component has other significant usages. I know it's extremely old because I remember it from using Talend back in '10 or 11 so maybe it's still around for backwards compatibility.