retrievePublicObject function

To retrieve a public object that is stored in z/OSMF core, call the retrievePublicObject function.

If a plug-in contains multiple tasks, for the first task opened during a z/OSMF session, call the definePublicObject function to create the object. When subsequent tasks in the plug-in are opened, call the retrievePublicObject function to obtain an instance of the object that has already been created.

If the retrievePublicObject function returns an empty string, the object has not been created in z/OSMF core. This may be an indicator that the calling task needs to define the public object.

Invoking the function

To call the retrievePublicObject function, use the syntax shown in Figure 1.

Figure 1. Syntax to use to call the retrievePublicObject function
var publicObject=win.global.zosmfExternalTools.retrievePublicObject(handle);

where handle is the handle used when the object was created.

Example

Figure 2. Sample code for the retrievePublicObject function
var util=win.global.zosmfExternalTools.retrievePublicObject("utilGlobal");
console.log("utilGlobal "+utilGlobal);