E9.2 Custom NER Not Returning Values

Jeff George

Jeff George

Well Known Member
I am using a custom NER that's part of an application. I have modified an Event Rule in the Interactive Application using this NER, passing a new Processing Option value as part of the input parameters. The NER returns a number of values to variables. I have not modified the NER; I've simply added an additional parameter. During program execution after processing this NER I see that the variables are not populated. I think this is causing issues further down the road because it's turning execution back over to the user instead of creating grid column headers that would normally be created by those variables. The user puts in their criteria and clicks Find. The next time the application processes this NER I get a Web Client Exception error, but nothing is in the logs, so I'm not sure what to do next or what specifically is causing the exception.

As I said, I have not modified the NER, though I did rebuild it just in case it would make a difference. It didn't. I've also used ObjectBrowser to test the NER, using the same parameters that the program is passing, and is successfully returns the variables. I don't know why it's not doing it during program execution.
 
You probably didn’t set the “arrows” in the data structure/ NER argument list to ro allow returning values.
 
You probably didn’t set the “arrows” in the data structure/ NER argument list to ro allow returning values.
Larry, wouldn't that mean then that I wouldn't see the return values when testing in ObjectBrowser? For reference, here's what I see in ObjectBrowser, and I don't think there are issues with the arrows since I didn't touch them.

1682528468360.png
 
If NER is working correctly thru Object browser then the issue might be with Application and spec. Are you sure you get the Processing option values populated in the application? If that is not issue then it would be spec issue related to NER that you are using or any other function that the application is using during the process.
You didn't mention where you are testing the application but i think you are testing it on server since you said you had it build.

I would recommend you get all the spec locally on your Fat client and then run the app locally and check how it behaves.
 
If NER is working correctly thru Object browser then the issue might be with Application and spec. Are you sure you get the Processing option values populated in the application? If that is not issue then it would be spec issue related to NER that you are using or any other function that the application is using during the process.
You didn't mention where you are testing the application but i think you are testing it on server since you said you had it build.

I would recommend you get all the spec locally on your Fat client and then run the app locally and check how it behaves.
Actually, I'm testing it locally. Here's another screenshot. This is from the debugger. It shows that the variables are not populated after the NER runs. I can confirm that because it should be going to the next Event Rules and assign the grid columns. However, processing returns to the user and the grid column names are not assigned. I'm sure I've done something incorrectly, but I'm just sure what it is.

1682540935208.png
 
Do you have an OCM override to ensure the NER is also running locally?
 
Do you have an OCM override to ensure the NER is also running locally?
Kim, I haven't checked explicitly, but in all other cases I've had no other issues with NERs running locally. Wouldn't it have failed in ObjectBrowser, as well, if it was unable to run locally?
 
Things to try:

1. Rebuild NER
2. Make sure you exit JDE and that your local JAS client is stopped (if auto starting/stopping - I like to manually stop and start, if you do as well then stop/start local JAS)
3. Log back into JDE, make some small change to the APPL and save it so it will "reload" in your local JAS. I have had instances where changes didn't re-jiti or reload into my local JAS client after making changes in FDA. For a small change I might simply change the size of one of the forms by a pixel, save, change back save. Just enough so it gets a new "version". You could do something similar with the NER/DS as well and Proc Opt template.
4. If you are using the ER debugger be sure to completely remove and re-add the APPL from the debugger.
5. If you changed the PO template try creating a new version and testing with that instead of reusing an old version.

Since it works through Object Browser, my guess is that it's not a problem with the NER. But you can confirm this by debugging it with Visual Studio. Simply put a break point on the final closing bracket of the function and inspect the lpDS param values to see what they are set to right before function exit. You can also do this to confirm that the function is in fact running locally when called from the APPL. You could also set a breakpoint on the opening bracket of the function to review what is passed in the parameter bound to the PO member in question.

It could be a whole host of other things as well. For example, if this is a power form and the column headings are in a grid in a reusable subform, the parent form's PO values are not available to the reusable subform even though it appears they are in FDA. You will get a Web Client exception in this case as well if you try to use the PO values - I have done this multiple times and forget it every time as I spend countless hours trying to track it down.

Which event are calling the function from, and I assume, setting the column heading values? To rule out the NER you could disable the ER code that uses the returned values to set the column headings and see if you still get a Web Client Exception when just calling the NER. Then do the opposite. Hard code the ER vars and set the column headings and disable the NER call and see if you still get a Web Client Exception.

Does the Web Client exception explicitly state there is a problem calling the function? You say there is nothing in the logs but make sure you look in the JAS logs, not just the jde.log or the jde debug log. Every JAS web client exception I have ever investigated has also been logged in the JAS logs. You may have to adjust what gets logged in the jas log by looking at the jdelog.properties file found in the local JAS to make sure that, at a minimum, the lowest logging level is enabled.
 
It could be a whole host of other things as well. For example, if this is a power form and the column headings are in a grid in a reusable subform, the parent form's PO values are not available to the reusable subform even though it appears they are in FDA. You will get a Web Client exception in this case as well if you try to use the PO values - I have done this multiple times and forget it every time as I spend countless hours trying to track it down.
This one immediately caught by eye as it's exactly the situation that I am experiencing. This is a subform of the parent form, so I'm thinking I'm running into the situation you've experienced yourself. How would you recommend getting that PO value into the subform for the NER? Would it be some kind of SI or FI?
 
This one immediately caught by eye as it's exactly the situation that I am experiencing. This is a subform of the parent form, so I'm thinking I'm running into the situation you've experienced yourself. How would you recommend getting that PO value into the subform for the NER? Would it be some kind of SI or FI?
BOster, you nailed it! I changed the PO parameter to an SI parameter and it immediately resolved the issue. That's an important piece of data to know, i.e. you can't pass a PO to a subform.
 
Glad you figured that one out because there is nothing in FDA or anything else that indicates you can't do that. I can't remember exactly how it appears in the JAS log but it is usually when I get around to enabling and looking in the JAS log that I (re)figure this out. Like I said I have done this multiple times and never learn.
 
Glad you figured that one out because there is nothing in FDA or anything else that indicates you can't do that. I can't remember exactly how it appears in the JAS log but it is usually when I get around to enabling and looking in the JAS log that I (re)figure this out. Like I said I have done this multiple times and never learn.
BOster, how would you pass that value to another subform? This application goes from one subform to another, but when it gets to the second one the SI value from the PO that worked on subform 1 is no longer there, and I can't seem to set an expression in that 2nd subform that says that the SI = the PO.
 
Assign the PO value to a variable and pass that down to the subform.
 
Assign the PO value to a variable and pass that down to the subform.
This is where my lack of experience shows itself. It appears to me that the P.O. creates a local event variable for the initial form that goes out of scope once a subform is called. If I could just use that variable, I would use that as a BSFN parameter in the subform, but that variable doesn't exist there, so I'm using an SI. How can I maintain the variable created by the P.O. within the subforms? I was hoping I could make it global, but there doesn't seem to be a way to do that in the Processing Option Template designer.
 
Create a form variable for any value you need to pass to the subform. Assign the PO values to these variables in the main form at initiation, then use these variables as the connection to the subform in the mapping. The paradigm of having a reusable subform has obfuscated logic we are used to. Just my thought.
 
Create a form variable for any value you need to pass to the subform. Assign the PO values to these variables in the main form at initiation, then use these variables as the connection to the subform in the mapping. The paradigm of having a reusable subform has obfuscated logic we are used to. Just my thought.
I think that's what I already did. I took my Processing Option and assigned it to a form-level variable in the Dialog is Initialized event of the parent form. However, as soon as processing passes to the subform this variable is no longer populated because it's only for the parent form. That's another reason I've ended up using a Subform Interconnect for that item to pass to the BSFN in the subform. How would I maintain access to the original value in the subform?
 
The SI variable should retain its value in the Subform once it is set by the Parent and a notification sent to the Subform, so any events that happen in the Subform can always use this SI variable for the life of the Subform. Its NOT like the SI is only in scope for the Notified by Parent event.

BTW if you think about it, it kind of makes sense that the PO values are not available to the Reusable Subform (keyword Reusable). In practice 99% of the time these Subforms are only used within one APPL with the main feature really being around the ability to have multiple grids on one form. However, there have been times when I have created truly "Reusable" Subforms and have used them in multiple APPLs so binding the PO values for a specific APPL just wouldn't work. The real issue is that FDA will let you use PO values in ER code in the Subform.
 
The SI variable should retain its value in the Subform once it is set by the Parent and a notification sent to the Subform, so any events that happen in the Subform can always use this SI variable for the life of the Subform. Its NOT like the SI is only in scope for the Notified by Parent event.
This makes sense and is what I would expect to happen. However, when execution passes from one child subform to another child subform of the same parent, the SI value becomes 'unknown', resulting in the NER failing. It's the same NER used in the first child child subform, but the SI value is not being maintained when the next subform is called.
 
If you are not already doing this, try making sure to pass this parameter as input only from the parent form to the subform(s).

Capture.PNG


Having said that I would NOT think it would matter, unless one of the subforms is somehow updating the SI and notifying the parent. A subform would have to call the system function "Update Parent" to update the param bound to the SI in the parent form for this to occur which, I guess, theoretically could be happening.

I will say I don't believe I have ever bound a PO param to an SI directly. I think in this case I would create a form scoped event variable in the parent and set it during parent form init and bind that ER variable to the SI. Again, I don't think this should matter but that might solve your problem.

If you are using Notify Child<All Children> you can also try notifying each child individually instead. I have sometimes found that to be necessary - but usually in an "explainable" way, as in I need to tightly control the sequence in which the various subforms are notified and process the parent notification event. If nothing else you might discover which subform is changing the value to null/unknown.
 
There's no Notify Child<All Children> involved, but I'm still trying to grasp the concept of passing things from a parent to child.

Here's what I'm dealing with as a parent/child structure (one parent with two children):

1682950021214.png

When I select the properties of the 2nd child (highlighted), I get the following:

1682950078644.png

I don't seem to have the parent form variable that the P.O. was assigned to available for mapping to this child. I'd hate to have to turn this over to our managed services for something that is probably simple but just beyond my thought process.
 
Back
Top