Skip to main content

Hello team

This is my code for Connecting to AS400 through Reflection ZFE API
var zfe = null;
$("#loggaIn").click(function () { });
zfe = new ZFE.ZFE({
url: 'http://d75v7006.lfad.lfnet.se:7575/zfe/',
target: document.getElementById('my-host-app'),
password: 'B943KD',
domain: 'CORPDOM'
//headless: true
});

zfe.connect().then(function (authenticated) {
if (authenticated) {
console.log('user successfully authenticated');
} else {
console.log('authentication failed');
}
var sessionManager = zfe.getSessionManager();
sessionManager.addListener(sessionManager.Event.SESSION_CREATED, onSessionCreated, this);
});

var onSessionCreated = function (session)
{
alert('New session was created: ' session.getName());
};

This is my micro code now where should i call it in my above code that I can run this code  step by step after Session Get Connected.

var macro = createMacro(function*() {
'use strict';

// Obtain the PresentationSpace for interacting with the host
var ps = session.getPresentationSpace();

// Set the default timeout for "wait" functions
wait.setDefaultTimeout(10000);

// Begin Generated Macro
try {

} catch (error) {
yield ui.message(error);
}
//End Generated Macro
});

Please guide me,

thanks and regards,


#Rumba