ibm-bpm

Why does my IBM BPM Coach Event not fire the JavaScript?


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?


Solution

  • 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.