WorkflowClient.xml File

The WorkflowClient.xml file contains metadata that specifies how to map the data in the workflow message to and from calls to Mobile Business Object (MBO) operations and object queries.

Example 1

WorkflowClient.xml
<?xml version="1.0" encoding="utf-8"?> 
<Workflow xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="WorkflowClient.xsd" >   
  <Globals>     
    <DefaultScreens activation="…" credentials="…"/>   
  </Globals>   
  <Triggers>      
    <Actions>
      <Action name="…" sourcescreen="…" targetscreen="…" errorscreen="…">
        <Methods>           
          <Method type="replay" mbo="…" package="…" >             
            <InputBinding optype="…" opname="…" generateOld="…">               
              <Value sourceType="…" workflowKey="…" paramName="…" mboType="…"/>
              <Value sourceType="…" workflowKey="…" relationShipName="…" mboType="list">
            <InputBinding optype="delete" opname="…" generateOld="….">
              <Value sourceType="…" workflowKey="…" paramName="…" attribName="…" mboType="…"/>
            </InputBinding>                 
            <InputBinding optype="update" opname="…" generateOld="….">
              <Value sourceType="…" workflowKey="…" paramName="…" attribName="…" mboType="…"/>
            </InputBinding>                 
            <InputBinding optype="create" opname="…" generateOld="….">
              <Value sourceType="…" workflowKey="…" paramName="…" attribName="…" mboType="…"/>
            </InputBinding>               
              </Value>             
            </InputBinding>             
            <OutputBinding generateOld="…">               
              <Mapping workflowKey="…" workflowType="…" attribName="…" mboType="…"/>
              <Mapping workflowKey="…" workflowType="list" mboType="list">
              <Mapping workflowKey="…" workflowType="…" attribName="…" mboType="…"/>
              </Mapping>             
            </OutputBinding>           
          </Method>         
        </Methods>       
      </Action>     
    </Actions>     
    <Notifications>         
        <Notification type="onEmailTriggered" targetscreen="…">           
          <Transformation>           
          <Rule type="regex-extract" source="…" workflowKey="…" workflowType="…" beforeMatch="…" afterMatch="…" format="…"/>
        </Transformation>         
        <Methods>           
          <Method name="…" type="…" mbo="…" package="…">             
            <InputBinding opname="…" optype="…">               
              <Value sourceType="…" workflowKey="…" paramName="…" attribName="…" mboType="…"/>            
            </InputBinding>             
            <OutputBinding generateOld="…">			                   
              <Mapping workflowKey="…" workflowType="…" attribName="…" mboType="…"/>
              <Mapping workflowKey="…" workflowType="list" mboType="list">
                <Mapping workflowKey="…" workflowType="…" attribName="…" mboType="…"/>
              </Mapping>             
            </OutputBinding>           
          </Method>         
        </Methods>       
      </Notification>     
    </Notifications>   
  </Triggers> 
</Workflow>

Globals

<Globals> <DefaultScreens activation="Introduction" credentials="Authentication"/> </Globals>

Describes the global information for the Mobile Workflow metadata.

Inner tags

<DefaultScreens activation=”…” credentials=”…”/> contains two optional attributes—activation and credentials—that allow you to specify the screens to use for activation and credential requests.

Triggers

<Triggers> <Actions> … </Actions> <Notifications> … </Notifications> </Triggers>

Describes the conditions under which MBO operations and/or object queries run and, where appropriate, what to return to the device.

Inner tags

<Actions> … </Actions> Contains the description for one or more MBO operations and/or object queries to execute when an online request or submit workflow action is received from the client.

<Notifications> … </Notifications> Contains the description of, at most, one way to extract values from an incoming server notification, execute an MBO object query, and send that notification on to the device.

Action

<Action name="Online_Request" sourcescreen="Reports_Create" targetscreen="OnReportsCreateSuccess" errorscreen="OnReportsCreateFailure"> … </Action>

Describes the conditions under which MBO operations and/or object queries run and, where appropriate, what to return to the device.

Attributes
Attribute Description
name The name of the action, which typically corresponds to the key of the menuitem that invoked the action.
sourcescreen The screen from where the action was invoked.
targetscreen This attribute is optional. The screen to which the client will return, by default, if the MBO operation/object query succeeds. If left unspecified, the client application remains on the current screen. This attribute is applicable only to online request actions.
errorscreen This attribute is optional. The screen to which the client will return, by default, if the MBO operation/object query fails. If left unspecified, the client application remains on the current screen. This attribute is applicable only to online request actions.
  • errorlogskey
  • errorlogmessagekey
  • errorlogmessageaslistkey
The keys used to fill any error log messages.

Inner tags

<Methods> … </Methods> Contains the description for one or more MBO operations and/or object queries to be executed when this online request or submit workflow action is received from the client.

Method

<Method type="replay" mbo="Reports" package="testReports:1.0"> … </Method>

Describes the conditions under which MBO operations and/or object queries run and, where appropriate, what to return to the device.

Attributes
Attribute Description
type The type of method to invoke. For object queries, this must be search. For operations, it must be replay.
mbo The name of the mobile business object (MBO).
package The Mobile Workflow package name and version of the MBO, separated by a colon, for example, <package_name>:<mbo_version>.

Inner tags

<InputBinding> … </InputBinding> Contains the description of how to map the key values to the parameters of one or more of the MBO operations and/or object queries to be executed when this online request or submit workflow action is received from the client.

<OutputBinding> … </OutputBinding> Contains the description of how to map the response from the object query to key values.

InputBinding

<InputBinding optype="create" opname="create" generateOld="false"> … </InputBinding>

Contains the MBO operation to invoke and how to map the key values to the parameters of that operation.

Attributes
Attribute Description
optype The type of MBO operation to invoke. Must be one of these types:
  • none
  • create
  • update
  • delete
  • other
opname The name of the MBO operation to invoke.
generatedOld A boolean that indicates whether or not to generate old value keys.

Inner tags

<Value> … </Value> Contains the description of where to obtain the parameter values of the MBO operations to be executed when this online request or submit workflow action is received from the client.

Value

<Value sourceType="Key" workflowKey="Reports_type_id_attribKey" attribName="id" mboType="int"/>

Describes how to obtain the parameter value or attribute value from the workflow message.

Attributes
Attribute Description
sourceType The source of the data. Must be one of these types:
  • Key
  • BackEndPassword
  • BackEndUser
  • DeviceId
  • DeviceName
  • DeviceType
  • UserName
  • MessageId
  • ModuleName
  • ModuleVersion
  • QueueId
  • ContextVariable
workflowKey If the sourceType is Key, the name of the key in the workflow message from which to obtain the value.
contextVariable If the sourceType is ContextVariable, the name of the context variable from which to obtain the value.
paramName If present, the name of the parameter the value is supplying.
pkName If present, the name of the personalization key the value is supplying.
attribName If present, the name of the attribute name the value is supplying. This value may, or may not, be present together with paramName.
parentMBO The name of the parent MBO, if any.
relationShipName The name of the relationship, if any.
mboType The type of the value in MBO terms. Must be one of these types:
  • string
  • char
  • date
  • datetime
  • time
  • int
  • byte
  • short
  • long
  • decimal
  • boolean
  • binary
  • float
  • double
  • list
  • integer
  • structure
array A boolean that indicates whether or not the value is an array. The default is false.
length The length of the parameter/attribute/personalization key.
precision The precision of the parameter/attribute/personalization key.
scale The scale of the parameter/attribute/personalization key.
convertToLocalTime A boolean that indicates whether or not to convert the value to a local time before passing it to the MBO. The default is false.

Inner tags

<InputBinding> … </InputBinding> If the mboType is “list,” it will be necessary to specify child input bindings to indicate which MBO operations to invoke when a child is updated, deleted, or created.

OutputBinding

<OutputBinding generateOld="true"> … </OutputBinding>

Contains a series of mappings that indicate how to map the results of the object query to the workflow message.

Attributes
Attribute Description
generatedOld A boolean that indicates whether or not to generate old value keys.

Inner tags

<Mapping> … </Mapping> Contains the description of how to map the results of the object query to a key in the workflow message.

Mapping

<Mapping workflowKey=”Department_dept_id_attribKey” workflowType=”number” attribName=”dept_id” mboType=”int”/>

Describes how to fill a key’s value in the workflow message from the results of the object query.

Attributes
Attribute Description
workflowKey The name of the key in the workflow message to fill with the results of the object query.
workflowType The type of the data in the workflow message. Must be one of these types:
  • text
  • number
  • boolean
  • datetime
  • date
  • time
  • list
  • choice
attribName If present, the name of the attribute name to which the key is mapped.
hardCodedValue If the workflowType is not choice, and attribName is not present, the hard-coded value to which the key is mapped.
keyWorkflowKey If the workflowType is choice, the key to which to map the dynamic display names of the choice.
valueWorkflowKey If the workflowType is choice, the key to which to map the dynamic values of the choice.
assumeLocalTime A boolean to indicate whether or not to assume that the values coming back from the object query are in local time or not. The default is false.
array A boolean that indicates whether or not the value is an array. The default is false.
mboType The type of the value in MBO terms. Must be one of these types:
  • string
  • char
  • date
  • datetime
  • time
  • int
  • byte
  • short
  • long
  • decimal
  • boolean
  • binary
  • float
  • double
  • list
  • integer
  • structure
relationShipName The name of the relationship, if any.

Inner tags

<Mapping> … </Mapping> If the mboType is list, you must specify child mappings to indicate how to map the attributes of child MBO instances to keys in the workflow message.

Notification

<Notification type="onEmailTriggered" targetscreen="dept"> … </Notification>

Describes how to formulate the workflow message for the given notification type and which screen to open on the device when that workflow message is opened.

Attributes
Attribute Description
type The type of the notification. Must be onEmailTriggered.
targetscreen The screen to which the client will be opened if the object query succeeds.
errorscreen The screen to which the client will be opened, by default, if the object query fails.
  • errorlogskey
  • errorlogmessagekey
  • errorlogmessageaslistkey
The keys to use to fill any error log messages.

Inner tags

<Transformation> … </Transformation> Contains the description for one or more rules that dictate how to extract values from the server notification and map it to a key in the workflow message.

<Methods> … </Methods> Contains the description for one or more object queries to be executed when this online request or submit workflow action is received from the client.

Rule

<Rule type="regex-extract" source="subject" workflowKey="ID" workflowType="number" beforeMatch="Purchase order request \(" afterMatch="\) is ready for review" format=""/>

Describes how to extract a value from the server notification and map it to a key in the workflow message.

Attributes
Attribute Description
type The type of the rule. Must be regex-extract.
source The source of the data to be extracted. Must be one of these sources:
  • body
  • subject
  • from
  • to
  • cc
  • receivedDate
  • custom1, custom2, custom3, custom4, custom5, custom6, custom7, custom8, custom9, or custom10
workflowKey The name of the key in the workflow message to fill with the value extracted from the server notification.
workflowType The type of the data in the workflow message. Must be one of these data types:
  • text
  • number
  • boolean
  • datetime
  • date
  • time
  • list
  • choice
assumeLocalTime A boolean to indicate whether or not to assume that the values coming back from the object query are in local time or not. The default is false.
beforeMatch A regular expression used to indicate where the value starts.
afterMatch A regular expression used to indicate where the value ends.
format If the workflowType is datetime or time, the C# formatting string to be passed to DateTime.ParseExact when converting the value to a datetime.