Active IQ Unified Manager Discussions

WFA - Conditional Approval Point syntax string contains

ChadPruden
3,914 Views

I've been unable to find an answer to this question.

 

What syntax should I use for the execution condition?  I'd appreciate any links to resources which might have more details on the types of comparison operators that are supported in this field.

 

My objective is to pause any requests which contain words that we flag as "not what we intend this service for".

 

approval-point.png

 

WFA 4.1 RC

1 ACCEPTED SOLUTION

sinhaa
3,845 Views

@ChadPruden

 

You need to do the following..

 

Go to Designer ->Functions and Create a new function with the below code.

 

function endsWithbackup(word)
{
 
import java.util.regex.*;  

return Pattern.matches(".*backup",  word);  

}

Save it.

 

 

now in your workflow provide the condition for approval point like below. MVEL Auto-complete will list this function now.

 

 

Approval Point.png

 

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

3 REPLIES 3

anuk
3,868 Views

Hi,

     

  Execution condition is a Mvel expression enabled field. You can follow Mvel Expression syntax while providing the value to this field.  Help link is provided in the Approval Point dialog to learn more about Mvel expression and its Syntax.  I have attached a screenshot for the same. 

 

 

ConditionalExpression.png

 

Thanks and Regards

Anu

 

 

sinhaa
3,846 Views

@ChadPruden

 

You need to do the following..

 

Go to Designer ->Functions and Create a new function with the below code.

 

function endsWithbackup(word)
{
 
import java.util.regex.*;  

return Pattern.matches(".*backup",  word);  

}

Save it.

 

 

now in your workflow provide the condition for approval point like below. MVEL Auto-complete will list this function now.

 

 

Approval Point.png

 

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

ChadPruden
3,813 Views

Thanks for the response!  I took your sample code and ran with it.  Here is what I'm using.

 

function VolNameBlackList(word)
{
// Returns TRUE if string contains any of the following keywords. Case Insensitive (?i)

import java.util.regex.*;
return Pattern.matches("(?i).*(backup|bkup|archive|mp3|personal).*", word);
}

Can easily come back and add an additional keywords to flag for approval point / discussion.

Public