How to share session variables with the timer

How to share session variables with the timer

  

Hi,

I have a asynchronous web service that sends an email, this web service gets a request.

In my flow I need to run this action and not wait for the response.

Therefore I created a timer that run the action: SendEmailForSaveForLater.



This action dont recieve parameters but it run the web service and the request is taken from a session variable.

The problem is that the session variable is empty while the timmer is running.

How can I manage to share the session variable with the timer?

Hi Shirly,

Since asynchronous logic such as Timers run on a separate session, this means that when executing the action associated with the timer, all session variables will have their default value. This explains why your session variable is empty while timer is running.

You can try to store the info you wish to access in the timer in a temp table.

Check this link for more related info.

Hi,

Thanks for the reply.

If I sotre the data in a table, when the timer run I need to get the data by some id.

Beacause a lot of users can trigger this timer, How can I know what to take from the table?

I don't know your business logic, but you have to create a link the with the context you are working. For example, if the email is sending info about an approved offer for a user, you can query by the offerId and the UserId as unique key of you temporary table (you should find the one that suits your logic).

André Siébra wrote:

I don't know your business logic, but you have to create a link the with the context you are working. For example, if the email is sending info about an approved offer for a user, you can query by the offerId and the UserId as unique key of you temporary table (you should find the one that suits your logic).

Yes off course, I understand.

But how the timer will know which id to take?

When the timer run he needs to take a row from the table by some id that relates to the one who wake him up.

I will describe the situation:

There is a page that creates a new entity and insert it to the some table, afterwords I use wake timer.

When the action of the wake timer performs, how can he know which row to take.

In this application many users can invoke the timer, each timer needs to know which client invoke him.

I have the same issues.. may be the question is when to give unique argument value to the Timer? Or where/when the argument is assigned a value such that the Timer action know that value?.. after login?..or else?

It is because the action input argument is not called when the timer is awaken, but defined in the Timer process at designed time.

Id = createentity..

Wakeuptimer...

The variable  id is not known at design time?


Thank you,

Ib