I am trying to create a SUP mobile application in order to approve/reject a task from my BPM process. So, I am trying to create a EJB in order, first to fetch all the ready and reserved task for a user in order to create the .wsdl to call it from the SUP.
I cannot find an example/tutorial of how to do this. I wrote the code:
public class HelloBean {
@WebMethod(operationName = "getMyTasks", exclude = false)
public String getMyTasks() {
String testres = null;
try {
TaskInstanceManager taskInstanceManager = BPMFactory.getTaskInstanceManager();
HashSet<Status> statuses = new HashSet<Status>();
statuses.add(Status.READY);
statuses.add(Status.RESERVED);
statuses.add(Status.IN_PROGRESS);
Set<TaskAbstract> myTasks = taskInstanceManager.getMyTaskAbstracts(statuses);
testres = myTasks.toArray(new TaskAbstract[0]).toString();
}
catch (Exception e) {
}
return testres;
}
}
I tried several other ways but I always get an empty list as a result. Can anyone help me on how can I create an EJB that will take as an input the user and will bring me the READY/RESERVED tasks assigned?
Please note that the RESTful services from the code exchange project are not a solution because the application will be used in a productive system.
Thanks in advance