Business Function to Hold Job on Server for 2 Seconds

edwardkch24

Active Member
Hi,

I would like to ask if there is any business function in EnterpriseOne E9.1 that allows us to hold a job on the server for about 2 to 3 seconds before continuing the job. There's one but it only works on client. Appreciate it if someone could share some knowledge on this.

Thanks
Regards,
Edmamba24
 

edwardkch24

Active Member
Hi Abhishek Chhajer,

I am actually running table conversion in an interactive application on the server. I want to wait a number of seconds for the table conversion to complete running so i can prompt a message form on the interactive application indicating the table conversion is done running.


Thanks.
Regards,

Edmamba24
 

edwardkch24

Active Member
Hi Russell,

I am looking for a BF that allows me to hold the interactive application for a number of seconds for some table conversion to run before it continue its process again.

Thanks.
Regards
Edmamba24
 

RussellCodlin

Reputable Poster
You should be doing as Abhishek has suggested and monitoring the status of the job, not just assuming it will complete in a certain amount of time. For example, what happens if the batch server is busy and doesn't process the table conversion for a minute rather than 3 seconds?

 

edwardkch24

Active Member
Hi All,

Thanks for the advice. I tried that method. When calling table conversion from an interactive application it will call the table conversion then proceed with the rest of the event rules without waiting for it to be completed. The issue here is when i put in a while loop to check for job status in F986110, it gets stuck into a infinite loop. any advice for that? Table conversion will process about 300 transactions into a customised table.

Thanks,
Regards

edmamba24
 

edwardkch24

Active Member
Hi Larry

I am not attending any school for JDE. Everything is learned on my own. I tried the technique mention before hence i need to look for an alternative if it's not working. :)
Appreciate if you can share some insight on this.

Thanks.
Regards

Edmamba24
 

RussellCodlin

Reputable Poster
Hi All,

The issue here is when i put in a while loop to check for job status in F986110, it gets stuck into a infinite loop. any advice for that?

edmamba24

The F986110 is one of those special tables where you need to put in place a data source override to get the appropriate table and values. Be that as it may, your code should handle not finding the record and exiting cleanly rather than just looping infinitely.
 

Abhishek Chhajer

Well Known Member
Ok. Another way. I know it is not clean and efficient, but sometimes it helps.

1) Create a custom table. Insert record in this custom table before your call to TC. Mark Status as P. This record must be inserted from your application.
2) At the process end Event of TC, update record for this custom table with the UKID as D.

In your application, monitor this status by fetching on the status. Give appropriate sleep.
 

johndanter

Legendary Poster
How are you launching the UBE?
System function or BSFN?

Use B91300C to launch the UBE and get the job number back.

Use BSFN B9861101 to override the F986110 datasource (it's a bootstrap table so it's not easy to read from unless you do this)

So.....................

Launch your UBE using B91300C

// add the F986110 datasource override to servermap data source
F986110 DS OVERRIDE (B9861101)
"ServerName" -> szDatabasepath

Call Loop process to read over F986110 and get your job done D record
display the message

// remove the F986110 datasource override to servermap data source
F986110 DS OVERRIDE (B9861101)
"<Blank>" -> szDatabasepath


EDIT: this isn't very DB friendly and i need to do something similar this week

I've decided to pop up a message in the form to say the job has been launched and then get the user to change their USER so they get an email notification when the UBE is done
Or I may edit the End Section to email the user when done

But it's not staying in the screen to notify them as that's a big how long is a piece of string?

Plus the carousel now shows users the state of the UBEs they've launched. Blue for processing, green for done
 
Last edited:

Larry_Jones

Legendary Poster
JDE's toolset architecture doesn't really support things such as callbacks which is what you really need.

Instead don't try to do everything for the user. After submitting the TC and control is returned to the user give them a button to process/view the imported data. If results not there yet popup a form that say "Still processing ... Try again in 30 seconds".

I did a customization to P4310 (PO Entry) which involved creating a exploded Bill of Material (BOM) and attaching it to a specific PO Line as a Text attachment.
The technique I chose was to run a customized BOM Explosion UBE when a User hits a button which explodes a BOM creates a formatted Text file and attaches it as Media Object Text to the PO Line. Typically completes in 2-3 seconds. User refreshes Inquiry screen (Find) and there it is.
It's not as slick a solution as automatically handling everything for the user - but if you want to do that then keep all the code inside the Application and/or called BSFNs - don't use a UBE.
 

BOster

Legendary Poster
Keep in mind whether you are checking the submitted jobs table or some other custom table you dont want to simply do:

Code:
while(ube still running)
   table.fetch  (submitted jobs or custom table)
end while

Not only does this leave open the possibility of an infinite loop but you are going to hammer the DB server with this "polling" query as fast as the ER code can execute. You really should have some sort of escalating sleep along with a timeout.

I had to do something like this in an APPL where a series of UBEs were launched so I had to create a submitted jobs polling BSFN and incorporate it into the APPL. It would do something like wait 2 seconds check the job, wait 4 seconds check the job, 8 seconds, etc. until a max of like 30 seconds between checks, etc. Eventually it would timeout and return control to the APPL where the user had the option to press a button and resume the polling process or exit the process and optionally the APPL.

In this case, because of what the application was designed to do, I really had no choice. It was a non-trival thing to code and setup. Sometimes, as Larry suggests, simpler is better. Let the TC run and then let the user "poll" for completion.
 

DBohner-(db)

Legendary Poster
Edward,

Like the other have stated - there isn't a good way to provide feedback back to the 'Form', when an UBE is completed. The Submissions are Async, and there isn't an intention for them not to be.

If the user(s) really need to know when the job is completed - you could poll the F986110, but the issue might be tracking the 'right' UBE (you don't get assigned the Job Number at the time a form does the submission).

A fairly safe way might be:
- Applications creates and passes a UKID to the UBE
- The UBE creates a new record in a Custom Table, using the UKID - during Initialization
- The UBE update the record with D'one as it completed
- A button on the Form can be repeated press - giving feedback as to the completion status - to the user

Just how I might do it... differently.

(db)
 
Top