Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Brett
  •  Brett
  • No customer Topic Starter
2012-07-02T04:00:30Z
Hi Support - could I ask a question re setting variables

I have several set variable tasks that seem to be misbehaving.

These are where I am setting the contents of a variable to the value or in the case of the example the combined value of two other variables

{STRING(Concat|{USERVAR(rule_table_name)}|{USERVAR(rule_column_name)})}

The info message below shows that instead of converting the VC variable to their value first I am getting the code string being set to the variable

Variable 'rule_next_column' was updated to: {STRING(Concat|{USERVAR(rule_table_name)}|{USERVAR(rule_column_name)})}


Setting translate to constant does force the translation of the VC variable but these are not constants and as they loop round the value will change and from reading the help info I believe this should not be required

I did see that the 6.1.2 made mention of a fix for a problem in the set variable task - would this be the same issue ?

I have attached some screen shots -
Brett attached the following image(s):
Sponsor
Forum information
Support
2012-07-02T13:36:38Z
I do not think this a bug. I think you need to think about what you want to achieve - when, where and how.

You are saying that you both want a dynamic Variable (which has a temporary value of a context) and at the same time a Variable that holds information after? I can't really see the usage scenario and what you are trying to achieve now.

I think the big question is when you want to use a Variable. Let say you want to use the Variable in the current Job. Then you have two options:

1. use the full path {STRING(Concat|{USERVAR(rule_table_name)}|{USERVAR(rule_column_name)})} wherever you want to use this combination
2. store the combination in a temporary Variable just as you do here

I don't see a problem with 2. because every time you use the new Variable it will be translated anyway. So, even though that you see that your Variable was updated to '{STRING(Concat|{USERVAR(rule_table_name)}|{USERVAR(rule_column_name)})}' - every time you use it it will still be translated to whatever it contains.


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Brett
  •  Brett
  • No customer Topic Starter
2012-07-02T21:58:33Z
Hi Support - thanks for the feedback but I believe that there is an issue - it may well be me approach to this but I am still confused over the variable behaviour.

The problem is that it is not translating when trying to store the combination in the variable - it is being shown as setting the variable to the string of the concat command not the translated result - the info message shows

Variable 'rule_next_column' was updated to: {STRING(Concat|{USERVAR(rule_table_name)}|{USERVAR(rule_column_name)})}

when the translate to constant is ticked it shows the message as

Variable 'rule_next_column' was updated to: NAMETITLE_CDE


The job logic is


JOB 1

initialize variable
and other job parameters
call job 2

JOB 2

read parameter loop (table/column /value) - table/column repeats several times

condition if concat of table /column values not equal to the value stored in variable delete from results table for table / column parameters

store concat value of table and column in variable

call job 3


JOB 3

process parameters


The question about checking the Translate to constant - was based on the wording of the help text which states that if ticked - the translation is done once and is then permanent for the remainder of the run - regardless of change.

Quote:

Optional. If you, for example, use a Date Variable in the "Variable value" text box it will be converted to a string when the Variable runs the first time. For example, if you use the current date as a Variable it will always show the current date when running the Task. If this is checked, it will show the current date once and then display the same date in each execution.

Brett
  •  Brett
  • No customer Topic Starter
2012-07-03T04:48:43Z
As an update to this - I went through each of my set variable tasks that was causing problems - edited them to just a blank value - hit ok - went back in and recreated each of the concat statements - this has fixed all the issues I was having.

The statements are identical to what was there before but now work.

do you have any suggestions to avoid these issues - I must be causing this issue in the way I am going about constructing my jobs/tasks.

At what point is the set variable statement linked to the user variable itself - at run time or when the task is coded.

Thanks again for the feedback on this - I am still on the learning curve I think.

Brett


Support
2012-07-03T07:18:57Z
Hi Brett,

the Set Variable only sets the Variable when being run. Before that you are only telling it that next time it will be run the Variable should be this value.

Hard to say how to avoid problems like this. I am not sure what the initial problem really was. There is a lot to learn in the beginning of using VisualCron and Variables are quite complex. I think you are past the bumpy roads now 😁
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top