Skip to content

HTML and XML Tutorial

José Maia edited this page Apr 4, 2017 · 19 revisions

Introduction

This tutorial is designed to build a simple integration flow that exports an agent (Customer) from the OMNIA Platform to XML and HTML file, created in an on-premise machine.

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.

If you are performing this tutorial on top of a tenant that was already used to execute a previous tutorial, when there is an instruction to create an Entity and then perform further operations on that entity, if you already created one with the given name, you can reuse the one that already exists.

Download the C# Scripts files that can be found in this tutorial's folder:

  1. Customer HTML that will be used to create the HTML file in the on-premise system.

We would like to invite you to open the C# Scripts and see that this is simple C#, that you can adjust to meet your needs. If you want to know more about OMNIA Scripting Extensibility and how you can use Visual Studio to script development, please take a look at the Scripting chapter from the Modeling Manual.

This tutorial is undergoing updates for version 2.0 of the OMNIA Platform. The screenshots may not match what you see on the screen.

Exporting an entity to HTML

  1. 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.

  2. Through the top navigation menu, access Entities > Agents. Create an Agent Type (Add new button), and set its Code and Name to "Customer".

  1. Using the option Add Attribute in the Attributes section, add the following attributes to it:

    3.1. ContractStart, of type Date

    3.2. ContractEnd, of type Date

    3.3. Address, of type Text

    3.4. FinancialID, of type Text

  2. Save the Customer entity.

  3. Access External > Systems in the menu, and create an external system called ExternalSystem, which will represent the server where we want to export our customers' files. Before saving the external system:

    5.1. Add a Default Value (for example, 1) to the SystemVersion attribute.

    5.2 Make the SystemVersion attribute not Visible, in the Interface Tab, because it's not necessary for this example.

    5.3. Edit the Username attribute and make it not Visible, in the Interface Tab.

    5.4. Edit the Password attribute and make it not Visible, in the Interface Tab.

    5.5. Add a new attribute, FilePath, of type Text.

    5.6. Save the External System.

  4. Access the application, via the left-side context menu.

  5. 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.

  1. Create a myCompany, in Configurations > myCompany > Create.

  2. Access Configurations > ExternalSystem > Create and create an instance of the external system that uses this connector.

Define the external machine's path where you want your documents to be saved to in the FilePath attribute.

  1. Access the modeler again, via the left-side context menu.

  2. Access Entities -> Agents in the menu. Select the Customer agent, and access the Configure Scripts button in its context menu.

  3. Press Add new, and create an Extensibility Script named Create Customer File with the following configuration:

    • External System: ExternalSystem

    • Entity Kind: Agent

    • Entity Type: Customer

    • Execution Moment: Create -> After

    • Files: Upload the CustomerHTML.cs file, set to On-premise execution.

  4. Access the application again, via the left-side context menu.

  5. Create a new Customer.

  6. Verify that the HTML file is exported to the folder you defined in step 9.

Next Steps

To continue the tutorials, execute the Extensibility tutorial next.

Clone this wiki locally