Is there a way I can return my new array "list" instead of hard coding true?
I know they both will come to the same outcome, however, I'm trying my best to not hard code anything which isn't necessary
slight workaround: you can just set a variable in the payload like ctx.payload.foo = new_list and then return true or false for the condition to match.
I have that already - it's just truncated in my gist on github. ctx.payload.array_new = list; return true;
My question was more if I could just return "list" instead of "true". I don't think my code currently does that, however I believe you can and was hoping for advice on how I can achieve this.
then I do not understand your question. A condition requires a boolean to be returned in order to trigger the actions or not, and you can access the newly created data structure in your actions.
The above example is something completely different than a watcher condition and therefore returns something completely different - that is relevant in that context.
you need to store it somewhere that it can be passed around the execution, and that place is the payload or ctx.vars in the so called watch execution context.
Again, what is the use-case, that cannot be covered at the moment? If I understand this, I may be able to help further instead of asking around
Use-case: Create an alert to notify me of which customer has not received anything. If doc_count is 0, this means nothing has been sent to the client. The action should call upon the client name.
// Console + Output thus far:
I feel like I am missing something in my condition, however I don't know what. When I play around in the "action", by doing {{ctx.payload.array_new}}, for example, I always get error messages. I have put in a simple text action for the time being.
Thanks for always helping by the way! I really appreciate it
can you include {{ctx.payload}} in the logging output instead of a non templated text and rerun? This way you can see if that array is part of your payload.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.