ReFramework Variable getting reset

Within the Process I am calling a workflow called, Process Email.
Now I need to maintain the count of Pass and failed while processing email.
so within “Process Email” I am setting it’s value based upon IfElse condition logic.
but it’s value getting reset when it’s coming again under “Process Email”.
I tried creating variable on main page and scope is General Business Process but this variable is not displaying under “Process Email” Workflow. Any solution please

Hey @c3f1e68294fdcf4a1f0a817ca,

As per your title, I assume that the Process you are referring to, is the ReFramework one, therefore:

1- You mention that you want to keep the count of Pass and Failed, therefore I’m assuming that you will have 2 INT variables within your “Process Email” workflow.

2- Make sure that those 2 variables are also created in the Main.xaml, with the same variable type.

3- When #2 is done, you need to go to the Process.xaml and repeat the same steps, therefore it should look like this:

  • Main.xaml = int_EmailPass + int_EmailFailed / Variables initialized during init at 0
  • Process.xaml = io_int_EmailPass + io_int_EmailFailed / Arguments
  • ProcessEmail.xaml = io_int_EmailPass + io_int_EmailFailed / Arguments

4- When your variables and arguments look like the structure above, you need to correctly link them. On the main, look for the “Invoke Process.xaml” and link its arguments as follows

  • io_int_EmailPass = int_EmailPass
  • io_int_EmailFailed = int_EmailFailed

5- Same between Process.xaml and ProcessEmail.xaml

  • io_int_EmailPass = io_int_EmailPass
  • io_int_EmailFailed = io_int_EmailFailed

This way, whatever you change on the 3rd level (ProcessEmail.xaml) will go up until Main.xaml, and re-feed so that on the next iteration, it still has the updated value.

Hope this helps!

BR,
Ignasi

@c3f1e68294fdcf4a1f0a817ca

Variable scopes are limited to the xaml you created in and it would reset always

Two ways for you

  1. Create a variable and set the scope to global then it can be used in any xaml and will jot be reset.This feature is available in windows compatibility
  2. Other option is to create an argument as in/out and pass the value in and out always to main the value

Cheers

@c3f1e68294fdcf4a1f0a817ca

Initialize a DataTable in the main xaml to store the counts and pass it as an argument to the “Process Email” workflow. Update the DataTable in the “Process Email” workflow and pass it back to the main xaml. Write the counts to a file in the “Process Email” workflow. Where you can read and update this file in the main xaml.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.