I would like to have a simple functionality in WELP (printjobs generated by group of users should be archived). If the printjob username is in the list of users (in our example these are username1 and username2) the archive section should take control (make pdf of outgoing stream in the archive directory).

So I figured out that I will make one main convert.ini file with sections for each username. In these usernames section there would be only iniFile command with the name of ini file with archive section (archiveflie.ini)

Content of convert.ini (main file)

[username1]

IniFile=#ELP_FORMS_PATH#archivefile.ini

[username2]

IniFile=#ELP_FORMS_PATH#archivefile.ini

[username1]

....

Content of archivefile.ini (where the archiving is being done)

[GLOBAL]

PDF_Mode=20
OutArchiveDir=C:\Archiwizacja\#USERNAME#\;#USERNAME#_#DATESERIAL#_#PRINTDOCNAME#
Macro_Download=OFF
ArchiveMode=2
Exit=ON

Q1: is there an easier way:

A1.1: Yes, just to use the same mechanism but with only one file:

[Global]

Macro_Download=OFF

; Preset the variable

Variable=#DoArchive#:FALSE

[username1]

Variable=#DoArchive#:TRUE

[username2]

Variable=#DoArchive#:TRUE

[username1]

....

[Test if something needs to be archived]

; Primarytrigger always true

Trigger_Binary=1

; Secondary maybe

Trigger_Variable=#DoArchive#:TRUE

; it both are true then...

PDF_Mode=20
OutArchiveDir=C:\Archiwizacja\#USERNAME#\;#USERNAME#_#DATESERIAL#_#PRINTDOCNAME#
ArchiveMode=2
Exit=ON

[Otherwise do nothing]

Trigger_Binary=1
Passthrough=ON

A1.2: Even the same rules as above but with one rule only:

[test if something needs to be archived]

Trigger_Binary=1
User_Names=;username1;username2;username3;...;
PDF_Mode=20
OutArchiveDir=C:\Archiwizacja\#USERNAME#\;#USERNAME#_#DATESERIAL#_#PRINTDOCNAME#
ArchiveMode=2
Exit=ON

[Otherwise do nothing]

Trigger_Binary=1
Passthrough=ON

Q2: The list of usernames whose jobs are to be archived changes dynamically. This is the list of users of safecom group named "archive". I have to make welp conifiguration to change according to changes in safecom group. I've got an idea to write windows service that will periodically read list of users from archive group in safecom sql database and base on that change the main welp configuration file (convert.ini in our case - change the txt file). This is littlebit crazy but I don't have any other ideas.

Do you have a better idea how to update username sections in welp dynamically?

A 2.1: My first idea was to use Active Directory, read back a key, as those informations should be set there and not in an apllication. If this is applicable then continue to read here .

A 2.2: Export the list from time to time into an ELP Variable file, the content is like that:

#MyArchive1#=Jannis
#MyArchive2#=Valerie
#MyArchive3#=Julian
etc...

So the content is a standard ELP variable file and lists all login names of useres, for whom the job should be archived. The ELP variable is counted in a row, starting with the value 1.

The var file can be changed any time, and the next arriving job will process the new users

How it work, the theory ELP reads the var file and checks in a loop for each variable, if it is the same as the current print job owner.

The configuration file:

[GLOBAL]

; As this command is executed before the variable key is, a new rule is needed to
; make sure that it coems after the stripping out of the last '' above

Variable_File=#ELP_FORMS_PATH#ArchiveList.var

; and start counter at second variable = first variable out of ini file.

Variable=#MyVarCounter#:1

[Count the amount of entries of var-file]

Trigger_Binary=1

; set the temp variable #myDummy#
; either to the CONTENT(!) of the existing variable from the var file: #MyUserSentTo$$$# where dollar is the counter starting with 1!
; for the given example the variable content of the first one is Jannis, then Valerie ...
; or if the counter is higher then the last variable to the TEXT(!) #MyUserSentTo$$$#
; and for the last + 1 the content is #MyArchive8# so the variable text itself

Variable=#myDummy#:#MyArchive#MyVarCounter##

[Check if username is found]

Trigger_Binary=1Trigger_Variable=#myDummy#:#USERNAME#

; hey found so archive

PDF_Mode=20
OutArchiveDir=C:\Archiwizacja\#USERNAME#\;#USERNAME#_#DATESERIAL#_#PRINTDOCNAME#
ArchiveMode=2
Exit=ON

[This var does not match so get net one]

Trigger_Binary=1
Trigger_Variable=LEFT(#myDummy#,1)!#

; still a name found, then increase the counter

Counter=#MyCopyCounter#

; and restart the test in rule above with next variable #:#MyUserSentTo$#

NextTriggerRule=Count the amount of entries of var-file

[Otherwise do nothing]

Trigger_Binary=1
Passthrough=ON

A 2.3: Another maybe more elegant but NOT faster way is to use an ELP database file. The file has only two fields per record, named USERNAME and ARCHIVE of type string. List all names of the userers who need the archiving and write the string TRUE into the ARCHIVE field

[GLOBAL]

; As every job is subject to be private, we put the database function into the section global

DB_Open=#ELP_FORMS_PATH#ArchiveUser.DBF

; The first USERNAME is the name of the database field. ELP will search all recors for the content of the general available ELP variable #USERNAME#. This term has to

; be in double quotes, because ELP will replace the variable before the database search starts. So actually the database search term will be: USERNAME="THOMASXP"

DB_Locate=USERNAME="#USERNAME#"

; If the record is found, then read the content from the field Archive and store the term into the searchable ELP variable #UserArchive#

DB_Variable=ARCHIVE:#UserArchive#

; As those commands are in the section global, ELP does evaluate that all, even before the first byte of the data stream is read. So search and insert can be used

 

[test if something needs to be archived]

Trigger_Binary=1

Trigger_Variable=#UserArchive#:TRUE
PDF_Mode=20
OutArchiveDir=C:\Archiwizacja\#USERNAME#\;#USERNAME#_#DATESERIAL#_#PRINTDOCNAME#
ArchiveMode=2
Exit=ON

[Otherwise do nothing]

Trigger_Binary=1
Passthrough=ON