Skip to main content
Solved

Workflow Expression != null

  • Nov 17, 2024 7:02 PM UTC
  • 9 replies
  • 472 views

Forum|alt.badge.img+10

I have a condition on my or gate, when value is not null then …

The condition is not respected, any idea why please?

 

 

 

Thank’s in advance

Best answer by dsj

Hi ​@IFSRUNINNOVAL 

I usually do the validations in a script before reaching the gate. it helps to build complex validations and keep the gate conditions clean, and work :D

 

For your scenario, use a script like this

 

In the gate, use the isValid variable as the condition

 

Valid path:

Invalid path

Hope it helps!

Damith

View original

9 replies

Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Nov 17, 2024 7:51 PM UTC

have also tried the below, but it didn’t worked : 

 

if (execution.getVariable('DiscountAmount') !== null) {
true;
} else {
false;
}

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Nov 17, 2024 8:02 PM UTC

I made a simple workflow to test manually and i’m having the same problem

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Nov 17, 2024 8:04 PM UTC

​@dsj ​@kamnlk ​@Lahirumala de Mel  if you have any ideas i will be greatfull 

 

 

Thank’s in advance 


Forum|alt.badge.img+9
  • Hero (Employee)
  • Nov 18, 2024 6:52 AM UTC

Hi ​@IFSRUNINNOVAL ,

I quickly tried this scenario, and it seem to work for me

 

 

what it the condition you have for the other branch of that gateway ? if that is also true for this variable value that could cause issues with picking up the correct path to follow 

 

there is another alternative syntax you can use for expressions in these scenario 

${execution.getVariable("demoAmount") != null}

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Nov 18, 2024 7:05 AM UTC

​@kamnlk and if you try demoAmount with no value will it work also please?

already tried the Execution.getVariable :/ 


Forum|alt.badge.img+9
  • Hero (Employee)
  • Nov 18, 2024 7:10 AM UTC

Hi ​@IFSRUNINNOVAL ,

Yes it should also work in that scenario as well 

 

scenario1: variable is not declared

 

scenario 2 : variable value is null 

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Nov 18, 2024 7:13 AM UTC

thank you ​@kamnlk mabey it’s related to my environment :/


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • Answer
  • Nov 18, 2024 11:19 AM UTC

Hi ​@IFSRUNINNOVAL 

I usually do the validations in a script before reaching the gate. it helps to build complex validations and keep the gate conditions clean, and work :D

 

For your scenario, use a script like this

 

In the gate, use the isValid variable as the condition

 

Valid path:

Invalid path

Hope it helps!

Damith


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • Nov 18, 2024 8:16 PM UTC

​@dsj thank’s.

Good idea!