Switch user sessions before UBE call

jdecoder

jdecoder

Well Known Member
Hi Everyone,
I have a requirement where there is an existing driver UBE that is calling Multiple UBE dealing with different Interface files. Now they want to see specific User names as the audit info in the tables the child UBE updates.

Illustration:
Driver UBE D calls UBEs A,B,C,D
Now they want launch A & B under the user U1 so that you will see U1 as the audit for all the tables it touches.
And then C with U2 and D with U3.

Is this even possible? Also can anyone throw some light on how the scheduler imitates a session before UBE call?
 
The scheduler does not imitate a user session. It initializes the environment for the user and the UBE runs as that user.

How is the audit information getting updated in A, B, C & D? Through regular Table I/O or through standard business functions?
 
How is the audit information getting updated in A, B, C & D? Through regular Table I/O or through standard business functions?

Yes. derived from GetAuditInfo Table I/Os some NER calls with user name passed in.
where can I find the code in the scheduler which initializes the environment for the user and run the UBE ? may be I can do that.
 
If the only issue is updating the audit tables with a given user name, why can't you just use a processing option and pass that value to the table i/o and the NER?
 
This is an existing architecture and the child UBE's are about 10 of them and I have to check what tables they touch and if the Audit Info overrides at any point and assign the user over there. I was thinking of not getting into the child UBEs at all and do it beforehand some how in the driver.
 
Another option is to string the UBEs by a script that calls runubexml. You can specify the user for a given UBE there. This may or may not be feasible based on report interconnect dependencies.

where can I find the code in the scheduler which initializes the environment for the user and run the UBE ? may be I can do that.

This is internal E1 system code and we don't have access to it.
 
This is one of those User Requests that to them appears to be very simple and should only be 1% of the total project work. When we look at it we realize to accomplish it changes the whole approach / design and consumes 50+% of the time.
Make sure the user knows how expensive their request will be (if you think they might care).
 
Make sure the user knows how expensive their request will be (if you think they might care).

I agree with you Larry, 100%. I did not want suggest calling JDB_InitEnvOvr in a bsfn as the issue was only to update audit fields - seemed too complicated to achieve just that.
 
I agree with you Larry, 100%. I did not want suggest calling JDB_InitEnvOvr in a bsfn as the issue was only to update audit fields - seemed too complicated to achieve just that.

I agree as well. Always the same, the little things creep the project

but as for this API, if they also want Work Centre Messages to go to a certain user, they'll have to use it

If you want my clone BSFN that utilises this API, let me know. Although I think it only handles R47nnn UBEs due to the dstr.
 
Last edited:
This good information all. I agree that I need really think about the value to cost ratio.

Thank you for all your help.
 
Back
Top