Add URL TO a form

Refreshing the task list without pressing the refresh button is currently impossible. The only way to do this is make a new API call to get the updated list of tasks (either through pressing the refresh button or after there were changes that were made in the portal (like executing a task)).

One of my colleagues suggested for you to check if the caseId that is passed to the request when getting the list of cases is the correct one. You can check this in the list of cases in the Portal or try to make the API call without the caseId and seeing if it gives you the good results. After that either use the debugger or simply print the value of the caseId during the execution into the console and then check that the value is correct.

I tried sending request to this URL `/bonita/API/bpm/humanTask?c=50&d=rootContainerId&f=state%3Dready' and its giving me results , but when ever I add a filter ' `/bonita/API/bpm/humanTask?c=50&d=rootContainerId&f=state%3Dready'&f=processId={{processId}}' or I add CaseId , it's always returning [] even though the tasks exists !  why is that ? 

It might be that the processId value or the caseId value that are used are wrong, could you check that the value of the caseId or the processId are correct?

yes it's shown in the request URL , so Im sure it's the correct one !

Could you try "f=processDefinitionId={processId}" instead of the processId filter?

the problem why I was getting [] as a response, is there is a missing delay I needed to add after executing the task and getting the task list by simply adding a setTimeout() function to call the URL "`/bonita/API/bpm/humanTask?c=50&d=rootContainerId&f=state%3Dready&f=caseId=${caseId}" , and it worked !

why in portal , just one task is shown even though I've created many cases ?  so whenever I call this URL 

`/bonita/API/bpm/humanTask?c=50&d=rootContainerId&f=state%3Dready" , I don't get all the list of the available tasks ?

 

 

There might be many reasons why. Are all the tasks created by the process human tasks? Do you have an actor that is setup for the tasks and your user is not mapped to that actor? If you use the Studio, do you always run the process from the Studio?

Actually when I create the new case from the portal (go to navbar/process/), the list of different cases and tasks are shown , but whenever I run the process from the studio and then create the case using the start button or any instantiation form , just the first task is shown related to that created case ! I don't know what's the problem ! And by the way , I have just one actor which is the default one "water bases" 

If you run a process through the Studio, it deletes the process on your server and reinstalls it, to take into account any changes that were made to the process. Deleting the process deletes all cases that are related to it, thus all currently running cases and tasks are deleted. So, after you instantiate the process, you have only the first task of your process and you lose all previous instances. You can have a page that lists the processes and a button next to each process that lets you run the process.

I thought that the cases and its related tasks are always stored in the server ! so that's why I was getting always an empty list with just the first current task of that just started case. But I made a page and I wanted to retrieve the tasks available just like in the portal and then I would get the related information based on the taskId or to show its form. what would you suggest instead ? 

Just for me to understand, did you make a page listing the tasks available? Are you asking about how to make this page?

Yeah I made it but you know the problem , when starting a new case from the studio , its gonna give me just the first task !

Ok, sorry, I made a mistake, I meant to say that you need a page listing the processes that are currently installed, that would let you start a process without going back to the studio. Starting the process from that page will not reinstall the process, but only start a new case.

You could also think of other ways to start a process, like a modal container with the list of processes and a start button next to each, or a dropdown listing all the processes and start the process selected.
The main thing is to not start a process from studio since that reinstalls the process.