JAVA SDK- Job Service and custom token queries.
AnsweredHi team,
We have few queries regarding java SDK
1. If there is any error in one job item, our code is not processing rest of the job items. Is there any work around to skip the failure item and proceed rest of the job items?
2. While fetching the fields from Binder and passing it as a custom token, if the field is null it is throwing the null pointer exception. Can we resolve the null as empty string and pass it to the token value (the same way how standard tokens are resolving the null tokens to empty)? If yes, what is the way of doing it?
Can the token builder/TokenService be used in such cases?
--Thank you
-
Official comment
Hi Swapnaja,
For your job issue, once an exception has occurred within a task, the task fails and once the entire Job transaction has been completed, the completeWithError method is invoked. Within that method, you can notify the appropriate users that a job/task has failed.
For the Binder issue, you cannot replace null with an empty string as a token value. Can you provide your code so that I can see what you are trying to do overall?
TokenService is only supported for HTTP Callout and Spark.
Please sign in to leave a comment.
Comments
1 comment