0

I am writing an IBM BPM Coach using the 8.5.7 2017.06 release and am creating an event handler that looks like:

\\ Hide the dialog
${MyDialog}.setVisible(false);

\\ Execute the service
${MyService}.execue();

However when the event happens, nothing is executed?

Kolban
  • 13,794
  • 3
  • 38
  • 60

2 Answers2

1

When we create a script that runs within the Coach, even though the Process Designer entry shows multiple lines with content assist, when the script is saved and then subsequently executed, the code is "strung together" as a single line. So the code:

// Hide the dialog
${MyDialog}.setVisible(false);

// Execute the service
${MyService}.execute();

becomes:

 // Hide the dialog ${MyDialog}.setVisible(false); // Execute the service ${MyService}.execute();

And as a result of this, the // becomes the start of a line comment that basically comments out the remainder of the line. The solution is either to not use comments or use the /* and */ comment brackets.

Kolban
  • 13,794
  • 3
  • 38
  • 60
0

Event handler editor misleadingly suggest it is full blown multiline JS code. As you observed this code is evaluated as single line code. It looks to me like BPM editor flaw. If event editor could properly inject \n characters to expression passed further to new Function(expressionString) used by BPM UI (SPARK toolkit) single line comment would work fine. Note also that using carriage return character inside event handler code is also mishandled, at the moment one needs to place \\n to have \n in executed code. See my findings here.

andy
  • 757
  • 5
  • 13