irisconnect toolbox · 2012-04-18 · text file in order to generate a brand new text file (txt,...

15
An I.R.I.S. Technical Note IRISConnect Toolbox 2/27/2012 I.R.I.S. Products & Technologies lde

Upload: others

Post on 29-Feb-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

An I.R.I.S. Technical Note

IRISConnect Toolbox

2/27/2012 I.R.I.S. Products & Technologies

lde

Page 2: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 2

IRISConnect Toolbox

Project ID IRISConnectToolbox

Product IRISConnectToolbox

Version 1.0

Ref. PRJ–R&D # / LD # ICONN-TBOX

CD Number

From Louis Destrée

Revision History

Date Description Author

2012-02-17 First version 1.0 Louis Destrée

Reference

File Description

Page 3: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 3

Contents Introduction ...................................................................................................................................... 4

Connection ........................................................................................................................................ 6

Rule set .............................................................................................................................................. 7

Rule ................................................................................................................................................... 8

Folder and File ............................................................................................................................... 8

Text File ......................................................................................................................................... 9

Command ..................................................................................................................................... 11

Connector ..................................................................................................................................... 13

Page 4: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 4

Introduction The goal of this document is to describe IRISConnect Toolbox.

The toolbox is part of the IRISConnect family.

It can be used to:

create folder(s) on the target path

copy / move file(s) to the target path

generate any kind of text files (for example: .txt, .csv, .xml)

call a external application (single command-line export)

call another IRISConnect connector

The target path can be either on the local system or on the network. We can provide specific

credentials in order to access the target path.

With IRISConnect Toolbox, a new concept called “signal” is introduced. These signals are sent by the

external application (or declared in the input XML file). We will see how IRISConnect Toolbox is able

to capture a specific signal to execute a corresponding rule or rule set.

Typically “objects” are organized into documents and batches. This organization can be reflected by

means of signals:

StartBatch

StartDocument

AddObject

EndDocument

EndBatch

Here is an example of such an input file containing signals and two “invoice” objects.

<?xml version="1.0" encoding="utf-8"?>

<input>

<signal type="batch" name="StartBatch"/>

<field label="invoice.number">32001</field>

<field label="invoice.date">07/07/2010</field>

<field label="invoice.amount">312.12</field>

<signal type="document" name="StartDocument"/>

<object type="invoice" name="invoice1">

<file>input/Document1/00000001.TIF</file>

<file>input/Document1/00000002.TIF</file>

</object>

<signal type="document" name="EndDocument"/>

<field label="invoice.number">32002</field>

<field label="invoice.date">07/07/2010</field>

<field label="invoice.amount">234.12</field>

<signal type="document" name="StartDocument"/>

<object type="invoice" name="invoice2">

<file>input/Document2/00000001.TIF</file>

<file>input/Document2/00000002.TIF</file>

</object>

<signal type="document" name="EndDocument"/>

Page 5: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 5

<signal type="batch" name="EndBatch"/>

</input>

In order to illustrate the new functionalities, we will create a configuration that can be used to :

a) copy each invoice (with two images per invoice) in a separate folder

b) generate an XML file (in c:\output\index.xml)

c) and finally open the generated XML file in NotePad

Page 6: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 6

Connection In order to create a connection, we must provide a name, a target path (root) and the credentials

that should be used to access the target path. These credentials are optional.

Note. The username can be <domain>\<username>

Page 7: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 7

Rule set The rule set definition is similar to the one of the other IRISConnect connectors. The only difference

is that the type and condition filtering can be applied to signal as well.

For the “command” rule set, we have set a condition (type==”batch” && name==”EndBatch”) so that

the underlying rule will be executed only when the EndBatch signal is received.

For the “(default)” rule set, there is no type or condition.

Page 8: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 8

Rule With the Toolbox, we can create 5 types of rules: folder, file, text file (also called signal), command

and connector.

Folder and File To create a folder and / or a file, you must provide a path and a name.

Page 9: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 9

The name is the name of the object (either a folder or a file) that must be created for each input

object.

The path is the location where the object must be created (copied).

Note. If the path is empty and the rule is the first one within a rule set then the root (see.

Connection) will be used. If the rule is not the first one within a rule set then the path will be relative

to the previously created object (for that particular rule set).

By means of these rules (“Folder” and “File”), the input files can be copied into a more structured

hierarchy of folders.

In our example, first we create a folder whose name is the name of the object (“invoice1” or

“invoice2”) prefixed by “test_”. After that, we copy each file in the newly created folder.

Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a

Text File rule.

First, we specify the name and path of the file that must be created.

Note. If the path is empty, the path of the previously created object will be used. In the context of

text file generation this can be confusing that’s why we recommend either to specify a path (which

can be combined with a complex naming based on scripting) or to put the rule in a separate rule set.

Page 10: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 10

On the second tab, we can specify, for each signal, the piece of text that must be generated. These

pieces of text (called “fragments”) can contain scripting (delimited by <ic:value> tag). These tags will

be evaluated and replaced at run-time.

In order to make it easily reusable, the definition of the fragments can be stored in external text files

(called templates).

Page 11: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 11

Command A command is used to call an external application.

You must provide the path and the name of the external application as well as some parameters

(optional). The parameters will be passed to the external application. Input data can be retrieved by

means of the <ic:value> tag.

You should also specify if IRISConnect is going to wait for the result of the external application

(“synchronous”) or not (“asynchronous”).

In some circumstances, it is very useful to call another instance of IRISConnect; typically to store

some generated files. To do so, you should specify a configuration file (ex. sharepoint.xml), a target

and an input file. We assume that the input file has been generated (by means of a Text File rule)

prior to the command execution and that we have generated one input file per “batch”.

Page 12: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 12

Page 13: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 13

Connector This type of rule is used to call other IRISConnect connector(s) from the ToolBox.

In this case, the input data received by the toolbox are transmitted to another connector. You can

decide to send only some of the input data. To do so, you just have to specify a type and/or

condition in the corresponding rule set

The path must be a valid XML configuration file.

Note. In order, to send newly generated text files, you should:

a) generate a valid XML input file

b) use a Command rule to call IRISConnect.exe passing the XML input file

Page 14: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 14

Page 15: IRISConnect Toolbox · 2012-04-18 · Text File In order to generate a brand new text file (txt, csv, xml) based on the input data, you can create a Text File rule. First, we specify

IRISConnect for Toolbox Page 15