### Action Task Manager

Some DHTML operations require a large amount of memory and CPU processing power. The Action Task Manager improves DHTML service performance by preventing a large number of actions from being run simultaneously.

The Action Task Manager coordinates DHTML actions through two fixed-size tables:

- Concurrent Processing Table - This registers the requests that are currently being processed by the DHTML service.
- Waiting Requests Queue - This registers the requests that are waiting for being processed by the DHTML service.

Note: Only certain operations that consume considerable hardware resources need to be prevented from being run at the same time. You can define which kind of requests need to be queued before being processed.

When a new DHTML request reaches the server, it will be processed according to the following flow:

1. The DHTML service determines whether the requested operation is a restricted action. If it is, the Action Task Manager will take over the request. Otherwise, it will be processed directly, without being managed by the Action Task Manager.
2. If the Concurrent Processing Table is full, the restricted request will be assigned to the Waiting Requests Queue. If the queue is full, the DHTML service will refuse the request and return a warning message.
3. After the request has been processed, it will be de-registered from the Concurrent Processing table. The DHTML service will then automatically continue to process the requests in the Waiting Requests Queue.

By using the property file `dhtml.properties` provided in JReport Web, you can balance the server load by adjusting table sizes and specify which kind of requests are managed by the Action Task Manager.

#### dhtml.properties

The dhtml.properties file is located at `<install_root>\bin`. It allows you to control three major options for the Action Task Manager:

- Specifying the size of the Concurrent Processing Table

  Use `queue.actions.max.concurrent=[integer]` to set the maximum number of requests that can be processed simultaneously. The value of this property can be equal to or larger than 0. Use 0 (default) to disable the request queue feature.

- Specifying the size of the Waiting Requests Queue table

  Use `queue.actions.max.pending=[integer]` to set the maximum number of to-be-handled requests that the queue can contain. The value of this property can be equal to or larger than 0. 0 means no requests will be stored in the queue. A request will either be handled by the DHTML service or be rejected when the maximum limit of the Concurrent Processing table has been reached.

- Specifying the actions that can be applied for the DHTML Request Queue feature

  These are listed below:

  `queue.actions.init=false # Action: DHTML report initialization
  queue.actions.undo=true # Action: Undo
  queue.actions.redo=true # Action: Redo
  queue.actions.drill=true # Action: Drilling
  queue.actions.drillup=true # Action: Drilling up
  queue.actions.refresh=false # Action: Refreshing
  queue.actions.filter=true # Action: Filtering
  queue.actions.sort=true # Action: Sorting
  queue.actions.search=true # Action: Searching
  queue.actions.finishNewReport=true # Action: Finishing creating a new report`

  These properties will only work when the queue feature has been enabled by setting `queue.max.concurrent.actions>0`.

  True - The action will be handled by the Action Task Manager.
  False - The action will not be handled by the Action Task Manager, but be directly processed by the DHTML service without being queued.