Primavera ERP Tutorial - OMNIALowCode/omnia2 GitHub Wiki
Introduction
This tutorial is designed to build an application to perform order management for a company. The requirements are that employees can register purchase orders, as well as their receptions and that the purchase orders are integrated into an external system (Primavera ERP).
Prerequisites
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.
This tutorial also requires an understanding of the concepts driving the platform, which are described in this page.
You will also need an installation of the OMNIA Connector. The installation and configuration process is described in this tutorial.
It assumes you have access to a template which includes the configurations for the Primavera ERP. If you do not have access to one, but you have an installation of the ERP, please contact us.
Steps
Begin by following the Modeling tutorial. After the Purchase Management application from that tutorial is complete, here we will add integration into an external system to its orders:
- Access the application. Create a connector, in Administration > Connectors, and configure your OMNIA Connector to use its endpoint and license file.
For help with configuring the connector, see this tutorial.
- Access Configurations > Primavera > Create and configure a Primavera external entity to access your ERP using this connector.
-
Ensure that, in the myCompany entity, you have an attribute of type Other Entity > External System > Primavera. This attribute will be used for communication with the Primavera ERP.
-
Create at least one Item and Supplier whose codes in the platform match to codes that exist in the Primavera ERP system.
-
Access the modeler, and create an external entity with the code GetERPItem. It should have the following parameters:
-
Query:
SELECT Artigo, Descricao FROM Artigo
-
Query Key Parameter:
Artigo
-
Script:
Upload the RemoteQuery.cs file.
-
External System Type:
Primavera
-
Executes on:
On-premises System
If the connection to the database fails (for example, you did not connect the connector yet), you will see a Warning (yellow) notification (at the navigation bar), informing you that the default view for this external entity was not created.
Even after correcting the problem that caused the connection failure, creation of the list is necessary, otherwise the application will not reflect all the data in the SELECT. To create this view, access the Configure Lists option on the external entity, and add the Artigo and Descricao fields to the list you create.
-
Test the connector by accessing the external entity you just created and verifying if the list of articles shows up.
-
Access the modeler again. Now we are going to write to the ERP instead of just reading. Access the interaction list, via Menu -> Process and Interactions.
-
Edit the PurchaseRequest interaction.
-
Create an attribute with Code and Name Primavera, of type Other Entity > External System > Primavera. Make it not Visible.
-
Edit the CompanyCode attribute. Add a triggered action to it with the code "GetPrimavera", that executes on change and obtains the Primavera attribute from the company, assigning it to the attribute in the interaction that you just created.
-
Access Configure Scripts in the context menu, and use the Add New button to add a new script.
-
Create an Extensibility Script named Integrate Order with the following configuration:
-
External Systems:
Primavera type, using the Primavera attribute, set to "Use Instance Code"
-
Action:
State transition -> After -> ManagerApprove to Completed
-
Files:
Upload the PurchaseOrder.cs file, set to On-premise execution.
- Access the application, and create and approve a new PurchaseOrder document, using an Item resource that has the same code as an ERP article, and a Supplier that has the same code as an ERP supplier. Verify in the ERP that the document is integrated successfully.
Next Steps
You can continue the tutorials by performing the SQL tutorial.