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?