Skip to main content
Skip table of contents

Process automation

All i-effect processes can be automated by using the *SERVER module. There are two methods of automation:

  1. Event controlled automation
    The process type *MONITOR defines a server job where any number of locations in the system can be monitored. One can defineIFS-, DB2-, or SPOOL monitors.
  2. Time controlled automation
    The process type *SCHEDULE defines a server job, which executes tasks time-controlled.
  3. Manual controlled
    The process type *SINGLE defines a server job, which executes only bymanually calling command STRSRVTSK (Start Server Task).

A license for the module *BASE, module licenses for the required processes, and a license for the *SERVER module are prerequisites for the use of these functions.

The *SERVER module consists of three parts:

  • Part 1 contains definitions of the particular processing types.
  • Part 2 contains definitions of the data sources.
  • Part 3 contains definitions of the processing steps.

These allow a high level of flexibility when defining server entries. Data may be chosen and processed within a *SERVER job.

Characteristics of the *MONITOR/*SPOOL Process

i-effect uses the QIM_NOTIFY_CRTSPLF environmental variable to write attributes of spooled files, which are newly created, into the EFFSRVLST data queue. This environmental variable is set as follows when *SERVER is running, and is erased when *SERVER is shut down.

CODE
QIBM_NOTIFY_CRTSPLF '*DTAQ IEFFECT/EFFSRVLST'

i-effect reads the spooled file characteristics from the EFFSRVLST data queue when *MONITOR has been specified. The entries are then compared with the data definitions table and if they match, then *SERVER calls up the corresponding server task.
To use *MONITOR, it must be determined that output queues are not assigned to a printer, or the spooled files, which are to be processed by *SERVER, are not created with the status *HLD (HELD).

*MONITOR/*IFS und *MONITOR/*DB2 Job Characteristics

To monitor IFS directories and DB2 libraries, i-effect works with processes which check the specified directories and/or libraries at definable intervals for data which is still to be processed. If a file in one of the specified directories or libraries matches the specified criteria, then the server will process it.

The file will not be erased from the directory or library. *MOVE or *DELETE can be used to further define the server process to either move or delete the files. If the file is left in the directory or library, then it will continue to be processed.
After *IFS/DB2 *MONITOR server entries have been set up, i-effect must be restarted for the changes in the data selection table (option 12) to take effect.

%SRVDIR% and Other Possible Variables

*SERVER's working directory %SRVDIR% is provided at the start of a server job to allow post-processing of data, which has been created in the processing steps before. Files that are stored here can be used as source files for further server processing steps, e.g. for distribution. The directory is specified in the default settings of the *SERVER module under menu item 80 of the i-effect start menu.

Further Variables:

%IFSPATH%Only the chosen path will be used for processing.
[Only with JOBTYPE (MONITOR)]
%IFSFILE%Only the chosen IFS file name will be used for processing.
[Only with JOBTYPE (MONITOR)]
%DB2FILE%Only the chosen DB2 file name will be used for processing.
[Only with JOBTYPE (MONITOR)]
%DB2LIB%Only the chosen library name will be used for processing.
[Only with JOBTYPE (MONITOR)]
%DB2MBR%Only the chosen member file will be used for processing.
[Only with JOBTYPE (MONITOR)]
%TMP%"/TMP" will be used as the output path.
%HOME%The "home path"("/HOME/USERNAME") of the user. If the user does not have a home path, an error message will appear that recommends the creation of a home path for the current user.
%CURDIR%Current Directory
%SPLUSER%Name of the user of the spooled file.
%USRDTA%USRDTA attribute of the spooled file.
%SPLOUTQ%Name of the output queue
%SPLFILE%The spooled file name, chosen for processing, will be used (only with JOBTYPE(*SPOOL/*MONITOR)).
%SPLJOB%The name of the job that created the spooled file will be used (only with JOBTYPE(*SPOOL/*MONITOR)).
%JOBN%The number of the job that created the spooled file will be used. (only with JOBTYPE(*SPOOL/*MONITOR)).
%SPLFILNR%The file number of the spooled file will be used. (only with JOBTYPE(*SPOOL/*MONITOR)).
%USRDFNDTA%USRDFNDTA attribute of the spooled file
%USER%Name of the current user.
%DATE%Date DD.MM.YYYY
%YEAR%Current year YYYY.
%YEAR2%Current year YY
%MONTH%Current month MM.
%MONTHNAME%Name of the current month.
%DAY%Current day.
%WEEKDAY%Current weekday, e.g. "Friday."
%TIME%Current time HH:MM:SS
%TIMESTAMP%Current time stamp, YYYY-MM-DD-HH.MM.SS.MSMSMS
%DEFAULTPATH%This variable will be filled with the default value from the default settings of the *SERVER module.
%LASTSERVER
TIMESTAMP%
The time stamp of the last access to this server job in the format:
YYYY-MM-DD-HH.MM.SS.MSMSMS
With this variable, it is possible to call up, e.g. with SQL parameters of a CVTDBF server task, all data records from the DB2 table/database that have been changed since the last use of this server job. It is required that the timestamp of the creation of the specific data record is saved in the table.
The SQL syntax would look, e.g. like this: select RECORD from TABLE where timestamp. %LASTSERVERTIMESTAMP%
%SESSIONNUMBER%The i-effect logbook session number used by the server task for run time.
%IFSFILEBASE%Only the chosen IFS base file name (without extension) will be used for processing.
[Only with JOBTYPE (MONITOR)]
%IEFFECT_SERVER_ENVVAR%

With this variable it is possible to send any variable content defined under IEFFECT_SERVER_ENVVAR to an i-effect Server.

Example:

During spool conversion, split files must be compressed in a ZIP archive file. The ZIP file name must be generated dynamically from the contents of the spool file. From an EXIT program the IEFFECT_SERVER_ENVVAR environment variable will be set:

ADDENVVAR ENVVAR(IEFFECT_SERVER_ENVVAR)
VALUE('/i-effect/archive_12345.zip')

In the ADDZIP command the ARCPATH parameter from the %IEFFECT_SERVER_ENVVAR% variable will be used:

ADDZIP FS(*IFS) ARCPATH('%IEFFECT_SERVER_ENVVAR%')
DTATYP(*FILE) INFS(*IFS) FRMPATH('/%SRVDIR%') FRMIFSFILE('*.pdf')

When the ADDZIP processing is run the parameter ARCPATH will be set using the contents of the %IEFFECT_SERVER_ENVVAR% environment variable (in this example ARCPATH('/i-effect/archive_12345.zip').
%GETENVVAR:xxx%
With this particular variable (%GETENVVAR:UserDefinedEnvVar%) any chosen values from environment variables, which have been defined through ADDENVVAR, can be passed to an i-effect server processing. This variables replacement works just the same way as the one from the preset server variables however, it also makes it possible to use your own variable definitions.

For instance:

CVTSPLPDF
OUTPFILE('/%SRVDIR%/%GETENVVAR:xxx1%_%GETENVVAR:xxx2%_%GETENVVAR:xxx3%')
%ARCHIVEFILE%
With this variable (%ARCHIVEFILE%) the archive filename, saved in the transactions log, will be passed to an i-effect server processing.

Example:

PRCFWD ... FRMIFSFILE('/%ARCHIVEFILE%')
PARMS-Parameter %ParameterX%

The PARMS-parameter defines the name of parameters and their values, which can be used further in the Server-Task. In this way it is possible to pass variable values to processing while calling a Server-Task.

For example, if you have defined the Server-Task as follows:

SNDEMAIL RECIPIENT(%recipient%) SUBJECT(%subject%) MSGTEXT(%text%)

this is how you can call the Server-Task in order to pass defined values:

STRSRVTSK POS(4711) PARMS(('recipient') ('info@menten.com')
('subject') ('Your request') ('text') ('/tmp/mailtext.html')
%UNB_ORIGINATOR%
If you process EDIFACT-files with i-effect server, use these variable to automatically scan the current input file and retrieve the value of the data element S002-0004 of the UNB Segment. This data element contains the originator address.
%UNB_RECIPIPENT%
If you process EDIFACT-files with i-effect server, use these variable to automatically scan the current input file and retrieve the value of the data element S003-0010 of the UNB Segment. This data element contains the recipient address.
%UNH_MESSAGETYPE%
If you process EDIFACT-files with i-effect server, use these variable to automatically scan the current input file and retrieve the value of the data element S009-0065 of the UNH Segment. This data element contains the message type.
%UNH_MESSAGEVERSION%
If you process EDIFACT-files with i-effect server, use these variable to automatically scan the current input file and retrieve the value of the data element S009-0052 of the UNH Segment. This data element contains the message version.
%UNH_MESSAGERELEASE%
If you process EDIFACT-files with i-effect server, use these variable to automatically scan the current input file and retrieve the value of the data element S009-0054 of the UNH Segment. This data element contains the message release number.
%UNH_MESSAGEAGENCY%
If you process EDIFACT-files with i-effect server, use these variable to automatically scan the current input file and retrieve the value of the data element S009-0051 of the UNH Segment. This data element contains the organisation responsible for the message maintanance..
%WEBCONTROLSESSIONLINK%
With the help of this variable a link will be provided, that allows to directly jump into the session logbook of the corresponding session within the i-effect WebControl web interface. By using %WEBCONTROLSESSIONLINK% for example within the bodytext of an email, a user can automatically jump to the graphical maintenance of i-effect. There the current session will automatically be selected and displayed. During runtime the variable will be replaced by a link in the form:

http://:10088/webcontrol/content/sitzung.php?sitzung_id=(sitzungsnnummer)
%SERVERJOB%
With the help of this variable the jobnummer of the current server task job can be retrieved.
%SERVERJOBDESCRIPTION%
With the help of this variable the job description of the current server task job can be retrieved.
%SERVERERRORMESSAGES%
With the help of this variable a list of mewssages within the current job can be retrieved, that have a severity >= 30. The list is a simple text, that can for example be used within a SNDEMAIL command to send the messages from the joblog in the text body part.

SNDEMAIL .... MSGTEXT(%SERVERERRORMESSAGES% *PLAIN).....
%SERVERERRORMESSAGESHTML%
With the help of this variable a list of mewssages within the current job can be retrieved, that have a severity >= 30. The list is a HTML text, that can for example be used within a SNDEMAIL command to send the messages from the joblog in the body part.

SNDEMAIL .... MSGTEXT(%SERVERERRORMESSAGES% *HTML).....
%STATUS%
By using the server variable %STATUS% as special value in paraneter MSGTEXT of the SNDEMAIL command, the message text will be extracted from a template, that is included with the product. This template is a HTML template that can be used in the course of the workflow of a server tasks to send status information. Within the template, the main parameters of the job, as well as a link to the relevant messages in WebControl will be shown.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.