Modeling Tutorial - OMNIALowCode/omnia2 GitHub Wiki
This tutorial is designed to build an application to perform order management for a company. The requirements are that employees can register purchase orders, and have them follow an approval flow.
This tutorial assumes that you have created a tenant based on the OMNIA Modeling Template, and are using a user with modeling privileges (preferably not the subscription's master account) to access this tenant. See this page to assist in tenant creation.
Furthermore, the platform's new installations come with a demonstration template that contains a completed version of this tutorial. Follow the tenant creation documentation to create a new tenant based off the template ModelingTutorial_Completed in order to see this.
This tutorial also requires an understanding of the concepts driving the platform, which are described in this page.
-
Start by accessing the Modeler.
1.1. Open the left-side context menu (click in arrow next to the name of the tenant you are currently on).
1.2. Choose the option Modeler.
-
Through the top navigation menu, access Entities > Agents. Create an Agent Type (Add new button in the context options in the bottom of the screen), and set its Code and Name to "Supplier".
-
Through the top navigation menu, access Entities > Resources. Create a Resource Type (Add new button in the context options in the bottom of the screen), and set its Code and Name to "Item".
-
Through the top navigation menu, access Processes and Interactions, and create a process (Add new button in the context options in the bottom of the screen) with the code "PurchasesManagement" and the name "Purchases Management".
-
When the process is created, using the option Add Interaction, create an interaction under it, with the code PurchaseRequest and name Purchase Request.
- Under the Details section, use the option Add new to create a Commitment, with code GoodsPurchaseRequest and name Goods Purchase Request.
It should be of Increment kind, representing a transaction of the resource Item between the provider Supplier and the receiver myCompany.
-
Save the interaction.
-
Leave the modeler and enter the Application.
8.1. Open the left-side context menu (click in arrow next to the name of the tenant you are currently on).
8.2. Choose the option Application. We will now proceed to add some data.
-
Create a myCompany, in Configurations > myCompany > Create.
-
Follow the same process to also create an Item (Configurations > Item) and a Supplier (Configurations > Supplier).
-
After creating the company, the Purchase Management section will show up in the menu. Access the Purchase Management > Purchase Request > Create option. Verify that the entities you just created are possible to select in the relevant fields (click to expand).
-
Next, we will improve the application's usability. Go back to the modeler, and edit the PurchaseRequest interaction, through Processes and Interactions in the menu.
-
Add a new attribute (option Add New in the Attributes section) to this interaction, with the Code and Name Supplier. This attribute should be of type Other Entity, with the entity kind being Agent and type being Supplier.
- In the side navigation, select GoodsPurchaseRequest. In the Attributes section find the attribute ProviderAgent and edit it:
- In the Behaviour tab, define a formula in its Formula field to assign the value of the previously created Supplier attribute. It's possible to do that in two different ways:
- Just type in =[Document.Supplier]
- Use the field selector, by clicking in the Add Attribute button and navigate to the field (PurchaseRequest > Supplier)
-
Set the ReceiverAgent field also to be not visible.
-
Save the changes to the interaction.
-
Go back to the application and verify that it looks much more readable (click to expand).
-
Go back to the modeler, and start by creating a new Agent, Employee, through Entities > Agents.
-
Prepare it for approvals, by marking the Allow Users checkbox at the Other configurations tab.
This will allow a user's account on the platform to be automatically mapped to an instance of this entity.
-
Save the Employee entity.
-
Also in Entities > Agents, edit the myCompany agent.
-
Add a new attribute to it, of type Other Entity and representing an Employee agent. Set the attribute's Code and Name to Manager.
-
Save the changes to myCompany.
-
Go back to the application, and create an Employee, in Configurations > Employee > Create.
-
Edit the company you are using (Configurations > myCompany > List), and make its Manager the Employee you just created.
- Access Administration > Security Configurations > Users > List, and edit your current user to be associated with the Employee (If you are using the platform's administrator account, you will need to create a new user for this step).
- Go back to the modeler and through the top navigation menu access Processes and Interactions. Using the context menu to PurchaseRequest interaction, select the Configure Approval Stages option.
We are going to add a flow of approvals consisting of three distinct approval stages.
-
Use the Add New button to add an Approval Stage, and set its Code and Name to "Pending".
-
Add an Approval Stage with Code and Name "ManagerApprove".
-
Add an Approval Stage with Code and Name "Completed".
-
Configure the "Pending" approval stage:
-
Ensure it is the Start Stage;
-
Set its Next Stage to "ManagerApprove".
- Configure the "ManagerApprove" approval stage:
-
Define an approval rule here, with the Assign To to Company.Manager.User;
With the field selector, use the following path: PurchaseRequest > CompanyCode > Manager > User -
In To Approve, mark Goods Purchase Request as the commitment to approve;
-
Set its Next Stage When Approved to Completed.
- Configure the "Completed" approval stage:
- Set it as an End Stage.
-
Save the approval flow configuration.
-
Go back to the application, and create a new Purchase Request (Purchase Management > Purchase Request > Create). Here, the button Submit for Approval will appear. Submit an interaction for approval.
If SendGrid was not correctly configured, the operation will result in a warning (yellow) notification. That means the email to notificate the approver can't be sended.
-
Login (in a new browser, preferrably), with the account you created for approvals in steps 7 through 9.
-
Access the Manager Approve option under the Purchase Request (Purchase Management > Purchase Request > ManagerApprove) and select the request you just submitted.
Mark all lines as Approved and save.
You can continue this tutorial into the advanced modeling elements, through the Advanced Modeling tutorial, or follow to the next one, the SQL tutorial.
See the Primavera tutorial if you want to add integration into a Primavera ERP external system to this tutorial.