Mark_RB Frequent Contributor.
Frequent Contributor.
455 views

BUG: HP OO 10.50 - Setting an invalid response with JavaScript Nashorn causes an exception to be thr

Hi,

I have a slightly irritating bug to report...  I have various custom operators which suffer from this same issue.  It is easy to reproduce:

Create The Operator

  1. Create a new operation.  Select the operation to import: 'com.hp.oo:oo-base-plugin: 1.8.0' --> 'No Action Taken'
  2. Add an input 'myValue', set it to 'Prompt User',
  3. Add the following responses 'test1', 'test2', setting both to be of a type other than red cross.  Ensure 'Default' and 'On-Fail' are not ticked.
  4. Add a 'failure' response.  Ensure that 'Default' and 'On-Fail' are ticked.
  5. Add the following in as the scriptlet:
    scriptletResponse = "" + myValue;
  6. Set the script Type as 'JavaScrpit Nashorn'.

Test The Operator

  1. Create a flow and add the operator.
  2. Wire-up the responses.
  3. Run the operator.  When prompted, enter 'test1'.
  4. The operator will choose the test1 response.
  5. Repeat the test and enter 'test3'.  The flow will fail hard, with the following exception, rather than following the 'failure' response:

com.iconclude.dharma.runengine.RunException: Exception occurred during navigation calculation. Did not find Flow Exception Step id.
at com.iconclude.dharma.runengine.view.BeanViewBuilder.updateRunView(BeanViewBuilder.java:524)
at com.iconclude.dharma.runengine.view.DefaultRunViewFactory.updateView(DefaultRunViewFactory.java:61)
at com.iconclude.dharma.runengine.debugger.RunControlImpl.onEvent(RunControlImpl.java:236)
at com.hp.oo.studio.debugger.engine.AbstractDebugRunEventsChannel.notifyListeners(AbstractDebugRunEventsChannel.java:50)
at com.hp.oo.studio.debugger.engine.AbstractDebugRunEventsChannel.processFinishEvent(AbstractDebugRunEventsChannel.java:102)
at com.hp.oo.studio.debugger.events.StudioDebuggerEventsBuffer.processFinishEvent(StudioDebuggerEventsBuffer.java:98)
at com.hp.oo.studio.debugger.engine.AbstractDebugRunEventsChannel.processEvent(AbstractDebugRunEventsChannel.java:83)
at com.hp.oo.studio.debugger.events.StudioDebuggerEventsBuffer$DebuggerEventsConsumer.run(StudioDebuggerEventsBuffer.java:120)
Caused by: java.lang.Exception: Exception occurred during navigation calculation. Did not find Flow Exception Step id.
... 8 more

Workarounds

There are two workarounds for this:

  1. Switch the operator JavaScript Rhino,
  2. Use the following code snippet, to catch the exception:

 

try {
scriptletResponse = "" + myValue;
} catch (e) {
//Nothing is required in the catch block.
}

 

 

Regards,

 

Mark.

Labels (1)
Tags (2)
0 Likes
1 Reply
CEPIX Absent Member.
Absent Member.

Re: BUG: HP OO 10.50 - Setting an invalid response with JavaScript Nashorn causes an exception to be

Reason of failure:
When using scriptletResponse = “anything” and the response “anything” does not exist for the step.

Possible solutions :
-Create “anything” response
-Delete the sentence
-Correct the sentence to scriptletResponse = “some_response_which_exists”

Other insights I’ve learned about this error:

• It is not operation-related (It will happened using any operation)
• This is an Exception handling error by the Javascript engine which executes scriptlet code (Rhino).

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.