Solved

Process flow decision seems to ignore the outcome

  • 28 October 2021
  • 3 replies
  • 118 views

Userlevel 4
Badge +5

I have a question regarding the decision task. I created a small process flow that needs to execute the create wallet task based on whether or not a variable has been set. (see diagram) 

 

 

In order to get this result I have implemented a decision activity and corresponding process functionality. But no matter the outcome it always seems to execute both tasks. 

 

declare @has_wallet bit = 0;

set @has_wallet = (
select coalesce((
select 1
from wallet_employee we
where we.location_id = @location_id
and we.employee_id = @employee_id
), 0)
)

if @has_wallet = 1
begin
-- wallet available
set @has_wallet_execute_task_create_wallet = null;
set @has_wallet_execute_task_create_employee_lunch_transaction = 10;
end
else if @has_wallet = 0
begin
-- no wallet available
set @has_wallet_execute_task_create_wallet = 10;
set @has_wallet_execute_task_create_employee_lunch_transaction = null;
end

I've tried setting them to null, 0 and -1 but it doesn't seem to matter. I assume that I've probably done something wrong. So here's the question, how do I get the decision to work properly? 

icon

Best answer by Kasper Reijnders 2 November 2021, 14:26

View original

3 replies

Userlevel 7
Badge +23

Hi Kasper,

This should just work fine:

if @has_wallet = 1
begin
-- wallet available
set @has_wallet_execute_task_create_wallet = 0;
set @has_wallet_execute_task_create_employee_lunch_transaction = 1;
end
else if @has_wallet = 0
begin
-- no wallet available
set @has_wallet_execute_task_create_wallet = 1;
set @has_wallet_execute_task_create_employee_lunch_transaction = 0;
end

But no matter the outcome it always seems to execute both tasks. 

In your process flow that also kind of happens, although Create wallet happens before Create employee lunch transaction. The decision step should not do both steps if one arrow is 0 and the other one 1.

Are you using this process flow in Universal/Windows GUI via SF or via IAM? Maybe the application in IAM does not have an up-to-date process flow design therefore choosing other paths than you would like?

Userlevel 4
Badge +5

Both Windows GUI via SF as well Universal via SF. Is there a possibility to take a look at it via teams/slack? Maybe at the beginning of next week? 

Userlevel 4
Badge +5

Upgrading the database to the latest version solved the issue.

Reply