Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline rdiesel  
#1 Posted : Monday, April 19, 2010 6:12:33 PM(UTC)
rdiesel

Rank: Paid support

Joined: 4/6/2010(UTC)
Posts: 22
Location: Cape Town

Hi

First off, could you kindly clarify the runtime scope of user variables defined via the client interface. If 2 jobs are running concurrently and one job changes the value of a variable will this changed value be visible to another job or do i need to use the "Translate to constant when running" to prevent the other job from seeing the changed variable.

Also I am having trouble accessing the variable values at runtime via the API...



Code:
      Client vcClient = new Client();

            Connection vcConn = new Connection();

            vcConn.ConnectionType = Connection.ConnectionT.Local;

            Server vcSvr = vcClient.Connect(vcConn, true);

            UserVariableClass uvCls = vcSvr.Variables.Get("AirtimeStockImportLog");

            string ascVal = new ASCIIEncoding().GetString(uvCls.ValueObject);


the uvCls.Value returns a .Net byte[] type which I cannot decode. Also if i wish to set the value of the Variable programatically how should the value be encoded?

regards
Offline Support  
#2 Posted : Monday, April 19, 2010 6:15:13 PM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,300

Thanks: 566 times
Was thanked: 321 time(s) in 309 post(s)
That value is encrypted. You should use the ToString method on this method:

GetVariableValue
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline rdiesel  
#3 Posted : Monday, April 19, 2010 7:07:31 PM(UTC)
rdiesel

Rank: Paid support

Joined: 4/6/2010(UTC)
Posts: 22
Location: Cape Town

Thanks, have been able to retrieve the value, But have just tested (5.5.5) and it seems that these are global variables ie. if a task in Job x uses and changes the global variable, then another task in Job y will see the changed value - which makes life fairly difficult in creating generic jobs!

Also what is the meaning of "Translate to constant when running"
Offline Support  
#4 Posted : Monday, April 19, 2010 7:11:37 PM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,300

Thanks: 566 times
Was thanked: 321 time(s) in 309 post(s)
Yes, those are global Variables so they can be reused easily. But that should not stop you for creating unique Variables based on Job Id or similar in the key.

"Translate to constant when running..". Let say you use a current date variable within a user variable. If that box is not checked it will always retrieve the current that - if checked it will be turned into a string (same date as running) and keep that same string.
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline rdiesel  
#5 Posted : Monday, April 19, 2010 7:55:57 PM(UTC)
rdiesel

Rank: Paid support

Joined: 4/6/2010(UTC)
Posts: 22
Location: Cape Town

Thanks, the JobId prefix will solve my problem.
Offline Luke Watson  
#6 Posted : Friday, January 2, 2015 3:26:11 PM(UTC)
Luke Watson

Rank: Paid support

Joined: 10/2/2013(UTC)
Posts: 3
United States
Location: NJ

Originally Posted by: Support Go to Quoted Post
That value is encrypted. You should use the ToString method on this method:

GetVariableValue


I am trying to get the value of a Job Variable, but the only reference i can find to GetVariableValue is "VisualCronAPI.Variables._Variables.GetVariableValue" and it requires a UserVariable, not a JobVariable.

we are on version 7.0.5, im sure im just doing something simple, but i cant find anything on search either.

Many thanks
Offline Support  
#7 Posted : Monday, January 5, 2015 10:44:26 AM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,300

Thanks: 566 times
Was thanked: 321 time(s) in 309 post(s)
If it is a Job Variable you should use;

serverObj.Jobs.JobVariables.GetValue()
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2016, Yet Another Forum.NET
This page was generated in 0.300 seconds.
Scroll to Top