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.
<Notifications>
<Notification type="onEmailTriggered" targetscreen=" ">
</Notification>
</Notifications>
<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>
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>
<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>