Processes best practices?

Processes best practices?

  
Are there any good guides/how-to's with best practices for using Processes? Are the guidelines about the same as with Timers? Is there more specific information available? The Processes documentation has good factual information, but few guides to "how to use this".

Thanks!

J.Ja
Justin,

Check out the reference help. It has a couple of patterns on using processes, and some best practices to have in consideration.

Is this what you were searching for?
Joao -

We were really looking for something more in-depth. For example:

* When to use a Process instead of a Timer?
* Is a Process better for batch processing than a Timer?
* Should we manually start the Process or trigger it on entity update?
* What is the impact of using a Process?
* Anything about record locking in Processes and triggered starts?

Etc.

Right now we use Timers for a lot of things that it *seems* like we should be using Processes... but we don't have the information and guidance to make that decision.

J.Ja
One thing I found out while trying to allow a long job to finish was that Processes have a 5 minute time out. On timers, you can set the default time out and you have the ability of restarting it picking up where you left off.
Gerry -

That is very useful information to us, thanks!

J.Ja
Actually activities within a process have a 5 minute timeout. The process can run for as long as you need.

Justin here's my personal take on your questions.

Processes run asynchronously just like timers. Therefore their execution is controlled by the scheduler service. By default the scheduler service has 3 threads (configurable) to execute timers on each front end server and 10 threads to execute process activities. Timers can be scheduled to execute at a given time with recurrency while processes can start on entity events. Both can start programmatically and timers have that special execution after a publish is completed.
Usually a (business) process includes some human activities but it doesn't have to. You can create processes just for asynchronous processing of some business logic.
Processes are more resiliant than timers. A timer execution is typically tried 3 times (configurable) before it fails completely. Process activities have a retry mechanism that never stops but that extends the time between retries.

  • When to use a Process instead of a Timer?
?Every time I see that I could have some parallel work I go for processes. Small batch jobs like importing data from an excel I thing are easier to implement with a timer. Also the scheduling capabilities of timers make them the suitable element for recurrent processing. I have a synch process to fetch analytics from youtube that runs daily. I use a timer to have the daily schedule and within that timer I launch processes to fetch the data from youtube thus having more parallelization.

  • Is a Process better for batch processing than a Timer?
?I never benchmarked it but assuming that you can have more parallel work I would say that the same implementation of a Timer using Processes taking advantage of the parallelization should probably be quicker.

  • Should we manually start the Process or trigger it on entity update?
?Hmm it really depends on the way you design it, but you can only trigger a process on entity create events not on update eventes.

  • What is the impact of using a Process?
Processes use a significant amount of meta-data. This is great because you can understand what happens within a process on the management console but you should keep in mind to do some house keeping so that performance is not affected.

  • Anything about record locking in Processes and triggered starts?
The only issue I see is when you use the Start<Process> action. This action executes in a different transaction so you may get in to locking situations if within the process starting you access a record that was lock before executing the Start<Process> action. In these cases you should commit the transaction and only execute the Start<Process> action afterwards or start the process using an entity event.

I hope this helps,

Cheers
Andre -

Thanks! That's a huge help!

J.Ja