Skip to main content
Question

Hello,I am trying to find what the syntax error is in this simple line of code:FILTER MATCH_PROCESS_REGEX("_CEL_P2P_ACTIVITIES"."ACTIVITY_EN",'Release Purchase Order' >> (ANY)* >> 'Delete Purchase Order Item')

  • November 24, 2021
  • 6 replies
  • 24 views

Error Message states "Syntax error near [FILTER] after reading [] at line 2. Please refer to PQL documentation for available syntax.

 

According to my understanding of the documentation, this should work.

 

Thanks in advance.

6 replies

gabriel.okaba11
Celonaut
Forum|alt.badge.img+2

Hi Erwan,

MATCH_PROCESS_REGEX matches the variants of a process based on a regular expression. The regular expression defines a pattern over the activities of the variant. It returns an INT value which is 1 if the variant matches the pattern or 0 if it does not match.

 

Therefore, you need to use

FILTER MATCH_PROCESS_REGEX("_CEL_P2P_ACTIVITIES"."ACTIVITY_EN",'Release Purchase Order' >> (ANY)* >> 'Delete Purchase Order Item') = 1;

 

to make It work

 

Best,

Gabriel


gabriel.okaba11
Celonaut
Forum|alt.badge.img+2

Hi,

you could also use PROCESS EQUALS for less complex process path.

 

FILTER PROCESS EQUALS 'Release Purchase Order' to ANY to 'Delete Purchase Order Item';

 

Now, if the order does not matter, MATCH_ACTIVITIES flags cases with certain activities without taking the exact order of activities into account. 

find more on Help resources

celonis.cloud/help/display/CIBC/PROCESS+EQUALS

celonis.cloud/help/display/CIBC/MATCH_PROCESS_REGEX

celonis.cloud/help/display/CIBC/MATCH_PROCESS

 

Best,

Gabriel


Forum|alt.badge.img+12

Hi @erwan.bégoc 

 

The below syntax should work.

 

FILTER MATCH_PROCESS_REGEX ( "_CEL_P2P_ACTIVITIES"."ACTIVITY_EN",'Release Purchase Order' >> (ANY)* >> 'Delete Purchase Order Item')  = 1;

 

You can also use other PQL function for the same.

 

For eg:

 

PROCESS EQUALS

 

PROCESS EQUALS matches the variants of a process based on simple expressions. 

 

The generic syntax for Process Equals is as below.

 

FILTER PROCESS EQUALS 'A' to ANY to 'C';

 

So for your use case A is Release Purchase Order' and C is 'Delete Purchase Order Item

 

 

MATCH_PROCESS

 

MATCH_PROCESS matches the variants of a process against a given pattern.

Similar functionality is provided by MATCH_PROCESS_REGEX.

MATCH_PROCESS uses Nodes and Edges to match the cases. Nodes consist either of a single activity or a list of activities. Edges describe how the nodes are linked together.

 

 

FILTER

  MATCH_PROCESS (

    "Activities"."ACTIVITY" ,

    NODE [ 'A' ] as src ,

    NODE [ 'B' ] as trg

    CONNECTED BY

    DIRECT [ src , trg ]

  )

  =

  1;

 

So here  MATCH_PROCESS combined with a filter. The result are only cases in which one activity A is followed by activity B.

 

So for your use case it is Release Purchase Order' followed by 'Delete Purchase Order Item

 

 

Hope it helps.

 

Happy Learning!

 


  • Level 0
  • November 25, 2021

Hi,

 

In case the order of activities is not important MATCH_ACTIVITIES is the best way to identify cases with the condition.

 

Best,

Kevin


gabriel.okaba11
Celonaut
Forum|alt.badge.img+2

MATCH_ACTIVITIES does not respect the activity sequence so it needs to be either PROCESS EQUALS, MATCH_PROCESS or MATCH_PROCESS_REGEX


  • Author
  • Level 4
  • November 26, 2021

Thank you for all your answers!