Alphanumeric regex in the input

Hi,

I am very new to Camunda.
I have a requirement to where an input field can accept any alphanumeric characters as an input.

I tried [0…9][a…z][A…Z] and I get an syntax error.
Can this be achieved in the DMN itself and not write a seperate code for it

Any help would be really really appreciated

Regards,
Abhi

Hi @abhilash,

starting with Camunda BPM 7.13, you can use more FEEL expressions in a DMN decision table (https://blog.camunda.com/post/2020/03/camunda-bpm-supports-dmn-feel-1.2/).

In this case, you can use the matches() built-in function (https://camunda.github.io/feel-scala/feel-built-in-functions.html#matches) in the input entry. For example,

matches(?, "[0-9a-zA-Z]")

You can try this out with the latest 7.13.0-alpha3.

Does this help you?

Best regards,
Philipp

1 Like

Hi Philipp,

Thanks for your reply.

I tried this matches function in the dmn and tried running in on the simulator.
It gave me an error - FEEL-01010 Syntax error in expression ‘matches(?, “[0-9a-zA-Z]”)’

Attached is the test dmn file i am usingTest.dmn (1.9 KB)

Could you please advise what the issue is in this?

Regards,
Abhilash

Hi @abhilash.

Do you mean the Camunda DMN online simulator?
This tool is not up-to-date.

In order to try this out, you need run the latest alpha of 7.13.0 until 7.13.0 is released.

Hi Philipp,

yes i tried on the online Simulator :slight_smile:

I will try it on the latest alpha of 7.13.0.

Is there any way this can be achieved in the 7.12.x ?

Regards,
Abhilash

Yes, for example, by using the FEEL-Scala engine plugin (version 1.10.1).

Hi @Philipp_Ossler ,

I added the jars, updated the bpm-platform.xml but i am still unable to get the regex work.
Could you please help me as to how i can proceed with this, may be with an example.

Your help will be much appreciated

Regards,
Abhilash

Hi @Philipp_Ossler,

Is there a way we can match anything that is sent as input to the dmn, like a * ?
eg: if I pass 123 I should get a hit, if i pass abc i should get a hit

Regards,
Abhilash

If the input entry is empty then it accepts every input value. Please have a look: DMN Decision Table Rule | docs.camunda.org

Thank you so much @Philipp_Ossler.

This helped my case. :slight_smile:

Thanks again