Can one process variable be used as the variable in another process variable?
Let me give some context: I am making a process for an employee when he initiates his resignation, an email will be sent to the HR and his manager.
In this process I have an process variable which store the employee id of current user. Now I want to use this in the email body of the smtp connector where the name of the employee will be sent.
The email is getting generated, however the place for the name of the employee is blank.
Attaching the flow below.
Below is the process variable to get the name of the employee from the employee id
The SMTP input:
Page 1 / 1
Hello Rucha,
This is not possible in a default value expression, because the default value expression is only evaluated once, at the start of the process flow. However, you can achieve this by using a process procedure, which is intended for this purpose.
In the process procedure you can read and set the values of all process variables, so you can do something like this:
set @process_variable_1 = (select my_column from my_table where id = @process_variable_2)
A process procedure is a stored procedure that is fired after a process action has completed. To use a process procedure, check the following checkbox on a process action:
The code group corresponding to process procedures is PROCESSES:
I hope this helps.
Hi Vincent, Thanks for the reply. I tried it , however got below error:
Hi Rucha,
You may need to Generate the Processes code group; or execute the Generate definition process. This will make sure that the code will get the process variables of the process flow. Thereafter your code can be deployed successfully.
Thanks Mark, however its coming after I executed Generate . I have applied it on the Decision process action.
Can you make sure these options are selected?:
This will make the variables available (after Generate code group):
Yes they are both checked for the 2 variables I am using.
Hello Rucha,
After adding a process variable or changing any of the checkboxes in the Performance tab of Process variable, you will have to generate the PROCESSES code group in the Assigning tab of Control Procedure.
Can you try this and then press the Generate button in the Result tab again?