-1

I've written a mobile application that needs to make a call to the Camunda rest api and get every task and process instance variable when it wakes up.

Call process-instance with no params

For each process instance returned call task?processInstanceId=$processInstanceDetails.id

For each process instance returned call process-instance/$processInstanceDetails.id/variables

With about 80 live process instances alive in the system it is starting to get quite slow (15 seconds).

Can anyone advise me on any possible improvements (besides getting the mobile to only query certain process instance id's which I don't want to look at yet).

thanks

Richie
  • 4,989
  • 24
  • 90
  • 177
  • Why you need to call everything on start? Maybe it is better to call the information for a process instance when it is really needed. – Zelldon Dec 12 '16 at 09:14
  • The use case is that we want to show all issues / processes in the system on like a map view. So we need to know about everything. – Richie Dec 12 '16 at 23:25

2 Answers2

1

You have a number ways forward:

If your client side language supports asynchronous constructs you can make the task/variable calls in parallel. Depending on conditions, in the best of all possible worlds, that will take you down to closer to 2 sequential network operations vs 161.

You could also sister the camunda REST api on the server side. Query the process engine for the tasks and process variables without incurring network overhead. You can aggregate all the results and return them in a single call.

Robert Moskal
  • 21,737
  • 8
  • 62
  • 86
  • thanks Robert. Yes we also had reading everything at once in mind but I was questioned on how scalable that would be going forward when there are loads of processes in the system. I'll possible have to go down the path of parallelism. – Richie Dec 12 '16 at 23:23
0

How are you querying the process instances? If it is by process definition id or key, you could instead query the tasks directly with the same parameters.

Jörn Horstmann
  • 33,639
  • 11
  • 75
  • 118