The server notification pattern supports any number of MBO definitions. For this example, create an MBO with one load argument, assign the load argument a propagate-to attribute value, then assign the MBO to a cache group that uses an Online policy.
The MBO definition described here allows retrieval of online
results by the Hybrid App to which the MBO belongs.
- In Unwired WorkSpace, create an MBO from the sampledb database that has at least one load argument. For example, you could define a Sales_order MBO as:
SELECT id,
cust_id,
order_date,
fin_code_id,
region FROM sampledb.dba.sales_order
WHERE id = :order_id
- Preview the MBO by selecting Preview from the Definition tab. Enter 2001 as the value. The preview returns one row from the sales_order table based on the id attribute (2001).
- In the MBO Properties view, click the Load Arguments tab, select the id attribute as the Propagate to attribute that maps to the order_id load argument. Change the datatype to INT, and include an integer value for the data source default value.
- Set the Online cache group policy
for the MBO.
- Add the MBO to a cache group that uses the Online cache group policy. For example, create a new cache group named CacheGroupOnline and set the policy to Online.
- Drag and drop the MBO to CacheGroupOnline.
The findByParameter object query is automatically generated based on the order_id load argument:
SELECT x.* FROM Sales_order x WHERE x.id = :order_id
- Deploy the project that contains the MBO to Unwired Server.