IMR Programming

IMR module

The IMR (Interactive Message Response) module is used for automated text message processing. The IMR can be used for e-mail and SMS inbound messages and, to a lesser extent, for facsimile messages.

IMR scripts

IMR scripts combine processing steps.

Common fields of internal IMR steps

Name

DisplayName

A step name that is used for the administrator’s purposes; it should describe the step purpose.

Rank

(Rank)

The step rank, a flag. The system processes steps in an ascending order. If two steps have identical numbers, the system itself will determine their rank (which is not desirable).

Action

(Action)

A name of the action that is to be executed.

Set of text matching rules

(TextMatch)

A condition of the text matching rule. If the rule does not return a consent, the step will be skipped.

Calendar mode

(TimeMode)

Time filter – a type of condition; if the time period is not valid, the step will be skipped. NULL means that the time condition is not evaluated.

From

(TimeFrom)

The start date and time of the time condition. For DayInYear, the year is ignored, and for DayInWeek, just the day of the week is extracted. The field may be NULL only if TimeMode is also NULL. The local time is used.

To

(TimeTo)

The end date and time of the time condition. For DayInYear, the year is ignored, and for DayInWeek, just the day of the week is extracted. The field may be NULL only if TimeMode is also NULL. The local time is used.

Language

(LanguageId)

A condition for the call language. If it is NULL, then the condition is not evaluated. If the condition is not fulfilled, the step will be skipped.

The script normally proceeds in a sequence according to the Rank from one step to another. This linear execution can be changed using some action commands. The following fields are used to set the default branching options:

Jump target after success

(TargetOnSuccess)

The jump target if the step is successful. If it is NULL, the script proceeds to the next step in sequence even if the step is successful.

Jump target after failure

(TargetOnFailure)

The jump target if the step fails. If it is NULL, the script proceeds to the next step in sequence even if the step fails.

Not all action commands use all three options, and the interpretation of success or failure is specific for each of the nodes. If the script needs to be terminated, it is necessary to set a number higher than the highest Rank value (e.g. 9999) as the jump target.

Saving values to data set

The IMR script with which the processing begins can create a data set (ScenarioResult). The scenario stated for the script in the Scenario (ScenarioId) field is used as a template. All fields are created, and the data set is created as PreFilled. If the Scenario field is not completed, no data set will be created.

If a step saves a value to the data set, then it depends on the field type. If it is a selection field (Selecting from a drop-down list [DropDown], One answer from a list [RadioButtons], One answer with free text [RadioButtonsLastText], Multiple answers from a list [CheckBoxes], Multiple answers from a list with free text [CheckBoxesLastText]), then when saving, depending on the ResultText value, the system will try to find the ResultNumber value as well. Otherwise, it will save ResultText only.

Data in MessageEvent

All IMR script operations have their EventType as either ImrScriptA, ImrScriptB or ImrScriptW, depending on the phase from which the script is called. The ReferenceId field always includes the IvrStep identifier. The ReferenceData field always shows the step result, starting with the step name, or it shows the word “Error” in the case of a serious error; the error details can then be in ResultData. Duration is not filled out.

A line condition for time, language and set of text matching rules has a common indication of non-fulfillment (the prefix is always the step name, and the suffix is the actual indication):

  • SkipNoTime – The time condition is not fulfilled

  • SkipNoLang – The language condition is not fulfilled

  • SkipNoTextMatch – The language condition is not fulfilled

Time condition

The TimeMode field indicates how the TimeFrom/TimeTo fields are interpreted. If it is NULL, then the time is not checked.

  • DayInYear - Valid on a specific day in the year, every year, time from/to

  • SingleDay - Valid on a specific day (incl. year), time from/to

  • DayInWeek - Valid on a specific day of the week, every week, time from/to

  • NotDayInWeek – An inverse condition to DayInWeek, i.e. not valid on a specific day of the week, every week, time from/to

When entering the “from” time, the system will set seconds to 00.0, while for the “to” time it will set seconds to 59.9.

Example for entering the entire morning: 8:00 until 11:59

Language

Scripts use a language that is selected by a setting in the Languages table.

Local server name

In some parameters (typically the URL), you can use the server name as the “##LSN##” macro; the server name is taken from the configuration file of the executing service (iCC.ServiceSync). The option to use the “##LSN##” macro is always stated in the action command section for the relevant parameter. It concerns the following parameter:

<setting name="LocalServerName" serializeAs="String">
 <value>localhost</value>
</setting>

Set of text matching rules

In the IMR script, you can use a standard tool to analyze the message text – the Set of text matching rules (TextMatch). Every set consists of specific rules (TextMatchRule). The set has the following parameters defined:

Name

DisplayName

A set name that is used for the administrator’s purposes; it should describe the set purpose.

Text type

(TextType)

Indicates for which texts the rule can be used:

“Message” – all message types

“Email” – e-mail messages

“SMS” – SMS messages

“Fax” – facsimile messages

“Chat” – IM and chat

Processing method

(MatchType)

The method of evaluating a logic relation among the set rules:

“And” – all rules must be fulfilled

“Or” – just one rule needs to be fulfilled

Matching rule

In the set of text matching rules (TextMatch), there can be one or more rules. The rules have the following parameters:

Field type

(FieldType)

The type of message fields that are to be evaluated by the rule:

“Subject” – message subject (SubjectField)

“Body” – message body (BodyText; if not completed, then BodyHtml)

“SubjectBody” – message subject and body

“From” – sender field (FromFiled and RemoteAddress)

“To” – direct recipient field (ToField)

“ToCc” – message copy recipient field (ToCcField)

“ToAny” – message recipient field (ToField and ToCcField)

“RemoteAddress” – remote address field (RemoteAddress)

Rule type

(RuleType)

Rule type – type of matching:

“ContainsAnyOf” – Contains any text from the specimen; the specimen has words (strings) separated by semicolons; the font size is irrelevant; spaces are also considered; it is case insensitive

“NotContainsAnyOf” – Does not contain any text from the specimen; the specimen has words (strings) separated by semicolons; the font size is irrelevant; spaces are also considered; it is case insensitive

“Exact” – Equals exactly the text from the specimen; the font size is irrelevant

“NotExact” – Not true that it equals exactly the text from the specimen; the font size is irrelevant

“Contains” – Contains the text from the specimen; the font size is irrelevant

“NotContains” – Does not contain any text from the specimen; the font size is irrelevant

“Sensitive” – Equals exactly the text from the specimen; the font size matters

“RegEx” – The specimen is used as a pattern for a regular expression (RegularExpression) – refer to http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.100).aspx

Parameter

(Content)

A specimen for matching; its interpretation depends on the rule type.

IMR steps

Replay (Automatic response)

Generates an automatic response to an inbound message based on the defined template, with macro-expansion being used. For the E-mail message type, the subject gets the prefix of “RE:”, and if the “ImrReplyFormat” configuration parameter is not empty, it is used as a formatting string (allows an additional text to be entered). For the E-mail message type, the macro-expansion is performed only in the message body; for the SMS message type, the macro-expansion is carried out in the message subject, which is used from the template body. The maximum number of automatic responses sent on the given date to one recipient is limited by the MaxAutoReplies global configuration parameter unless this function is blocked by the ##NoSpam## switch in the Targets field.

Target ID

(TargetId)

An ID of the template (MessageId, Tmp type) that is to be used for a response. A required parameter.

Parameters

(Parameters)

A text that will be inserted instead of the $Parameters$ macro-parameter during the template text expansion.

Target values

(Targets)

A switch allowing the response to be excluded from the MaxAutoReplies limit. The “##NoSpam##” text will ensure that the response is not counted.

Possible event entries

  • ReplyOK – The action command was correctly executed

  • ReplyNoTemplate – No template found

  • ReplyNoGateway – The rules for sending did not generate any valid gateway

  • ReplyOver – The MaxAutoReplies limit for the given recipient has been exceeded

ExtractSender (Extract the sender’s address)

This command extracts the sender’s address from the message text (BodyText and, if empty, then from BodyHtml) and replaces the existing sender with it. It is used to extract e-mail texts from web forms etc.

Parameters

(Parameters)

Regular expression that should contain a group called address.

http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.100).aspx

Example:

“^E-mail: *(?<address>[^0-9< ][A-z0-9_]+([.][A-z 0-9_]+)*@[A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}) *$”

Possible event entries

  • ExtractSenderOK – The action command was correctly executed

  • ExtractSenderNoMatch – No match found; the address group is empty

DecideSmsPinPaging (Compare SMS PIN and decide on paging)

This command extracts a PIN from the SMS text, then uses the PIN to find the paging template (PagingTemplate) or ongoing paging (Paging). The Targets field includes three line numbers for jumps. If no match is found with the specimen, the action command proceeds with the next step.

  • The PIN is searched in active paging sessions (Paging) – If it is found, the script jumps to the third target in the Targets field. This means that the paging had already been running and was terminated.

  • The PIN is searched in paging templates (PagingTemplate) – If it is found, the script jumps to the second target in the Targets field. This means that the paging had not been running and was launched.

  • The PIN was not found; the script jumps to the first target in the Targets field. This means that the PIN is incorrect.

Parameters

(Parameters)

A specimen for a regular expression that should contain a group called pin.

http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.100).aspx

Example:

“Paging\s+(?<pin>\S+)”

Target values

(Targets)

The field must contain exactly three line numbers, separated with commas or semicolons. If a line number is omitted, it means that the script will be terminated for the given choice.

Example: “100;;220”. A required field.

Possible event entries

  • DecideSmsPinPagingOK – The action command was correctly executed

  • DecideSmsPinPagingFail – The command was executed, yet no jump target was found

  • DecideSmsPinPagingNoMatch – No match was found with the specimen or the pin group is empty

StartSmsPinPaging (Compare SMS PIN and start paging)

This command extracts a PIN from the SMS text, then uses the PIN to find the paging template (PagingTemplate) or ongoing paging (Paging). The Targets field includes three line numbers for jumps. If no match is found with the specimen, the action command proceeds with the next step.

  • The PIN is searched in active paging sessions (Paging) – If it is found, the script jumps to the third target in the Targets field. This means that the paging is already running and nothing will be performed.

  • The PIN is searched in paging templates (PagingTemplate) – If it is found, the script jumps to the second target in the Targets field. This means that the paging had not been running and was launched.

  • The PIN was not found; the script jumps to the first target in the Targets field. This means that the PIN is incorrect.

Parameters

(Parameters)

A template for a regular expression that should contain a group called pin.

http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.100).aspx

Example:

“Paging\s+(?<pin>\S+)”

Target values

(Targets)

The field must contain exactly three line numbers, separated with commas or semicolons. If a line number is omitted, it means that the script will be terminated for the given choice.

Example: “100;;220”. A required field.

Possible event entries

  • StartSmsPinPagingOK – The action command was correctly executed

  • StartSmsPinPagingFail – The command was executed, yet no jump target was found

  • StartSmsPinPagingNoMatch – No match was found with the specimen or the pin group is empty

StopSmsPinPaging (Compare SMS PIN and stop paging)

This command extracts a PIN from the SMS text, then uses the PIN to find the ongoing paging (Paging) or, if relevant, the paging template (PagingTemplate) or ongoing paging (Paging). The Targets field includes three line numbers for jumps. If no match is found with the specimen, the action command proceeds with the next step.

  • The PIN is searched in active paging sessions (Paging) – If it is found, the script jumps to the third target in the Targets field. This means that the paging was already running and was stopped.

  • The PIN is searched in paging templates (PagingTemplate) – If it is found, the script jumps to the second target in the Targets field. This means that the paging is no longer running and nothing has been performed.

  • The PIN was not found; the script jumps to the first target in the Targets field. This means that the PIN is incorrect.

Parameters

(Parameters)

A template for a regular expression that should contain a group called pin.

http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.100).aspx

Example:

“Paging\s+(?<pin>\S+)”

Target values

(Targets)

The field must contain exactly three line numbers, separated with commas or semicolons. If a line number is omitted, it means that the script will be terminated for the given choice.

Example: “100;;220”. A required field.

Possible event entries

  • StopSmsPinPagingOK – The action command was correctly executed

  • StopSmsPinPagingFail – The action command was executed but no jump target was found

  • StopSmsPinPagingNoMatch – No match was found with the specimen or the pin group is empty

SmsPagingResponse (Find SMS code and decide on response)

This command verifies whether the message contains any of the expected SMS response codes (SmsAcceptCode or SmsRejectCode) for the currently ongoing paging (Paging). If a match is found, the ImrResponseA response is recorded in the originally sent invitation SMS, the RelatedMessageId field is completed for the inbound message being processed, and the message is closed. The invitation SMS must have identical recipients as the current sender’s message. The Targets field includes two line numbers for jumps. If no suitable response code is found, the action command proceeds with the next step.

  • A corresponding acceptance code has been found (SmsAcceptCode) – The script jumps to the first target in the Targets field. This means that a paging member has confirmed their attendance. The “ACCEPT” value is recorded in ImrResponseA of the original outbound SMS message.

  • A corresponding acceptance code has been found (SmsRejectCode) – The script jumps to the second target in the Targets field. This means that a paging member has rejected the invitation. The “REJECT” value is recorded in ImrResponseA of the original outbound SMS message.

Target values

(Targets)

The field must contain exactly two line numbers, separated with commas or semicolons. If a line number is omitted, it means that the script will be terminated for the given choice.

Example: “100;220”. A required field.

Possible event entries

  • SmsPagingResponseOK – The action command was correctly executed

  • SmsPagingResponseFail – The action command was executed but no jump target was found

  • SmsPagingResponseNoMatch – No match found

Goto (Branching)

This action command allows you to change the program run. Apart from the TimeMode time condition and the set of text matching rules (TextMatch) and the language condition, there is still the Parameters field. The condition is that the message came to the “To” address that contains the entered text. If the conditions are fulfilled, the script jumps to a defined line in Targets. If the jump target is empty, the script will be terminated without any record being made in ImrResult; if the script was called as a subprogram, it will return to the calling script.

Parameters

(Parameters)

A list of expressions, separated with commas or semicolons, that are searched in the message “To” field:

Example 1: info

Example 2: @atlantis.cz, @development.cz

Target values

(Targets)

A number of the line to which the script is to jump. An empty field means that the script will be terminated.

Possible event entries

  • GotoNoMatch – The condition of the target address matching the specimen in Parameters is not fulfilled

  • GotoEnd – Fulfilled; Targets is empty, the script is terminated and, if relevant, returns to the calling script

  • GotoOK – Completed; the script jumps to another line

  • GotoFail – The line in Targets is invalid

CloseMessage (Close message)

This command sets a rule that, once the script is completed, the message processing at the given phase is terminated (similar to the Terminate attribute of PreCondition/PostCondition), and it is not processed any further. If the script is to be terminated at the same time, then the Result or the Goto step needs to follow after this step.

Possible event entries

  • CloseMessageOK

Result (Result)

This command ends the script and records the result to the relevant ImrResponseA/B/W field of the Message record. If it is an embedded script, the processing of all calling scripts will be terminated.

Target values

(Targets)

The resulting value that is to be recorded.

Possible event entries

  • ResultOK

SetLang (Set language)

This command changes the language or the acceptable language knowledge or, if relevant, both parameters of the message.

Target values

(Targets)

A culture name of the language that is to be used. Example: “de”

Parameters

(Parameters)

A value of acceptable knowledge (0 to 100)

Possible event entries

  • SetLangOK – Information that the change has been made

  • SetLangFail – The value in Targets or Parameters is invalid

SetPriority (Set priority)

This command changes the message priority.

Parameters

(Parameters)

Priority value (0 to 10,000)

Possible event entries

  • SetPriorityOK – Information that the change has been made

  • SetPriorityFail – The value in Parameters is invalid

SetSpamLevel (Set spam level)

This command sets the spam value for the given message. The recommended values to be used are 4 for spam and 0 for a good message.

Parameters

(Parameters)

Spam level value (0 – no SPAM,

1 – manual marking of on e message,

2 – manual marking of the recipient,

3 – automatic marking by the filter based on the list – the SpamPhoneBookCheck node,

4 to 100 – automatic marking by this node).

Possible event entries

  • SetSpamLevelOK – Information that the change has been made, followed by a jump to TargetOnSuccess

  • SetSpamLevelFail – The value in Parameters is invalid, followed by a jump to TargetOnFailure

SpamPhoneBookCheck (Check message according to phone book)

This command performs a check whether the sender’s address is listed among spam addresses (the list ID is configured in TargetId; if it is empty, it sets the message SpamLevel value according to the SpamLevel of the list (if no value is specified for the list, then Level 3 is set). If the address is not included in the list, nothing is set. If the list ID is empty or invalid, it does nothing (continues with another node). The evaluation procedure uses the found PhoneNumberId.

Target ID

(TargetId)

An ID of the list against which the spam level is to be checked. An optional field.

Possible event entries

  • SpamPhoneBookCheckFound – Information that the check was performed and the sender is on the list, followed by a jump to TargetOnSuccess

  • SpamPhoneBookCheckNotFound – Information that the check was performed and the sender is not on the list, followed by a jump to TargetOnFailure

  • SpamPhoneBookCheckSkip – The SpamPhoneBookId parameter is invalid or empty

InsertTemplate (Insert template)

This command inserts the message template text at the designated place (typically for an outbound message). The place is determined by the value in Targets: Subject, Body. The place in the text is determined by the regular expression in the Parameters field. The inserted text is macro-expanded upon insertion – apart from the generic special values in the templates and the fields of the associated form, the ID of the associated case is formatted in the $Parameters$ macro-element using the configuration parameter of “TrackingTokenFormat” – it serves as a tracking tag.

The TrackingTokenFormat configuration parameter serves as a formatting string that can contain the following placeholders:

  • {0} – IssueId in the form of GUID

  • {1} – IssueId in the form of BASE64

  • {2} – ContactId in the form of GUID

  • {3} – ContactId in the form of BASE64

Target ID

(TargetId)

An ID of the template (MessageId, Tmp type) that is to be used for the insertion. A required parameter.

Parameters

(Parameters)

A regular expression that searches for a match; the match position returned will be used for the insertion.

http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.100).aspx

Target values

(Targets)

A switch determining into which part of the message the text is to be inserted.

Subject – The text from BodyText is inserted into the E-mail subject before the searched specimen; this cannot be used for an SMS message

SubjectAfter – Similar to Subject, but in place of the searched specimen

Body – Inserts a text from BodyHtml to the E-mail body before the searched specimen; BodyText is used for SMS

BodyAfter – Similar to Body, but in place of the searched specimen

The switch can be followed by a behavior modifier:

? – If the specimen is not found, the template is inserted at the end

! – If the specimen is found, the template is not inserted; if it is not found, the specimen is inserted at the end

Example:

BodyAfter?

Possible event entries

  • InsertTemplateOK – The action command was correctly executed – a jump to TargetOnSuccess follows

  • InsertTemplateNoTemplate – No template found – a script error

  • InsertTemplateNoMatch – No specimen match was found and no insertion was performed; on the contrary, for the ! modifier, this means that a match was found and, therefore, no insertion was performed – a jump to TargetOnFailure follows

CheckTrackingTokenBody, CheckTrackingTokenSubject (Tracking token check)

Extracts a tracking token from the message text or subject and uses it to search for a contact or case, and then assigns it to the message.

Parameters

(Parameters)

A template for a regular expression that should contain a group called token.

http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.100).aspx microsoft.com/en-us/library/az24scfc(v=vs.100).aspx

Example:

^E-mail: *(?<token>[^0-9<][A-z0-9_]+([.][A-z0 -9_]+)*@[A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4})*$

Target values

(Targets)

A switch determining how the token, if found, is to be interpreted:

IssueId – GUID for case

Issue64 – BASE64 for case

ContactId – GUID for contact

Contact64 –BASE64 for contact

Possible event entries

  • CheckTrackingTokenBodyOK – The action command was correctly executed, a match was found and the code is valid; the script proceeds with TargetOnSuccess

  • CheckTrackingTokenBodyNoMatch – No match was found, the token group is empty; the script proceeds with TargetOnFailure

  • CheckTrackingTokenBodyError – A match was found, yet the code is invalid; the ResultData field indicates whether the value could not be parsed (NOPARSE) or an entity with the given ID did not exist (NOKEY); the script proceeds with the next line

SetTarget (Set to column)

This command sets the data set field values.

Target values

(Targets)

A field name from the data set to which the value is to be saved (TargetColumn). Example: “Membership”

Parameters

(Parameters)

A value that is to be set. It is taken literally except for special parameters. An empty value means NULL.
Special parameters:

“##RemoteAddress##” – an e-mail address or the number of the SMS sent (depending on the channel type)

“##MessageId##” – message ID

“##MessageType##” – message type/channel: E-mail, SMS, Fax, SocWall, SocMsg

“##PilotAddress##” – inbound pilot (gateway) address

“##FromField##” – “From” field text

“##ToField##” – “To” field text

“##ToCcField##” –“Copy” field text

“##SubjectField##” – “Subject” field text

“##BodyText##” – BodyText field text; if empty, then the BodyHtml field text with the tags removed

“##BodyHtml##” – BodyHtml field text; if empty, then the BodyText field text extended with basic tags

“##ProjectName##” – a project name if known already

“##Culture##” – the language in the Culture notation (e.g. “cs”)

“##RecievedTime##” – the message received time based on the local time zone

“##CurrentTime##” – the current local time just at the moment of command execution

“##NewGuid##” – a unique identifier generated in the format of 470ABC44-28C5-4B17-B549-197FAFC041DC

“$$HeaderName$$” – the content of a specific SMTP header for the E-mail type (case insensitive):

Example:

$$Thread-index$$

Target ID

(TargetId)

The required XSS filtering of text values taken from the message:

00000000-0000-0000-0000-000000000000 = None – none,

11111111-1111-1111-1111-111111111111 = Filter – basic back-listing (default if not filled out or does not match the specimen)

22222222-2222-2222-2222-222222222222 = Protect – basic white-listing

33333333-3333-3333-3333-333333333333 = Strict – a strong control

Possible event entries

  • SetTargetOK – information that the change was made

ExtractBodyTarget (Extract value from message body)

This command extracts a value from the message body (BodyText and, if empty, then BodyHtml), and saves it to the data set field. This command is used to extract values from e-mail message texts, from web forms etc.

Target values

(Targets)

A field name from the data set to which the value is to be saved (TargetColumn). Example: “Membership”

Parameters

(Parameters)

A template for a regular expression that should contain a group called target.

http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.100).aspx

Example:

^E-mail: *(?<target>[^0-9<][A-z0-9_]+([.][A-z0-9 _]+)*@[A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4})*$

Target ID

(TargetId)

The required XSS filtering of text values taken from the message:

00000000-0000-0000-0000-000000000000 = None – none,

11111111-1111-1111-1111-111111111111 = Filter – basic back-listing (default if not filled out or does not match the specimen)

22222222-2222-2222-2222-222222222222 = Protect – basic white-listing

33333333-3333-3333-3333-333333333333 = Strict – a strong control

Possible event entries

  • ExtractBodyTargetOK – The action command was correctly executed; a jump to TargetOnSuccess follows

  • ExtractBodyTargetNoMatch – No match was found; the target group is empty; a jump to TargetOnFailure follows

SwitchTarget (Branching by column)

This action command allows you to change the program run. Apart from the TimeMode time condition, there is still the Parameters field, which indicates a value that needs to be contained in the selected data set column. The Targets field indicates a name of the data set column that should contain the given value. If the condition is fulfilled, the target of TargetOnSuccess is used; otherwise, the script jumps to TargetOnFailure.

Parameters

(Parameters)

The value that is to be compared. It uses the SQL LIKE syntax. If it contains the special value of ##Empty##, then the condition applies if the data set field equals an empty string. If it is empty, then the condition applies if the field contains NULL.

Example: “1000%”

Example: “” [test for NULL]

Target values

(Targets)

Data set column name.

Example 1: “Membership”

Example 2: “c_card”

Possible events

  • SwitchTargetOK – Fulfilled; a jump to TargetOnSuccess follows

  • SwitchTargetNoTarget – The conditions is not fulfilled for the data set field value; a jump to TargetOnFail follows

SwitchDb (Branching by DB)

First option is a command, that performs a parametric query using the ODBC mechanism over a selected data source; the returned values are recorded in a data set fields (ScenarioResult) or variables, provided that the field names match those in TargetColumn or name of existing variable (without % prefix). If the IvrApplyQueryResultToNullOnly configuration parameter is selected, only those fields are overwritten that have the NULL value. Windows and Linux supported. Used for on-premise installations with additional ODBC drivers.

The second option is ADO.NET connection. With this option, you can’t use the full connection string, but instead, the one set in appsettings.json will be used (file according to the background service). Used for container installations.

  • Note 1: All parameters are submitted and returned as text nvarchar.

  • Note 2: This command can also be used to carry out customer calculations using the SQL Server

File name

(FileName)

A connection string for the ODBC provider.

More info:

https://www.connectionstrings.com/microsoft-odbc-driver-17-for-sql-server/

Example for SQL Server 2019: Driver={ODBC Driver 17 for SQL Server};Server=myServerAddress;Database=myDataBase;UID=myUsername;PWD=myPassword

A connection string for the ADO provider.

Example:

  • ADO – connection to the default server and database, which FS uses

  • ADO TableName – connection to the default server, but default database is substituted for the provided "TableName"

Parameters

(Parameters)

Names of data set fields (TargetColumn), the values of which will be used as the query parameters. The separating characters are commas or semicolons. The parameter sequence determines their insertion in the ODBC command. Special parameters:

“##RemoteAddress##” – an e-mail address or the number of the SMS sent (depending on the channel type)

“##MessageId##” – message ID

“##MessageType##” – message type/channel: E-mail, SMS, Fax, SocWall, SocMsg

“##PilotAddress##” – inbound pilot (gateway) address

“##FromField##” – “From” field text

“##ToField##” – “To” field text

“##ToCcField##” –“Copy” field text

“##SubjectField##” – “Subject” field text

“##BodyText##” – BodyText field text; if empty, then the BodyHtml field text with the tags removed

“##BodyHtml##” – BodyHtml field text; if empty, then the BodyText field text extended with basic tags

“##ProjectName##” – a project name if known already

“##Culture##” – the language in the Culture notation (e.g. “cs”)

“##RecievedTime##” – the message received time based on the local time zone

“##ScenarioResultId##” – data set ID

“##None##” – no parameter

Example 1: “MemberNumber”

Example 2: “MemberNumber,##Culture##”

Target values

(Targets)

A parametric ODBC command suitable for the given provider. The parameters are marked with " ? " and submitted to the query based on the sequence.

More info: https://learn.microsoft.com/en-us/dotnet/api/system.data.odbc.odbccommand.parameters?view=dotnet-plat-ext-7.0

Example 1: “exec FindMember ?”

Example 2: “SELECT * FROM Membership WHERE Id=?”

ADO.Net usage:

Example: ” SELECT * FROM Membership WHERE Id=@MemberNumber

Possible events

  • SwitchDbOK – Fulfilled; the returned value is not 0; a jump to TargetOnSuccess follows

  • SwitchDbNoTarget – Not fulfilled; the returned value is 0, a jump to TargetOnFail follows

  • SwitchDbError – The query failed; ResultData shows the error code; the script proceeds to the next line

QueryDb (Query to DB)

First option is a command, that performs a parametric query using the ODBC mechanism over a selected data source; the returned values are recorded in a data set fields (ScenarioResult) or variables, provided that the field names match those in TargetColumn or name of existing variable (without % prefix). If the IvrApplyQueryResultToNullOnly configuration parameter is selected, only those fields are overwritten that have the NULL value. Windows and Linux supported. Used for on-premise installations with additional ODBC drivers.

The second option is ADO.NET connection. With this option, you can’t use the full connection string, but instead, the one set in appsettings.json will be used (file according to the background service). Used for container installations.

  • Note 1: All parameters are submitted and returned as text nvarchar.

  • Note 2: This command can also be used to carry out customer calculations using the SQL Server

File name

(FileName)

A connection string for the ODBC provider.

More info: https://www.connectionstrings.com/microsoft-odbc-driver-17-for-sql-server/

Example for SQL Server 2019: Driver={ODBC Driver 17 for SQL Server};Server=myServerAddress;Database=myDataBase;UID=myUsername;PWD=myPassword

A connection string for the ADO provider.

Example:

  • ADO – connection to the default server and database, which FS uses

  • ADO TableName – connection to the default server, but default database is substituted for the provided "TableName"

Parameters

(Parameters)

Names of data set fields (TargetColumn), the values of which will be used as the query parameters. The separating characters are commas or semicolons. The parameter sequence determines their insertion in the ODBC command. Special parameters:

“##RemoteAddress##” – an e-mail address or the number of the SMS sent (depending on the channel type)

“##MessageId##” – message ID

“##MessageType##” – message type/channel: E-mail, SMS, Fax, SocWall, SocMsg

“##PilotAddress##” – inbound pilot (gateway) address

“##FromField##” – “From” field text

“##ToField##” – “To” field text

“##ToCcField##” –“Copy” field text

“##SubjectField##” – “Subject” field text

“##BodyText##” – BodyText field text; if empty, then the BodyHtml field text with the tags removed

“##BodyHtml##” – BodyHtml field text; if empty, then the BodyText field text extended with basic tags

“##ProjectName##” – a project name if known already

“##Culture##” – the language in the Culture notation (e.g. “cs”)

“##RecievedTime##” – the message received time based on the local time zone

“##ScenarioResultId##” – data set ID

“##None##” – no parameter

Example 1: “MemberNumber”

Example 2: “MemberNumber,##Culture##”

Target values

(Targets)

A parametric ODBC command suitable for the given provider. The parameters are marked with " ? " and submitted to the query based on the sequence.

More info: https://learn.microsoft.com/en-us/dotnet/api/system.data.odbc.odbccommand.parameters?view=dotnet-plat-ext-7.0

Example 1: “exec FindMember ?”

Example 2: “SELECT * FROM Membership WHERE Id=?”

ADO.Net usage:

Example: ” SELECT * FROM Membership WHERE Id=@MemberNumber

Possible event entries

  • QueryDbOK – The query was performed successfully; ResultData indicates how many fields were used from how many returned fields; a jump to TargetOnSuccess follows

  • QueryDbFail – The query failed; ResultData shows the error code; a jump to TargetOnFailure follows

QueryUrlJson (Query for URL in JSON)

Performs a parametric query using the http/https mechanism for the entered web server, and then processes the returned values as a single record in the JSON format (http://www.json.org) and records the result in the data set (ScenarioResult), provided that there are identical TargetColumn field names. If the ImrApplyQueryResultToNullOnly configuration parameter is set, only those fields are overwritten that have the value of NULL.

Note 1: All parameters are submitted and returned as text within the Query String or as placeholders. Note 2: This command can also be used to write and update values using the web server.

Reference text

ReferenceText

The primary URL address for which parameters are submitted as a Query String:

Parameter example:

Example of a sent URL with the parameter values of lang=”cz” and number=”41547”:

“atlantis.cz/OrderStatus.aspx?lang=cz&number=41457”

The primary URL address for which parameters are submitted in the place of placeholders:

Parameter example:

https://www.atlantis.cz/{lang}/{number}”

Example of a sent URL with the parameter values of lang=”cz” and number=”41547”:

https://www.atlantis.cz/cz/41457

Note: Special parameters are stated in braces without the # characters; it is necessary to avoid a collision of names and the form.

The address can contain the ##LSN## macro-element.

Parameters

(Parameters)

Names of data set fields (TargetColumn), the values of which will be used as the query parameters. The separating characters are commas or semicolons. The parameter sequence determines their insertion in the command.
Special parameters:

“##RemoteAddress##” – an e-mail address or the number of the SMS sent (depending on the channel type)

“##MessageId##” – message ID

“##MessageType##” – message type/channel: E-mail, SMS, Fax, SocWall, SocMsg

“##PilotAddress##” – inbound pilot (gateway) address

“##FromField##” – “From” field text

“##ToField##” – “To” field text

“##ToCcField##” –“Copy” field text

“##SubjectField##” – “Subject” field text

“##BodyText##” – BodyText field text; if empty, then the BodyHtml field text with the tags removed

“##BodyHtml##” – BodyHtml field text; if empty, then the BodyText field text extended with basic tags

“##ProjectName##” – a project name if known already

“##Culture##” – the language in the Culture notation (e.g. “cs”)

“##RecievedTime##” – the message received time based on the local time zone

“##ScenarioResultId##” – data set ID

“##None##” – no parameter

Example 1: “MemberNumber”

Example 2: “MemberNumber,##Culture##”

Target values

(Targets)

A username and password if it is to be used for a general http/s authentication, separated with a semicolon.

Example 1: “system;ws7787!P”

It is also possible to use the special value of “SSPI”, in which case an integrated login is used under the Windows account under which the iCC asynchronous service is running.

Example 2: “SSPI”

If it is necessary to send a basic authentication without the 401/WWW-Authenticate handshake, then the following prefix can be added before the username: “!PRE!”

Example 3: “!PRE!system;ws7787!P”

Reference ID

(ReferenceId)

The GUID value starting with “99999999” – placeholders are used with the format of {name} and parameters from Parameters are submitted as a “flat” JSON structure in the body of the HTTP POST request.

Any other value – a URL address is used, followed by a Query String (HTTP GET)

An empty value – placeholders are used with the format of {name} (REST HTTP GET)

Example: “00000000-0000-0000-0000-000000000000”

Reference number

(Reference)

A code page used for the response; examples (depending on the installed server version):

empty – auto-detection

1250 – Windows 1250

852 – DOS 852

65001 – UTF8

Possible event entries

  • QueryUrlJsonOK – The query was performed successfully; ResultData indicates how many fields were used from how many returned fields; a jump to TargetOnSuccess follows

  • QueryUrlJsonFail – The query failed; a jump to TargetOnFailure follows

QueryUrlText (Query for URL as Text)

Performs a parametric query using the http/https GET mechanism for the entered web server, and then processes the returned values as a single text value and, if relevant, writes it in the data set (ScenarioResult) in a field of the name specified in Targets (the TargetColumn field). If there is no script associated with the WF or Parameters is empty, only the URL will be called. If Targets does not contain the target field, the returned http response is discarded.

Note 1: All parameters are submitted as text within the Query String or as placeholders. Note 2: This command can also be used to write and update values using the web server.

Reference text

(ReferenceText)

The primary URL address for which parameters are submitted as a Query String:

Parameter example:

Example of a sent URL with the parameter values of lang=”cz” and number=”41547”:

The primary URL address for which parameters are submitted in the place of placeholders:

Parameter example:

https://www.atlantis.cz/{lang}/{number}?Id={InstanceRefId}”

Example of a sent URL with the parameter values of lang=”cz” and number=”41547”:

https://www.atlantis.cz/cz/41457

Note: Special parameters are stated in braces without the # characters; it is necessary to avoid a collision of names and the form.

The address can contain the ##LSN## macro-element.

Parameters

(Parameters)

Names of data set fields (TargetColumn), the values of which will be used as the query parameters. The separating characters are commas or semicolons. The parameter sequence determines their insertion in the command.
Special parameters:

“##RemoteAddress##” – an e-mail address or the number of the SMS sent (depending on the channel type)

“##MessageId##” – message ID

“##MessageType##” – message type/channel: E-mail, SMS, Fax, SocWall, SocMsg

“##PilotAddress##” – inbound pilot (gateway) address

“##FromField##” – “From” field text

“##ToField##” – “To” field text

“##ToCcField##” –“Copy” field text

“##SubjectField##” – “Subject” field text

“##BodyText##” – BodyText field text; if empty, then the BodyHtml field text with the tags removed

“##BodyHtml##” – BodyHtml field text; if empty, then the BodyText field text extended with basic tags

“##ProjectName##” – a project name if known already

“##Culture##” – the language in the Culture notation (e.g. “cs”)

“##RecievedTime##” – the message received time based on the local time zone

“##ScenarioResultId##” – data set ID

“##None##” – no parameter

Example 1: “MemberNumber”

Example 2: “MemberNumber,##Culture##”

Target values

(Targets)

A name of the data set field to which the text returned by means of http is to be saved. Optionally also a username and password (the values are separated with semicolons).

Example 1: “MemberNumber”

Example 2: “MemberNumber;system;ws7787!P”

It is also possible to use the special value of “SSPI”, in which case an integrated login is used under the Windows account under which the iCC synchronous service is running.

Example 3: “MemberNumber;SSPI”

The returned value can be ignored.

Example 4: “;SSPI”

Reference ID

(ReferenceId)

Any value – uses the URL followed by a Query String

An empty value – placeholders are used with the format of {name}

Example: “00000000-0000-0000-0000-000000000000”

Reference number

(Reference)

A code page used for the response; examples (depending on the installed server version):

empty – auto-detection

1250 – Windows 1250

852 – DOS 852

65001 – UTF8

Possible events

  • QueryUrlTextOK – The query was performed successfully; ResultData indicates how many fields were used from how many returned fields or the “Discarded” value if the IMR has no scenario or Targets is empty; a jump to TargetOnSuccess follows

  • QueryUrlTextFail – The query failed; a jump to TargetOnFailure follows

GeneeaTags (Analysis of tags in text

This command detects meaningful tags in the text (message body). It calls JSON web services internally at the following address: https://api.geneea.com; for more details please refer to: https://api.geneea.com/#!/geneea-api-s2/tagsPost. The result from calling is returned in a tag field; every tag contains a text value and a numerical value, referred to as the “score”. Parameters need to be used to define the max. number of processed tags and a limit for the “score”, a so-called threshold. The threshold is a numerical value that defines a minimum level for the “score”, i.e. the tag is processed only if “score” >= “Threshold”.

The returned values are recorded in the data set (ScenarioResult), provided that there are identical TargetColumn field names.

The names in TargetColumn must be defined in a pair (one for the text value of the tag, the other one for the “score”) and separated with a comma; when defining them, it is necessary to consider the number of processed tags as well.

Reference text

(ReferenceText)

This text defines a userKey, which is a customer identifier when calling the Geneea web services.

Example: “a5005f214989509ed664bce196bd2c90”

Parameters

(Parameters)

Values indicating the maximum number of processed tags and the threshold, separated with a comma.

Example 1: “3,1.5” - max. number of tags =3 and threshold=1.5

Example 2: “1,2” - max. number of tags =1 and threshold=2

Target values

(Targets)

Defines column names in ScenarioResult, separated by commas.

The columns need to be defined in pairs – one for storing the text value, the other one for the score.

  • The columns can be either listed, in which case it must reflect the max. number of processed tags.

  • Alternatively, you can use the “%” wild card in the right-hand side of the column name, in which case only 2 columns are defined; this works similarly to “like” in SQL.

Example 1: “targetcolumtext1, targetcolumnscore1, targetcolumtext2, targetcolumnscore2, targetcolumtext3, targetcolumnscore3” – when defining by listing columns, let us consider e.g. a processing of max. 3 tags, then we need to define 6 columns for them.

Example 2: “targetcolumtext%, targetcolumnscore%” – when defining using the wild card of “%”, we will again process max. 3 tags, but in this case we will need to define just two columns.

Possible event entries

  • GeneeaTagsOK – The processing was successful; a jump to TargetOnSuccess follows

  • GeneeaTagsFail – The processing failed; a jump to TargetOnFailure follows

  • GeneeaTagsError – The processing failed; ResultData indicates the error details; the script proceeds with the next line

  • GeneeaTagsNoSuitableTagsForThreshold – No tag in the tag field meets the condition of “score” >= “Threshold”; the script continues with the next line

  • GeneeaTagsEmptyBody – An attempt at processing a message with an empty text; the script proceeds with the next line

GeneeaSentiment (Text sentiment analysis)

This command estimates the sentiment (“mood”) based on the text (message body). It calls JSON web services internally at the following address: https://api.geneea.com; for more details please refer to: https://api.geneea.com/#!/geneea-api-s2/sentimentPost.

The sentiment is expressed with an integer value of the remaining values (-1,0,1):

  • -1 = negative

  • 0 = neutral

  • 1 = positive

Furthermore, the command returns the language identification and the number of characters used for the analysis.

The returned values are recorded in the data set (ScenarioResult), provided that there are identical TargetColumn field names.

Reference text

(ReferenceText)

This text defines a userKey, which is a customer identifier when calling the Geneea web services.

Example: “a5005f214989509ed664bce196bd2c90”

Target values

(Targets)

Defines column names in ScenarioResult used to save values, which are separated with commas.

Sequence of columns: sentiment, language, number of characters used

Example: “columnSentiment, columnLanguage, columnUsedChars”

Possible event entries

  • GeneeaSentimentOK – The processing was successful; a jump to TargetOnSuccess follows

  • GeneeaSentimentFail – The processing failed; a jump to TargetOnFailure follows

  • GeneeaSentimentError – The processing failed; ResultData indicates the error details; the script proceeds with the next line

  • GeneeaSentimentEmptyBody – An attempt at processing a message with an empty text; the script proceeds with the next line

GeneeaAnalyze (NLP analysis)

This command performs an NLP (Natural language processing) analysis of the given message to support customers; it is basically a categorization. It calls JSON web services internally at the following address: https://api.geneea.com, where the result is returned as a text value defining a category.

The returned values are recorded in the data set (ScenarioResult), provided that there are identical TargetColumn field names.

Reference text

(ReferenceText)

This text defines a userKey, which is a customer identifier when calling the Geneea web services.

Example: “a5005f214989509ed664bce196bd2c90”

Target values

(Targets)

Defines a name of a ScenarioResult column that is used to save the category.

Possible event entries

  • GeneeaAnalyzeOK – The processing was successful; a jump to TargetOnSuccess follows

  • GeneeaAnalyzeFail – The processing failed; a jump to TargetOnFailure follows

  • GeneeaAnalyzeError – The processing failed; ResultData indicates the error details; the script proceeds with the next line

  • GeneeaAnalyzeEmptyBody – An attempt at processing a message with an empty text; the script proceeds with the next line