---
title: Automation 
slug: hyper-en/automation
description: Learn how batch processing in a system enables seamless automation of tasks like email verification, server time verification, and automatic ticket distribution. Configure Quartz and follow our step-by-step guide to create custom batch routines by accessi
createdAt: 2021-10-11T15:40:19.000Z
---

## Batch Processing

This functionality allows the **registration of batch processing routines**, that can be later used in other system routines.

These Routines include:

- E-mail verification
- Server time verification
- Automatic ticket distribution with workload balancing

## Before getting started

- [x] ****<font color="#ff6900">**4biz** </font>**Batch processing&#x20;**&#x75;ses Quartz for scheduling and processing system routines. Therefore, before using any batch routine it is necessary to configure Quartz.

## Procedure

1. Access the functionality through the main Menu `System > Batch Processing`;
2. Click on "**New**";
3. Fill in the available fields (description, type \[Java class, RhinoScript, SQL]; status; a cron expression that defines the routine execution time and the context of the routine to be executed in the system);
   - Example of "**Class Java**" content:

```java
br.com.4biz.citcorpore.quartz.job.JobConfiguracaoAberturaAutomaticaViaEmail
```

4\. Click on "**Save**".

## Batch Routines&#x20;

- Return the Server Time
  - Type: RhinoScript
  - Content:

```javascript
var importNames = JavaImporter();

importNames.importPackage(Packages.java.util);

importNames.importPackage(Packages.java.lang);

importNames.importPackage(Packages.java.sql);

importNames.importPackage(Packages.br.com.citframework.util);

importNames.importPackage(Packages.br.com.citframework.integracao);

importNames.importPackage(java.io);


var print = java.lang.System.out;

var dataHoraAtual = importNames.UtilDatas.getDataHoraAtual();

print.println("DATA E HORA DO SERVIDOR: "+ dataHoraAtual);


executaConsultaCURRENT_TIMESTAMP = function(){

var jdbcEngine = new importNames.JdbcEngine("jdbc/citsmart", null);

return jdbcEngine.execSQL("select CURRENT_TIMESTAMP", null, 0);

}


var dataHoraBanco;

var listaCURRENT_TIMESTAMP = executaConsultaCURRENT_TIMESTAMP();

if((listaCURRENT_TIMESTAMP!=null)&&(listaCURRENT_TIMESTAMP.size()>0)){

for (var itElemento = listaCURRENT_TIMESTAMP.iterator(); itElemento.hasNext();){

var elemento = itElemento.next();

if (elemento!=null) {

dataHoraBanco = elemento[0];

break;

}

}

}

print.println("DATA E HORA DO BANCO DE DADOS: "+ dataHoraBanco);
```

```java
br.com.centralit.citcorpore.quartz.job.JobConfiguracaoAberturaAutomaticaViaEmail
```

- Perform e-mail reading
  - Type: Java Class
  - Content:

