Adding an Action

  1. Open Bookstore's Module Process Template.mpt file by double-clicking on it. The editor should open:
    images/download/attachments/144836558/mpt_editor-version-1-modificationdate-1670861100000-api-v2.png

  2. Open the Outline tile.

  3. Select Bookstore's Book model that you created in the last chapter, which should display an overview for the model in the Module Process Template (MPT) Editor. Click the Permissions tab:

    images/download/attachments/144836558/mpt_editor_book-version-1-modificationdate-1670861100000-api-v2.png

  4. In the Role Type list box under the Permissions section, select ZBKS.SampleRoleType. For both the Read and Write permissions, select the By Dimension check box, and then select the Value Chain option:

    images/download/attachments/144836558/mpt_editor_permissions-version-1-modificationdate-1670861100000-api-v2.png

    This gives every User with Role Type ZBKS.SampleRoleType the ability to read and write all Books in the system. (Strictly speaking, all Books under a single Value Chain, but we have only one Value Chain here.) In a more realistic scenario, you might configure it a bit differently by comparing the User's Enterprise, Org or Site against Enterprises, Orgs and Sites on the Model itself. This topic is covered later in the User's Guide.

  5. Now we're going to add a Create Action for the Book Model, so that we can create instances of our Book. Select the Actions tab inside the MPT Editor.

    An "action" is an operation executed on a model that typically ends with writing the model to the database. There are four actions provided by Platform for every model:


    • PLT.Create

    • PLT.Update

    • PLT.InsertOrUpdate

    • PLT.Delete

    This ensures that basic create, update and delete operations are always available to all models for administration purposes. You can also add your own actions that define their own field optionality/requiredness, their own workflows, and their own permissions.

    For the purposes of this example, we will add a new action called "Create".

  6. Under the Actions section, click Add. In the dialog that pops up, enter the following information:

    images/download/attachments/144836558/mpt_editor_actions_dlg-version-1-modificationdate-1670861100000-api-v2.png

    Then click OK.

  7. Because you added this action to the ZBKS (Bookstore) module, it will be automatically prefixed with ZBKS. Thus you should be able to see the new ZBKS.Create Action in the Actions list box. In the Action Details section, choose the OPTIONAL default mask. This means that by default, fields are not required to be given, but if given they will be persisted.
    images/download/attachments/144836558/mpt_editor_default_mask-version-1-modificationdate-1670861100000-api-v2.png

  8. Click the Permissions tab, and check the Can access this action check box for ZBKS.SampleRoleType.

  9. Click images/download/attachments/144836558/save_btn-version-1-modificationdate-1670861100000-api-v2.png Save to save the MPT.

  10. Click images/download/attachments/144836558/submit_btn-version-1-modificationdate-1670861100000-api-v2.png Submit to submit the MPT to the server. When you see a message that the submission was successful, the MPT is ready for use in NEO.