Creating Notifications to Make the Hybrid App Server-Initiated

To make the Hybrid App server-initiated, you must modify the WorkflowClient.xml file and create a notification.

By default, the <Notifications> section is empty.

  1. Create a notification.
    Each notification has two child nodes—Transformation and Methods
  2. Create a notification node, for example:
    <Notifications>
         <Notification type="onEmailTriggered" targetscreen=" ">
         </Notification>
    </Notifications>
    You can simply copy the Methods from the appropriate object query (for example, findByPrimaryKey) that is generated automatically in the WorkflowClient.xml file, for example:
    <Notifications>
      <Notification type="onEmailTriggered" targetscreen=" ">
         <Methods>
           <Method name="findByPrimaryKey" type="search" mbo="Department" package="apiTesttDepartmentOneToMany:1.0" showCredScreenOnAuthFailure="true" >               
             <InputBinding optype="none" opname="findByPrimaryKey" generateOld="true">                 
               <Value sourceType="Key" workflowKey="Department_dept_id_attribKey" paramName="dept_id" attribName="dept_id" mboType="int"/>               
             </InputBinding>
             <OutputBinding generateOld="true">
               <Mapping workflowKey="Department_dept_id_attribKey" workflowType="number" attribName="dept_id" mboType="int"/>
             […]              
             </OutputBinding>             
           </Method>           
         </Methods>     
      </Notification>   
    </Notifications> 
  3. Create a Transformation node.

    You must manually write the Transformation section. The contents depend on how many input parameters the object query has. For each input parameter, you need a corresponding Rule node as a child of the Transformation node. The workflowKey of the Rule node corresponds to the InputBinding’s Value for that input parameter. For example:

    <Notifications>
      <Notification type="onEmailTriggered" targetscreen=" ">
            <Transformation>         
    </Transformation>   
            <Methods>
              <Method name="findByPrimaryKey"
            type="search" mbo="Department"
            package="apiTesttDepartmentOneToMany:1.0" showCredScreenOnAuthFailure="true" >
                <InputBinding optype="none" opname="findByPrimaryKey" generateOld="true">
                  <Value sourceType="Key"
            workflowKey="Department_dept_id_attribKey" paramName="dept_id" attribName="dept_id"
                mboType="int"/>
                </InputBinding>
                <OutputBinding
              generateOld="true">                  
                  <Mapping
            workflowKey="Department_dept_id_attribKey" workflowType="number" attribName="dept_id"
                mboType="int"/>
                 […]
                </OutputBinding>
              </Method>
            </Methods>
      </Notification>
    </Notifications>       
  4. For each input parameter in the object query, create a corresponding Rule and make sure the workflowKey of the Rule matches the Value of the InputBinding. For example:
    <Notifications>   
      <Notification type="onEmailTriggered" targetscreen=" ">   
            <Transformation>   
              <Rule type="regex-extract"
              source="subject" workflowKey="dept_id" workflowType="number" beforeMatch="dept_id =
              " afterMatch="" format=""/>    
            </Transformation>   
            <Methods>   
              <Method name="findByPrimaryKey"
            type="search" mbo="Department"
            package="apiTesttDepartmentOneToMany:1.0" showCredScreenOnAuthFailure="true" >   
                <InputBinding optype="none" opname="findByPrimaryKey" generateOld="true">   
                  <Value sourceType="Key"
            workflowKey="dept_id"
            paramName="dept_id" attribName="dept_id" mboType="int"/>   
                </InputBinding>   
                <OutputBinding
              generateOld="true">                     
                  <Mapping
            workflowKey="Department_dept_id_attribKey" workflowType="number" attribName="dept_id"
                mboType="int"/>   
                 […]   
                </OutputBinding>   
              </Method>   
            </Methods>   
      </Notification>   
    </Notifications>    
  5. Save the file.
Related reference
Generated Hybrid App Files