Specifying the Rules

There can be more than one Page Flow per Model Level, and Rules can be set to dictate which one is used depending on the User Context and the Model data. The Rules Editor can be accessed by clicking on the Model Level node in the Page Editor Explorer.

images/download/attachments/144836651/rules_editor-version-1-modificationdate-1656011746000-api-v2.png

  1. Click Add New Rule to open the New Rule dialog.

  2. Set the variable to User's Role Type and enter ZBKS.SampleRoleType as the value. Then select Default ZBKS.Book as the Page Flow. Then click OK.

  3. Click Save to persist the new rule in the database.

  4. Ensure that ZBKS.SampleRoleType has permissions to execute the PLT.Create and PLT.Update actions on ZBKS.Book.

  5. Add the following WebAction to your UI Meta Model, and add a corresponding WebActionRef for it to the RoleTypeUiConfig for ZBKS.SampleRoleType. Then deploy the UIMM.

    WebAction example:

    <WebAction name="CreateBook">
    <PanelOptions>
    <PanelClass>One.ext.page.PageFlowDetail</PanelClass>
    <PanelConfig>{ "modelLevel": "ZBKS.Book" }</PanelConfig>
    </PanelOptions>
    </WebAction>

    WebActionRef example:

    <WebActionRef name="CreateBook"/>

    Save the MPT, and then Click images/download/attachments/144836651/submit_btn-version-1-modificationdate-1656011763000-api-v2.png Submit to submit it to the server.

  6. Log in as BookstoreUser, and click the new Create Book menu. You should see the create page you constructed using the Page Editor Explorer:

    images/download/attachments/144836651/udp_create_book-version-1-modificationdate-1656011781000-api-v2.png

  7. Populate the required fields and click Create Book, and it should navigate to the read-only detail page with an Actions button in the bottom-right corner, which is what we configured earlier with the Page Flow Editor.