public AutomationMapper(OperationContext ctx) {
this.ctx = ctx;
automatic.put("Session", () -> ctx.getCoreSession());
automatic.put(AutomationScriptingConstants.AUTOMATION_CTX_KEY, () -> ctx.getVars());
automatic.put(AutomationScriptingConstants.AUTOMATION_MAPPER_KEY, () -> this);
automatic.put("CurrentUser", () -> new PrincipalWrapper(ctx.getPrincipal()));
automatic.put("currentUser", () -> new PrincipalWrapper(ctx.getPrincipal()));
automatic.put("Env", () -> Framework.getProperties());
automatic.put("CurrentDate", () -> new DateWrapper());
ContextService contextService = Framework.getService(ContextService.class);
Map<String, ContextHelper> helperFunctions = contextService.getHelperFunctions();
for (String helperFunctionsId : helperFunctions.keySet()) {
automatic.put(helperFunctionsId, () -> helperFunctions.get(helperFunctionsId));
}
}