[Solved] How to use "provided variables"?

1
0
-1

Sorry for the post. Just found out that, obviously, you cannot evaluate the script because those values resolve on runtime. So I had to execute the process to test the tasks.

I'm trying to use "apiAccessor" to test some examples from the documentation, but when evaluating, bonita asks me to give the "process variable" "apiAccessor" a value in order to evaluate.
I can't find any reference to this in the documentation. Any ideas?

1 answer

1
0
-1

I see that i should be able to call provided apiAcessor.getIdentityAPI() to get the mentioned "IdentityAPI".
I am currently using this as a workaround:

Map<String, String> settings = new HashMap<String, String>();
settings.put("server.url", "http://localhost:8080");
settings.put("application.name", "bonita");
APITypeManager.setAPITypeAndParams(ApiAccessType.HTTP, settings);

// First of all, log in:
final LoginAPI loginAPI = TenantAPIAccessor.getLoginAPI();
APISession session = loginAPI.login("jose", "123");

// Then access any Bonita BPM Engine API:
IdentityAPI identityAPI = TenantAPIAccessor.getIdentityAPI(session);

But I need to login with an existing user.
Is it ok to do this?
Shouldn't the "provided variable" be already set?

Notifications