Using EOM functions

Barr EOM

Barr EOM functions are used to insert information into a document property. The @parse, @dateTimeToString, @schedule, and @stringToDateTime functions allow you to extract data from a document property and insert it into another document property.

Review the following table for a description of each function. Click the links for steps on how to configure each function.

Function

Description

@dateTimeToString

Converts a date/time (usually from another document property) to a string

@lookupCsv

Looks up the value for a property in a .csv file

@parse

Extracts data from a document property

@schedule

Inserts a time into a document property

@stringToDateTime

Converts a string (usually from another document property) to a date/time value

@Counter

Specifies the name format for newly created burst documents

See also:


Configuring the @dateTimeToString function

Use this procedure to configure the @dateTimeToString function. This function converts a date/time to a string in the format specified. This string will be inserted in the document property you are configuring.

  1. Right-click in the appropriate document property and select Insert Function | @datetimeToString. The @DateTimeToString dialog box displays.

  2. In the FieldSource box, specify the document property that contains the date/time string you want to insert. Right-click in the box, select Insert Document Property, and select the document property from the list.

  1. In the Format box, enter the format the date/time string will use when it is inserted into the document property. See the Format grids for descriptions of the available formats.

  2. In the Culture box, specify the culture name of the data in the document. The default is the current culture of the computer where the Barr EOM Console is running. When culture is not specified, the culture independent CultureInfo.InvariantCulture is used.

  3. Click OK. The function is inserted into the document property using the following format: @dateTimeToString([FieldSource],"Format",Culture)

Top

Configuring the @lookupCsv function

Use this procedure to configure the @LookupCsv function. This function looks up the value for a property in a comma separated values file. The value will be inserted in the document property you are configuring.

  1. Right-click in the appropriate document property and select Insert Function |@lookupCsv. The @LookupCsv dialog box displays.

  2. Select how you want to locate the .csv file. You can use one of the following options:

  3. Path - Enter the path and file name of the .csv file, or click the Browse (...) button to navigate to the file.

  4. Resource - Select the appropriate resource from the list, or click the Browse button to choose the resource from the Manage CsvDocProp Resources dialog box. If you are using a resource, "CsvDocProp:" will be inserted before the resource name.

  1. In the Lookup data box, specify the data you are looking up. This could be data from another document property or the results of an @parse function.

  2. To select a document property, right-click in the box, select Insert Document Property, and then select the appropriate property from the list.

  3. To use the results of an @parse function, right-click in the box, select Insert Function, and then @parse() from the list. Configure the @parse function using the @Parse dialog box.

  1. In the Key column name box, enter the column name in your .csv file where EOM should look for a value that matches the data you entered in the Lookup data box.

  2. In the Data column name box, enter the column name in your .csv file that contains the value you want inserted into the document property.

  3. Click OK. The function is inserted into the document property using the following format: @lookupCsv("path/resource",lookup data,key column name,data column name)

Top

Configuring the @parse function

Use this procedure to configure the @parse function. The parse function is used to extract data from a document property (e.g. Document Name). The parse function will extract data using character offset (specifying a beginning position and length), single delimiters (specify just the starting delimiter, it will be used as the only delimiter, field number, and length), and double delimiters (specifying a starting delimiter, ending delimiter, field number, and length). When you create a business rule action to set document properties, the parsing command should be entered in the appropriate Value cell on the Document Properties dialog box.

  1. Right-click in the appropriate document property and select Insert Function | @parse. The @parse dialog box displays.

  2. In the FieldSource box, specify the document property from which data will be extracted. Right-click in the box, select Insert Document Property, and select the document property from the list. The document property will appear in brackets in the field source box.

  3. Determine if you want to extract data using character offset or double delimiters. Complete the steps in the appropriate section below.

To extract using character offset

  1. Select Field.

  2. In the Position box, specify the first position of the string to be extracted. The first character of source data is indicated by specifying a 1.

  3. In the Length box, specify the length of the string to be extracted. If the length specified is zero (0) or if the length is greater than the remaining data, then all data to the last character will be used.

  4. Click OK. The function is inserted into the document property using the following format: @parse([FieldSource], position, length)

Example

Data: PRINT100STD0C

Command

Result

@parse(documentName,1,8)

PRINT100

@parse(documentName,9,4)

STD0

@parse(documentName,13,0)

C

To extract using delimiters

  1. Select Delimited List.

  2. In the Starting delimiter box, specify the character that marks the beginning of the string. If a comma or backslash is used as the first character of the delimiter, then a backslash must precede the delimiter in the command. For example, a backslash delimiter will be shown in the command as \\.

  3. In the Ending delimiter box, specify the character that marks the end of the string. If a comma or backslash is used as the first character of the delimiter, then a backslash must precede the delimiter in the command. For example, a backslash delimiter will be shown in the command as \\. If there is only one delimiter, this field can be left blank.

  4. In the Field number box, specify the position of the field that will be extracted. (1 refers to the first field, 2 to the second, and so on.)

  5. In the Length box, specify the length of the string to be extracted. If the length specified is zero (0) or if the length is greater than the remaining data, then all data to the last character will be used.

  6. Click OK. The function is inserted into the document property using one of the following formats:

@parse([FieldSource], "delimiter", field number, length)

@parse([FieldSource], "starting delimiter", "ending delimiter", field number, length)

Example

Data: CJ,P038,FC=6,F=OCR1,ID=J0006600,ACCOUNT=DC

Command

Result

@parse(documentName, \,F=, \,, 1, 0)

OCR1

@parse(documentName, \,ACCOUNT=, \,, 1, 0)

DC

@parse(documentName, \,P, \,, 1, 10)

038

Top

Configuring the @schedule function

Use this procedure to configure the @schedule function. This function inserts the configured schedule into a string or date/time document property. Note, that you are not scheduling a document. You are just configuring a date/time using a schedule. The date/time string will be inserted in the document property you are configuring.

  1. Right-click in the appropriate document property and select Insert Function | @schedule. The Schedule dialog box displays.

  2. Set the appropriate Day option.

  3. Set the appropriate Time option.

  4. If you are inserting the schedule into a document property with a string type, you must also configure the following:

  1. In the String format box, enter the format the date/time string will use when it is inserted into the document property. See the Format grids for descriptions of the available formats.

  2. In the Culture box, specify the culture name of the data in the document. The default is the current culture of the computer where the Barr EOM Console is running. When culture is not specified, the culture independent CultureInfo.InvariantCulture is used.

  1. Click OK. The function is inserted into the document property using one of the following formats:

For date/time properties: @scheduleDateTime(daytype,dayvalue,timetype,timevalue,,)

For string properties: @scheduleString(daytype,dayvalue,timetype,timevalue,format,culture)

Top

Configuring the @stringToDateTime function

Use this procedure to configure the @stringToDateTime function. This function converts a string to a date and time in the format specified. The string could be an extracted variable or another document property. This function inserts the configured date/time into a date/time document property.

  1. Right-click in the appropriate document property and select Insert Function | @stringToDateTime. The @StringToDateTime dialog box displays.

  2. In the FieldSource box, specify how you want to retrieve the date/time that will be inserted in the document property. You can do this using one of the following methods:

  3. FieldSource – Right-click in the box, select Insert Document Property, and select the document property from the list.

  4. Output Variable – Right-click in the box, select Insert Variables, and select the output variable from the list. You can also enter the output variable directly in the box. The variable must be surrounded with curly braces {}. The output variables are from an Advanced Document Modification rule or an extraction variable from an extract rule (line mode or page mode) or burst rule (line mode or page mode).

  1. In the Format box, enter the format the date/time string will use when it is inserted into the document property. See the Format grids for descriptions of the available formats.

  2. In the Culture box, specify the culture name of the data in the document. The default is the current culture of the computer where the Barr EOM Console is running. When culture is not specified, the culture independent CultureInfo.InvariantCulture is used.

  3. Click OK. The function is inserted into the document property using one of the following formats:

@stringToDateTime(FieldSource,Format)

@stringToDateTime(FieldSource,Format,Culture)

@stringToDateTime({OutputVariable},Format)

@stringToDateTime({OutputVariable},Format,Culture)

Top

Configuring the @counter function

Use this procedure to configure the @counter function. This function is only used if you are configuring a business rule to burst using page mode, and you can only enter the function in the Document Name property. This function allows you to specify the name format for the newly created burst documents.

  1. Right-click in the Document Name property and select Insert Function | @counter. The @Counter dialog box displays.

  2. Specify the Counter length.

  3. Specify the Separator you want to use.

  4. Click OK. The function is inserted into the Document Name property using the following format: @Counter(counter length,separator)

Example

If you burst MyDoc into 5 new documents and you specified @Counter(3,#) in the Document Name property, the documents would be named as follows:

MyDoc#001

MyDoc#002

MyDoc#003

MyDoc#004

MyDoc#005

Top