| | | Supreme Being
       
Group: Forum Members Last Login: Monday, February 15, 2010 Posts: 47, Visits: 138 |
| When I update variable in script action I cn not see the new value in the next action you can see that in the attached file
I use the variable the in subject of information action but it take the old value
|
| | | | Supreme Being
       
Group: Forum Members Last Login: Thursday, January 12, 2012 Posts: 93, Visits: 121 |
| | Suhail, The cause for the issue is you need to use ctx.Variables.Item option in the script instead of ctx.Variables. Your script Imports System Imports Workflow.NET Imports Workflow.NET.Engine Imports System.Collections public class WorkflowScriptjiko public function Run(exid as Int32, exdid as Int32, ctx as Context, a as Action, inlinkop as String) as String ctx.Variables("emp").Value="hh" ctx.log.LogInformation("jikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkoooooooooooo" & ctx.Variables("emp").Value.ToString()) return "" end function end class Working one:
'Sample VBScript.NET code. Imports System Imports Workflow.NET Imports Workflow.NET.Engine public class WorkflowScript5ef16175cc2e4db4b5208476c1b30c86 public function Run(exid as Int32, exdid as Int32, ctx as Context, a as Action, inlinkop as String) as String ctx.Variables.Item("emp").Value="SriSkelta" ctx.log.LogInformation("jikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkoooooooooooo " & ctx.Variables.Item("emp").Value.ToString()) return "" end function end class Also, find attached the simulated workflow definition xml (remove .txt extension) and the output snapshot as a jpg. Cheers, Sri
|
| | | | Supreme Being
       
Group: Forum Members Last Login: Monday, February 15, 2010 Posts: 47, Visits: 138 |
| thank you but my problem is not because of using item( I can see the result in log files but I can not see the new value for the variable emp in the next action |
| | | | Supreme Being
       
Group: Forum Members Last Login: Thursday, January 12, 2012 Posts: 93, Visits: 121 |
| | Alright! Can you share the information/snapshot where you can see the result in log console? Also share the latest workflow definition xml file? Btw, Did you get a chance to import the workflow which I have shared and test the scenario? Share your views on this. Cheers, Sri |
| | | | Supreme Being
       
Group: Forum Members Last Login: Monday, February 15, 2010 Posts: 47, Visits: 138 |
| I cannot import your workflow Invalid XML workflow definition
but I tried the same code you write i use skelta2004 |
| | | | Supreme Being
       
Group: Forum Members Last Login: Thursday, January 12, 2012 Posts: 93, Visits: 121 |
| | | | | Supreme Being
       
Group: Forum Members Last Login: Thursday, January 12, 2012 Posts: 93, Visits: 121 |
| Btw, can you try adding ctx.SaveVariables() line of code in your script code and then try the scenario?
For example: ctx.Variables.Item("emp").Value="HIIII" ctx.SaveVariables() return "OK"Cheers, |
| | | | Supreme Being
       
Group: Forum Members Last Login: Monday, February 15, 2010 Posts: 47, Visits: 138 |
| | | | | Supreme Being
       
Group: Forum Members Last Login: Thursday, January 12, 2012 Posts: 93, Visits: 121 |
| | Great. Glad to hear that the issue is resolved and the information provided earlier was apt for your scenario. Cheers, |
| | | | Supreme Being
       
Group: Forum Members Last Login: Thursday, September 15, 2011 Posts: 20, Visits: 47 |
| | Do you have the C# equivalent to the above code. I'm having the same problem, but I do not have an "Item" property to choose. |
| |
|
|