protected QueryDefinitionAPI getAPI(final Map<String, String> options) { if (options == null) { throw new IllegalArgumentException("The options are null or not well set."); } final String queryList = options.get(APIAccessor.QUERYLIST_OPTION); final String user = options.get(APIAccessor.USER_OPTION); final String domain = options.get(APIAccessor.DOMAIN_OPTION); UserOwner.setUser(user); DomainOwner.setDomain(domain); final String restUser = options.get(APIAccessor.REST_USER_OPTION); if (restUser != null) { RESTUserOwner.setUser(restUser); final String restPswd = options.get(APIAccessor.PASSWORD_HASH_OPTION); PasswordOwner.setPassword(restPswd); } if (!apis.containsKey(queryList)) { apis.put(queryList, new StandardAPIAccessorImpl().getQueryDefinitionAPI(queryList)); } return apis.get(queryList); }
protected QueryDefinitionAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); // We set the Context of the AccessorUtil to Standard // since we are in the engine core! // Therefore, hooks get executed properly when they call // AccessorUtil.getWhateverAccessor(); // Note that the Context in the APIInterceptor remains unchanged // (hence we have two contexts). The one in the APIInterceptor is used // to fetch the caller id. Note that in the case of EJB2 (this case), // the caller id has been set manually (see previous instruction). AccessorUtil.setContext(Context.Standard); if (queryDefinitionAPI == null) { queryDefinitionAPI = new StandardAPIAccessorImpl().getQueryDefinitionAPI(); } return queryDefinitionAPI; }
dataTypeClassName = getDataTypeClassName(variableName, instanceUUID, activityInstanceUUID); } catch (final BonitaRuntimeException e) { final ProcessDefinition process = accessor.getQueryDefinitionAPI().getProcess( instanceUUID.getProcessDefinitionUUID()); if (ProcessType.EVENT_SUB_PROCESS == process.getType()) {