Repository navigation
How could I change a variable defined in JVM scope in JavaScript Action? #5181
Replies: 3 comments 5 replies
|
I would have to create a test for this. |
|
if I understand this correctly, you set the variable value in the JavaScript action. The earlier actions in the workflow (like your repeat) can't pick that value up. I would try to move the entire processing into the loop in a child workflow that is called from the repeat action and set the variable in that child workflow. |
|
Ok, found a solution to my specific requirement which may not fit in other circumstances: Create a file for each processed table, and count the number of files in that folder, for example: If I have 3 tables: then I count the number of file in Basically this moves the variable out of Hop. A more general approach may be invoking a shell script to calculate/write the variable then using Set Variable to read the variable. |
Uh oh!
There was an error while loading. Please reload this page.
I have a set of workflow and pipeline which looks like this:
The problem is the Repeat Action can not be halted, because the condition can not be met.
I need to initialize the variable before the Repeat Action, and change that variable in a deeply nested workflow, but it seems that
parent_workflow.setVariable()can not change the variable defined in JVM scope.What is the proper manner to change that variable? Or is there a workaround to this?
more background:
I'm transferring data between an FTP tunnel, there are about 30 tables, and they are transferred one-by-one. I can't wait until all tables are transferred, so I use a loop to detect and process tables as soon as they arrive, and I use a variable
processed_tablesto record how many tables have been processed, whenprocessed_tableshits the total number of tables, end the Repeat action.All reactions