Find a substring in a row in the gateway

Good afternoon!
I need to check the occurrence of the string in the substring in the gateway.
I do so $ {TEST_STR.indexOf (‘GIS’)! = - 1}
As a result, an error occurred:
Caused by: org.camunda.bpm.engine.ProcessEngineException: Error while evaluating expression: $ {TEST_STR.indexOf (“GIS”)! = - 1}. Cause: Can not coerce ‘GIS’ to class java.lang.Integer

That’s strange. It should work as in https://beginnersbook.com/2013/12/java-string-indexof-method-example/.

But as a workaround you could use ${TEST_STR.contains(‘GIS’)} respectively ${!TEST_STR.contains(‘GIS’)}. This worked for me.

Hi @ntdim1973,

Also as an alternative to @scepbjoern solution, you can use script instead of expression to write condition as follow:

  • Select “Script” as Condition Type

  • Use “JavaScript” as Script Format (You can use other supported script languages like Groovy)

  • Use “Inline Script” as Script Type

  • Write your condition under Script label as follow
    TEST_STR.indexOf('GIS') != - 1