Background Jobs
Workrunner performs most of heavy operations in background to achieve scalable and high performance output. These background operations are executed by Workrunner service agent without any user interaction.
When a new process started by user, workflow state is recorded in database without any further processing and creates a couple of background jobs. Service agents pulls the jobs from queue and try to process in background. If an error occurs while processing job, transaction state is rollbacked and error state is reported to the system administrators. When administrator resolves the issue, job re-queued in system from job manager to process again. Some of errors are automatically recovered by system and queued again with time delay.
Service agents uses multiple threads and also can be deployed to any number of hardware instances to perform parallel execution. Jobs are executed in order of priority and a single service agent can complete 600 job per minute for basic workflow operations. This number is highly depends on job definition and hardware specifications.
Job Details¶
Each job has following properties;
Type
Type of job.
Created At
Date and time of job is created.
Delete After
Date and time of job to delete.
Started At
Start date and time of job.
Completed At
Completion date and time of job.
Duration
Duration of execution if job is completed or duration of wait time in queue.
Score
Calculated priority score. This value is calculated from job type priority and workflow instance priority.
State
State of job. Can be one of following values; Waiting, Processing, Error, Completed, Aborted.
State Transition
Every job is created in "Waiting" state.
When a service agent pulls the job from queue, agent locks the job and changes to "Processing" state.
If job is successfully completed state changes to "Completed".
If job generates an error, state changes to "Error" and system administrator is notified. Some of job errors are automatically handled. For example e-mail sending job errors are ignored and re-scheduled and state changes to "Waiting" to try again later. If maximum try count limit exceeded state is changed to "Error" or "Aborted" by configuration settings.
For "Aborted" and "Completed" states job is automatically deleted from system if "Delete After" date is passed.
Job Log
Each job contains a log about detailed information of what is performed in background. Each log line has a in log level like Debug,Information,Warning,Error.
Job Types¶
Workflow Jobs¶
Scheduled Task
Time based generic job. This job usually creates another jobs if any action required.
Task Evaluation
Created when initiate type workflow task scheduled to start periodically. Created by Scheduled Task for per task definition. You can find more detail in Task Evaluation section.
Work Item Evaluation
Created when normal type workflow task scheduled to check periodically. Created by Scheduled Task for per work item instance. You can find more detail in Task Evaluation section.
Work Item Processing
Created when a user or system complete a work item. This job advances to next step in workflow and executes the scripts in workflow, calculates the role scripts to assign to task.
Deadlined Work Item
Created when a work item's deadline occurs. This job is similar to "Work Item Processing" job but created when deadline date is missed.
Work Item Reminder
Created when a task reminder need to be sent.
Xml Database Jobs¶
Form Data Xml Database Replication
Created when workflow data need to be replicated on xml database. This job usually created when a workflow data is modified.
Instance Xml Database Replication
Created when a workflow history is changed and need to be replicated on xml database.
Xml Database Removal
Created when a worfklow data is removed. This job is usually created when a process version is deleted from system.
Full Text Indexing Jobs¶
Work Item Full Text Indexing
Created when a workflow data is modified and updates the full text catalog.
Document Full Text Indexing
Created when a document content is modified and updates the full text catalog.
Full Text Removal
Created when a previously added document is removed from full text catalog.
Domain Jobs¶
E-Mail Message Send
Created when an email message is sent. Email content may be automatically generated from workflow templates or scripting environment.
Domain Upgrade
Created periodically to upgrade installed processes from market store.
Domain Deletion
Created when a domain is expired and no longer active.
Default Job Configuration¶
Workrunner uses following default configuration to manage job queue.
Name | Internal Name | Priority | Delete After (days) (No) |
Retry Duration (min) (No) |
Max Retry (No) |
Max Retry Result (Abort) |
Error Result (Error) |
Alert Error (True) |
Alert Abort (False) |
---|---|---|---|---|---|---|---|---|---|
Scheduled Task |
Workflow.ScheduledTask | High | 90 | ||||||
Task Evaluation |
Workflow.Task.Evaluate | High | 180 | ||||||
Work Item Evaluation |
Workflow.WorkItem.Evaluate | High | 180 | 10 | 20 | ||||
Work Item Processing |
Workflow.WorkItem.Process | High | 180 | 10 | 20 | Error | True | ||
Deadlined Work Item |
Workflow.WorkItem.Deadline | High | 180 | 10 | 20 | True | |||
Work Item Reminder |
Workflow.WorkItem.Reminder | High | 60 | ||||||
Work Item Full Text Indexing |
Workflow.WorkItem.FullText | Low | 2 | 10 | |||||
Document Full Text Indexing |
Workflow.Document.FullText | Low | 2 | 20 | |||||
Full Text Removal |
Workflow.FullText.Remover | Low | 2 | 10 | |||||
E-Mail Message Send |
Workflow.Message.Send | Low | 90 | 10 | False | False | |||
Domain Upgrade |
Workflow.Domain.Upgrade | Low | 180 | True | |||||
Domain Deletion |
Workflow.Domain.Delete | Low | |||||||
Form Data Xml Database Replication |
Workflow.FormData.XmlDatabase | Normal | 2 | 10 | |||||
Instance Xml Database Replication |
Workflow.Instance.XmlDatabase | Normal | 2 | 10 | |||||
Xml Database Removal |
Workflow.FormData.XmlDatabaseRemover | Normal | 2 | 10 |