Skip to main content

Activities and background processing

Activities and background processing

Activities provide flexibility to automate system processing tasks. For example, an organization wants to offer a 20 percent discount on the products that will expire in seven days. A job scheduler runs an activity once a day to perform this task. To enable this process, you first configure a report that filters products that will expire seven days from the date of the report. Then, you create a job scheduler activity to run the report, apply the discount to the expiring products, and update the product prices in the database. The following video illustrates the activity that begins each time the job scheduler wakes up.

Queue processors and job schedulers handle read/write transactions on database objects differently. As shown in the video, a job scheduler includes steps in the activity to identify the items expiring in seven days, apply the discount, and then save and commit the change. Job schedulers do not manage the read/write operations on database objects. Queue processors automatically manage the read/write transactions on database objects. If a queue processor needs to update an object, the activity should not contain any steps to perform the read/write objects to the database as part of the process.

Tip: When configuring job scheduler activities, the best practice is to separate business logic from transaction logic. For example, a company sends congratulatory letters to employees celebrating work anniversaries. The business logic identifies employees with work anniversaries. The transaction logic executes the process to send the letter. Logic separation enables you to adjust processing if the activity cannot obtain a lock. To separate the logic, you can create one activity for the business logic and a second activity for the transaction logic.

Check your knowledge with the following interaction.

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice