I want to know, if is possible create a custom Request Executor within a Plugin to deal with custom requests created by a custom TaskExecutor.
I know is possible create TaskExecutors and ServiceExecutors in a Plugin and expose them in the manifest.xml, but i want to know, can i do it with a RequestExecutor? if i expose the RequestExecutor as a Script package, will it work? should i create a RequestExecutor as a Custom class? I need to create this RequestExecutor to deal with partitioning in a custom TaskExecutor that i created, i dont want to do multithread execution, i want to do multihost execution
Thank you Alfi, but i found another aproach, i was reading the decompiled sailpoint iiq classes, and i saw a class called DynamicLoader, if you want to create a request executor, you can create a Rule, but instead od language=”beanshell” you can use language=”java” , like that:
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule language="java" name="TesteClassLoader">
<Description>Rule criada para teste de codigo.</Description>
<Source>
import sailpoint.api.SailPointContext;
import sailpoint.object.Attributes;
import sailpoint.object.Partition;
import sailpoint.object.Request;
import sailpoint.object.RequestExecutor;
import sailpoint.request.RequestPermanentException;
import sailpoint.request.RequestTemporaryException;
public class TesteClassLoader implements RequestExecutor{
@Override
public void processCommand(Request arg0) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'processCommand'");
}
@Override
public boolean terminate() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'terminate'");
}
@Override
public void execute(SailPointContext arg0, Request arg1, Attributes<String, Object> arg2)
throws RequestPermanentException, RequestTemporaryException {
Partition partition = (Partition) arg1.getAttribute("partition");
System.out.println("Executing TestRequestExecutor");
System.out.println("Partition value: " + partition.getAttribute("value"));
}
}
</Source>
</Rule>
and create a RequestDefinition pointing to your rule:
Within your plugin task executor, you can create the requests with your partitions and use the native method inherited by BasePluginTaskExecutor .launchPartitions():