I have various Create Date&Time nodes that pass execution date & time to a variable. These nodes work well using KNIME Desktop whenever the whole workflow is reset and run.
However, my use case requires the workflow to be run through Task Scheduler.
The “-reset” in the trigger syntax doesn’t do the trick, but then I read somewhere here that the variables need to be administered via right click workflow name > Workflow Variables.
Two questions here:
Can the variables I created just be entered here, or do I need to create them from scratch and re-point to the global versions of the workflow?
I also read somewhere this whole functionality is legacy and should not be used. So what does someone need to do in order to get a workflow execution run date reset each time?
I realize this is a use case for KNIME Server, but current constraints are such.
Putting down an idea for #2 - guessing I could replace the variable node with an API call for an open date/time service that retrieves today’s date - this way it gets taken out of the variable realm and into the node stream. Though that does seem a bit overkill
Hi @qdmt, I haven’t got a specific answer to your question about using Create Date&Time within a scheduled task, but I have an alternative way of getting current Date&Time…
When you use the create date&time node, you can set the “current time” to update it for “today”. So if you reset it from the flow, you’ll always have the recent date&time, don’t need to change manually.
@denisfi I might have not explained correctly, but this is what I do currently and this only works when the workflow is run from the application itself. If the workflow is run via batch / command shell process, the variable will not reset. I’ve seen this documented else where in the forums, and hence ran into the recommendation to use a global variable (which I understand is now legacy, hence this post).
@takbb I will see if I can try that in combination with the Rule Engine node (so far looks like it won’t accept string(new date()). This is currently what I’m doing:
Feed execution date into Rule Engine as variable {expiryshort} (settings exactly as @denisfi shows)
No, the Rule Engine won’t accept that syntax. I was talking about using String Manipulation, but to use it in combination with Rule Engine, the above component should be able to replace the Create Date&Time Range node.