Check for not null and length > 0 in FEEL

Hi,

I have a simple requirement where in I need to convert this logic to feel expression to set a variable

if((execution.getVariable(“phnMobilePhnNum”) != null && execution.getVariable(“phnMobilePhnNum”).toString().trim().length() > 0))

{

  execution.setVariable(“phnNumber“, phnMobilePhnNum);

}

else if (execution.getVariable(“phnHomePhnNum”) != null && execution.getVariable(“phnHomePhnNum”).toString().trim().length() > 0)

{

  execution.setVariable(“phnNumber“, phnHomePhnNum); 

}

In Zeebe, I am trying to set atleast the first part of phnMobilePhnNum as FEEL Expression but I see an error in deployment.

How can I set the variable using feel expression for a simple null and length check of >0 .

Hi @hari_kiran

How can I set the variable using feel expression for a simple null and length check of >0 .

Give it a try with: if phnMobilePhnNum != null and string length(string(phnMobilePhnNum)) > 0 then true else false

Regards,
Alex

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.