Preview only show first 10 pages with watermark. For full document please download

Starter Kit Decisyon App Composer (dac)

   EMBED


Share

Transcript

Starter Kit Decisyon App Composer (DAC) May 2, 2017 V 1.1 Copyright © 2017 Table of Contents 1 Introduction ........................................................................................................................................ 3 1.1 Requirements for DAC Running in Predix...................................................................................3 1.2 Simplified App Creation Workflow .............................................................................................3 2 DAC Keywords Definition....................................................................................................................4 3 DAC Login & Predix Space Connection ...............................................................................................6 3.1 Log in to DAC Using Your Predix Credentials .............................................................................. 6 3.2 Create a New Connection Login ................................................................................................. 6 3.3 Push DAC RunTime to Predix and Bind Services......................................................................... 8 3.4 Redirect URI to UAA Client .......................................................................................................11 4 Starter Kit 3: Create Your First App ..................................................................................................13 4.1 Create a New App .....................................................................................................................13 4.2 Application Starting Page .........................................................................................................14 4.3 Page Designer ...........................................................................................................................15 4.4 Creating a New Page.................................................................................................................16 4.5 Widgets in DAC .........................................................................................................................19 4.6 Adding a Widget to a Page .......................................................................................................20 4.7 Create a Custom Widget using Widget Designer .....................................................................21 5 Starter Kit 4: Insert a Time Series Widget & Publish the Page .........................................................24 5.1 Adding a Time Series Widget to a Page ....................................................................................24 5.2 Configure Properties of the Time Series Widget ......................................................................25 5.3 Publishing a Page in Local RT ....................................................................................................26 6 Starter Kit 5: Add User and Group Privileges....................................................................................28 6.1 7 Assign App Privileges and Groups.............................................................................................30 Starter Kit 6: Configure an Alert .......................................................................................................31 7.1 Anomaly Detection: Role of Alerts ...........................................................................................31 7.2 Creating a Condition Alert Associated With a Time Series.......................................................32 7.3 Testing a Condition Alert ..........................................................................................................35 7.4 Save Condition Alerts................................................................................................................37 8 Starter Kit 7: Deploying Your App to Predix.....................................................................................38 8.1 9 10 Deploying Your App in Predix ...................................................................................................38 Starter Kit 8: Running Your App in Predix.........................................................................................46 Decisyon Reference App...............................................................................................................48 Decisyon, Inc. - Proprietary |1 10.1 Required Predix Services ..........................................................................................................48 10.2 Configure the Asset Data Service .............................................................................................49 10.3 Time Series Data Ingestion .......................................................................................................51 10.4 PostgreSQL Data Insert.............................................................................................................54 10.5 Load and Use the Reference App .............................................................................................56 10.6 Demo App on DT and RT...........................................................................................................58 Decisyon, Inc. - Proprietary |2 1 Introduction This document describes how to use Decisyon App Composer (DAC) once you are part of the Predix community. You access DAC from Predix.io. ● ● ● What is DAC? DAC’s unique drag-and-drop visual app development environment leverages Predix and native microservices to accelerate the creation of insight-driven solutions that inject real-time intelligence into business operations. What can you do with DAC? DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while leveraging all Predix widgets and services as well as numerous built-in services such as data aggregation, BI, visualization, rules engine and alerting, collaboration, etc. How can you use DAC? DAC is provided in a DevBox, a uniform local development environment. The DevBox is a virtual machine that contains DAC and other useful tools to build and deploy your app on Predix. 1.1 Requirements for DAC Running in Predix This is the list of information and task you need to create the DAC instance. Please make sure you have the following information and services available: 1. 2. 3. 4. 5. 6. 7. 8. Predix Credentials: Username and Password. Predix Endpoint URL. At least one Predix «space». An instance of Decisyon App Composer service in that space (required). An instance of UAA service with the Client ID and Secret (required). An instance of Time series service (optional). An instance of the Asset service (optional). An instance of the PostgreSQL database (optional). 1.2 Simplified App Creation Workflow The following picture describes the eight fundamental steps needed to configure, create and run an app in Predix. This flow chart covers the basic functionality in DAC and the following color-code represents three different groups of activities:    Green: Set of one-time activities to download a DevBox to your local machine and connect it to your Predix space. Blue: Describes how you can rapidly build an IoT solution leveraging both Predix and DAC services and widgets. Yellow: Defines the RunTime environment both locally and on Predix. Preliminary Admin Activities Decisyon, Inc. - Proprietary DAC DesignTime Environment DAC RunTime Environment |3 DevBox Download DAC Login & Predix Space connection Set up your first APP 7 8 Navigate your data in Predix 4 3 2 1 1-click Deploy on Run Time Configure Time Series widget 6 Configure Alert 5 Add User/Group Profiling 2 DAC Keywords Definition Term: Definition: DevBox This local development environment includes everything you need to design and deploy an IIoT app in Predix. It includes DAC DesignTime, RunTime, web server and Postgres DB. The DevBox needs to be downloaded to your local box where you can login with your Predix credentials. DesignTime (DT) This is DAC’s visual app development environment where you can create, edit, test, and deploy your app. RunTime (RT) This is the environment in Predix where you publish the app created in DT, and the end users run it. App An App is the business solution/application that you create with DAC-DT. Metadata Schema This is an RDB schema storing all configurations used to build the application. User Management This refers to an administration setting that creates hierarchies of users and creates teams that can collaborate in the DAC-DT to create the apps, and in DAC-RT to collaborate around the analysis shown in the dashboards. Space This is a dedicated Predix development environment that you can bind DAC to via a secure UAA (User Account & Authentication) service. Decisyon, Inc. - Proprietary |4 Term: Definition: Predix Endpoint- This is a URL that points to the API used by Predix to connect its services to third parties. UAA (User Account & Authentication) This is the secure login authentication that is used to connect DAC with the Predix instantiated workspaces. Time Series This is a data stream generated in real time by a sensor. Report This is the result of a query or of the correlation of data. It is usually visualized in the form of a graph or a table. Page It is the combination of widgets visualized in the same DAC-RT environment. One app can consist of one or more pages depending of the complexity of the IoT project. Widget Widgets are part of the pages with specific functionalities that you can use to build your page. A page contains one or more widgets; when you have more widgets, they can interact with each other. Each widget has its own configuration properties available in DesignTime. BRM (Business Rule Management) This is the DAC rules engine that creates alerts while ingesting time-series data. This tool allows you to create the rule and set the thresholds. Alert/Alarm This is the output of a triggered business rule that can be visualized in real time in the DAC-RT page. Asset This refers to machine and/or sensor data that is pushed in DAC. To create an app, it is necessary to map and configure the assets that are necessary to build a solution. Collaboration This is a native DAC function that allows the users to collaborate in real time with in-context data and create chat, tasks, emails and messages. Tags This refers to the standard name that Predix uses for sensors. Decisyon, Inc. - Proprietary |5 3 DAC Login & Predix Space Connection Before starting the following step-by-step procedure, please make sure you are already a Predix.io registered user. 3.1 Log in to DAC Using Your Predix Credentials 1. You can start the virtual machine by clicking on the VM icon, or manually by opening a command/terminal, then moving to the DACDevbox folder and executing the command “vagrant up”. 2. After a few seconds, your VM starts and the following prompt displays: 3. Use “appcomposer” as your password. 4. Double click on the “Decisyon App Composer” icon on the desktop to open the DAC DesignTime window. 5. Configure your initial connection using your Predix credentials. 3.2 Create a New Connection Login To log in to DAC, you need to insert a number of parameters, such as username, password, endpoint, organization, space, etc. You can insert all the required information in the DAC login screen and then you can save the connection parameters, so that you do not have to insert them again in the following working sessions. The list of saved connections is available on the left of the login screen. Decisyon, Inc. - Proprietary |6 6. Click on the “Add New” button at bottom left corner of the Decisyon Connection dialog box. 7. Insert the “name” for the connection. 8. Enter the Predix URL endpoint. To select the appropriate URL, please refer to Predix.io https://www.predix.io/support/article/KB0011146) 9. Enter your Predix username and password and click on “Next.” 10. Select one of the organizations listed in the menu. The list is retrieved from Predix, based on your account authorization. 11. Select one of the spaces that belong to the selected organization. 12. Select “Local” in the “Metadata DB” section. You can select “Remote” only if you want to use the metadata stored in a different virtual machine for working on the same app with other developers simultaneously. Please refer to the DAC-DT Manual for further information. 13. Click on the “Save” button and then click on the “Connect” button. If you want to edit an existing connection, you can first select the connection and then click the “Edit” button. You can also log in using the “Quick Connection”: in this case, the parameters you enter are not saved and you are not allowed to use a remote metadata source. Decisyon, Inc. - Proprietary |7 3.3 Push DAC RunTime to Predix and Bind Services The first time you start DAC, you need to instantiate DAC-RT in Predix. This will push a DAC RunTime to your space in Predix and subsequently you will be able to consume the Predix services that are instantiated in that space. For example, this allows you to display the Time Series service data in a widget, consume the Asset Data service in the page, or map data stored in your PostgreSQL service. The following wizard helps you to push DAC RunTime to Predix in the organization and spaces you used for the initial login. 1. Open the “Push application wizard” from the menu item “Tools → Push RunTime to Predix”. 2. Assign a name to the Web Application that will be pushed in Predix and click “Next”. Decisyon, Inc. - Proprietary |8 3. Define the number of instances and the memory dedicated for the app and click “Next”. For a test environment, we recommend you set 1 instance and 1024 MB of memory. 4. Select the UAA service that will be used by DAC-RT in Predix. Insert the Client ID and Client secret. 5. Once the UAA is connected, you can bind DAC-RT with one Time Series service, Asset service and PostgreSQL service available in your space. Decisyon, Inc. - Proprietary |9 6. When the push operation is completed, you will get the URL that you can use to open DAC-RT in Predix. Important Note: The URL provided will be used in Predix for UAA settings and for accessing DAC RunTime. If you want to manually open the URL in the browser, use the URL provided in the previous step, in this example: https://DemoDACRT.run.aws-usw02-pr.ice.predix.io/adminLogin and then use your Predix login/pw to access your deployed application in Predix. Decisyon, Inc. - Proprietary | 10 If you want to open the pushed RunTime in Predix directly, click the “Open in Predix” button on the toolbar. If you need to change the binding and the associated services, you need to run the “Push RunTime to Predix” command again. 3.4 Redirect URI to UAA Client Now that you pushed DAC RunTime to Predix, you need to complete the UAA client configuration by adding scope, authorities and assign a redirect URI. You can specify a redirect URI to redirect client after login when the end user will authenticate using UAA credentials. To configure the redirect URI: 1. Open the Client Management in your UAA dashboard and click Edit. Decisyon, Inc. - Proprietary | 11 2. Copy the app URL that you got from the wizard in the previous section, in this example https://dacrt.run.aws-usw02-pr.ice.predix.io 3. Concatenate to the URL the following string “/index.jsp.cas?revent=login”. 4. Copy the modified URL in the “Redirect URI”. 5. Click the Save button. This link will redirect to DAC-RT when the end user authenticates in the app using UAA credentials. Now you can save and go back in your client management area and “Authorize Client” to all your service instances (Asset, Time Series and DAC service). Decisyon, Inc. - Proprietary | 12 4 Starter Kit 3: Create Your First App Before starting your first app, you must have successfully completed the DAC connection using your Predix credentials. 4.1 Create a New App Just after the login screen, the “Decisyon Applications” screen opens. From here, you can create a new application or load an existing one. 1. Click on “Add New”. 2. Insert the Application Name, Description and DB Schema. 3. Click on “Save” and then “Open” to open the application Starting page. Decisyon, Inc. - Proprietary | 13 4.2 Application Starting Page The first operational view after creating or loading your app is the “Starting Page”. The Starting Page consists of three logical areas: 1. The list of the Latest Objects created (report, page, metrics, rule, etc.), on the left side of the Starting Page. Objects are listed by chronological order. 2. Shortcuts to frequently used commands on the right side of the Starting Page, such as:       Page designer: to set up the page representation of the app. Rule designer: to set up the alert on time-series ingested data. User management: to create a new application user. Group management: to create teams of users. Application Deploy: the wizard that allows you to deploy the app in the DAC-RT in the Predix cloud. Shortcuts to open help materials. 3. Create your first page by clicking on the “Page Designer” shortcut or from the Application menu. Decisyon, Inc. - Proprietary | 14 4.3 Page Designer The Page Designer allows you to configure, edit and save the pages of your application. Your application can contain one or more pages. Each page is built using one or more widgets. A page is an interactive dashboard used to display static and real-time data from multiple sources in a single web interface. The pages are the core of the app. You can open the Page Designer directly from the shortcuts in the Starting Page. The Page Designer is organized in the following four panes: 1. A list of the existing pages grouped by those published and not published; 2. A page design canvas where you can drag-and-drop widgets like charts, tables, Time Series etc...; 3. A property section where you can configure widget or page properties; 4. A group/user tab to associate page privileges with groups or users. Decisyon, Inc. - Proprietary | 15 4.4 Creating a New Page To create a new Page, select the “Not-Published” folder and then press on the new button. A New Page layout wizard will prompt you to select a page name and an optional template for your page layout gallery (1 box, 2 columns, 3 box 1 column, etc.). If you select the “Empty” page template, you will work and customize the page using the standard row/column framework. Decisyon, Inc. - Proprietary | 16 Example: Create a new page using a predefined template layout Access the Page Designer: 1. Select the Not-published folder. 2. Click on the New button. 3. Insert the new Page name in the box. 4. Select a page layout “3 box 1 Row”. By selecting a predefined template, you will save time in adjusting the properties of the containers and the page is ready to be filled with your widgets. Decisyon, Inc. - Proprietary | 17 Visualize the New Page Structure The “3 box 1 Row” layout will have the structure represented in the picture. You can adjust or rework this layout by adding a new row or column containers. Decisyon, Inc. - Proprietary | 18 4.5 Widgets in DAC You can create functionalities in a page by adding one or more widgets: combining the same set of widgets in different ways gives you the flexibility to build any kind of page you need for your application. The main widget groups that can be used in a page are:  Predix: widgets built on top of the Predix UI component  Data visualization: display data stored in Decisyon reports in different formats (chart, table, etc.)  Form: to create an interactive page that accepts user inputs  Button: configurable buttons  Containers: widget used to better organize layout of the Page  Discussion: to start discussions between different groups of users  Resources: Images or JavaScript snippets in the Page  Social Widgets: to create social pages Decisyon, Inc. - Proprietary | 19 4.6 Adding a Widget to a Page Before applying any changes in the page, remember to click the “Edit” button in the Page Designer toolbar. 1. To add a widget to the canvas, click on the “Widgets” tab and select your widget from the catalog. 2. Drag and drop the selected widget onto the page canvas. You can also use the widget’s Cut & Paste commands from the right-click menu. 3. Configure the widget properties. Remember that each widget has its own specific set of properties. Decisyon, Inc. - Proprietary | 20 4.7 Create a Custom Widget using Widget Designer Widget Designer is an online development environment that provides a powerful toolset to build complex widgets with rich user interfaces. The development environment is based on AngularJS and can be extended with any third party services and front-end libraries. Using Widget Designer, you can: 1. Import your modules/code into Widget Designer and export to your SCM system. 2. Develop custom widgets with complex workflows that meet your requirements. 3. Add different types of user interfaces to make the widget more user-friendly using client technologies such as HTML, JavaScript and AngularJS. 4. Create Widgets that connects to one or more external data sources. 5. Use Shared libraries that can be reused on multiple widgets. Once widgets are published in the Widget Designer, your custom widgets will be available in the catalog and can be dragged and dropped for designing pages using Page Designer Custom widgets are composed of: 1. A template that describes the widget’s HTML markup. 2. Scripts that describe the widget logic. 3. Properties exposed by the widget. Decisyon, Inc. - Proprietary | 21 4. Some assets such as external JavaScript libraries, CSS definitions, and/or images. 5. AngularJS module declarations if the widget uses services or directives that are not built-in to the AngularJS framework. 6. Resource dependency settings (JS, CSS). Widget Designer can be accessed by clicking either in the DAC RunTime menu or on the “Start Widget Designer” button on the toolbar or clicking on the Widget Designer button in the DAC-DT toolbar. The button will open the DAC-RT login page in the browser. You can log in using your Predix username and password to access Widget Designer. The main components of the Widget Designer are:  Widget Catalog  Widget Editor Decisyon, Inc. - Proprietary | 22 Widget Catalog Folder catalog Widget list Menu to create new widgets and manage the folders in the catalog Widget Editor Full screen mode of the work area view Buttons to manage the window Name of the widget Link to access Decisyon model Menu to access the documentation or select a different view Resource catalog Property catalog Decisyon, Inc. - Proprietary Window that lets you display the file being edited or the preview | 23 5 Starter Kit 4: Insert a Time Series Widget & Publish the Page In order to use the Predix Time Series widget on a page, you must have bound DAC RunTime with one of the Time Series services available in the user’s space. 5.1 Adding a Time Series Widget to a Page The “Predix widgets” consume Predix’s services API and can be dragged and dropped to the page. In this example, we are going to add the “Time Series” widget to the page that leverages the Predix-UI component to display data retrieved from the Time Series service. Please follow the steps in the Starter Kit 3 and run the Page Designer: 1. Create a new page or edit the page you created in the previous steps. 2. Click on the “Widgets” tab. Decisyon, Inc. - Proprietary | 24 3. Select and drag in the page the “Time Series” widget from the Predix folder. 5.2 Configure Properties of the Time Series Widget 1. Select the widget in the page. 2. On the left panel, you can configure the following properties for the widget:  Start: select the start time to get measurements from the time series. In this example “1hago” (relative value). Decisyon, Inc. - Proprietary | 25  Tags: You can select one or more tag names from the Time Series service. It’s also possible to use a parameter to dynamically set the tag name that will be used to query the Time Series service. Please refer to the DAC DesignTime Manual for further information.  You can optionally configure a filter, or aggregation functions using the Predix API syntax. Please refer to Predix documentation for the syntax. 3. Save the page. 5.3 Publishing a Page in Local RT By default, each new page goes in the “not published” list in the “catalog tree”. To publish a page, you need to drag and drop the page from the “not published” to the “published” folder. See image below. Decisyon, Inc. - Proprietary | 26 Now you can preview the active app in your local DAC-RT environment. In order to preview in a local browser the page you are working on the page designer you can click on the “Page View”. See image below. To open the preview, DAC will start the local DAC-RT, if not yet started; DAC automatically manages the authentication of the user without the credentials having to be inserted. The system will show the preview page even if it is not published, and it is not associated with a Group (see next section). Decisyon, Inc. - Proprietary | 27 6 Starter Kit 5: Add User and Group Privileges Adding users and groups allows you to assign access privileges to individual users so they can view and work with each element of the app. It also enables you to create a collaboration team at RunTime. By default, the page privileges are set to the “Everyone” group. This means that all the users that are bound with DAC-RT and belong to the same Predix space, if any, will be granted access to the app. Follow the next steps in order to create new users in DAC-DT: 1. On the Starting page, select the User Management shortcut to open the wizard. 2. Click on “New” to create a new user. 3. Insert the user authentication data. 4. Select “Admin” if the new user needs privileges to modify apps in DT. Decisyon, Inc. - Proprietary | 28 Once the users are created, it is necessary to associate users with a specific group in order to create privileges in development projects. 1. On the Starting Page, select the group management shortcut to open the wizard. 2. Click on “New” to create a new group. 3. Select the users you want to add in the right column, and then save. Decisyon, Inc. - Proprietary | 29 6.1 Assign App Privileges and Groups 1. On the Starting page, select the Page Designer shortcut to open the wizard. 2. Select your page in the elements list and click on “Edit”. 3. Check the “Groups” tab. 4. Select to view groups or single users. 5. Check the users/groups you want to assign the right to view or edit the page. Once you select the user/group, you can publish in the DAC-RT. Decisyon, Inc. - Proprietary | 30 7 Starter Kit 6: Configure an Alert 7.1 Anomaly Detection: Role of Alerts The alerts and rules service in DAC is an advanced tool designed to monitor the data and information and issue real-time alerts when anomalies in data are detected and/or tolerance thresholds are reached or exceeded. You can create an alert with the “Rule Designer” (Application >> Rule Designer) service, invoked from the Starting page. Decisyon, Inc. - Proprietary | 31 7.2 Creating a Condition Alert Associated With a Time Series This example demonstrates the steps to create a simple alert using query-type action for placement in the alert designer. 1. Select the “Time Series” in the alert-type property. Time series properties are defined this way:     Start: sets the start time to retrieve data from the time series. It can be either absolute or relative. Queries: inputs the number of queries used to display data. Tags: select tags that you want the rules to apply to. Order: set the list to an Ascending or Descending order. Decisyon, Inc. - Proprietary | 32 2. Define a condition:    Select the “Simple Condition” button, which inserts a simple condition row in the list below. To define the condition, you need to click the button that opens the simple condition editor. Define a condition for TAG SENSOR_02 >100 and click Ok. Decisyon, Inc. - Proprietary | 33 3. Define a simple action: Define a SQL statement executed once the rule condition is triggered. For instance, in the above example, the information about the triggered alert is stored in a table. Decisyon, Inc. - Proprietary | 34 7.3 Testing a Condition Alert 1. Use the Play button to start the Rules Execution Test wizard. 1 a. First, you select the data source where you want to execute and validate the alert. There are two options available: i. Time series service: The system queries the time-series data in real time and executes the rule. ii. Simple data: The system validates the rule using time-series data available in an Excel file. a Decisyon, Inc. - Proprietary | 35 b. After selecting the simple data option, you can use the Excel file available in the DevBox desktop: i. File: select the file in a folder. ii. Sheet: select the sheet in the Excel file. b 2. Verify the test: a. See the test execution progress. b. At the end of the test, you will see the most relevant alert measurements displayed. i. ii. iii. iv. Name: name of the tested rule. Sensor Data: list of the tags and the associated threshold. Timestamp: date and time of the event. Attributes: other information available in Excel that is associated with the time series. Decisyon, Inc. - Proprietary | 36 7.4 Save Condition Alerts To save the Condition alerts, go back to the rule management wizard and click on Save. Decisyon, Inc. - Proprietary | 37 8 Starter Kit 7: Deploying Your App to Predix 8.1 Deploying Your App in Predix The last step to use your app in Predix is to deploy the app. You can run the Application Deployment wizard from the main DAC menu or click on the Deployment shortcut on the Starting page. Decisyon, Inc. - Proprietary | 38 At this point, you are ready to deploy the app you are currently working on in the Predix DAC-RT environment. You are offered two options for deployment: Deploy all application objects, or Deploy only selected objects. At the first access, the system will inform you, that the selected application is not contained in the destination application. See pop up below.   Select “Yes” for the system to continue deploying a new application. Select “No” to select an existing application stored in the local DAC DesignTime that will be deployed on the DAC RunTime. Decisyon, Inc. - Proprietary | 39 If “Yes” was selected, the wizard will automatically start the deployment process of the app you are currently working on. The wizard will show two options: 1. Deploy all application objects: This option determines all the application objects that have been modified after the last deployment to Predix. 2. Deploy only selected objects: This option determines that all the objects to be deployed on Predix can be manually selected. Decisyon, Inc. - Proprietary | 40 Deploy All Application Objects 1. Select the option “Deploy all application objects” (default option). You will get the list of all modified objects and the operation that will be performed. Click “Next” to continue. Note: For a complete reference about the type of operation, please refer to the DAC-DT Manual. Decisyon, Inc. - Proprietary | 41 2. The deployment is currently running and you can monitor the result of the deployment for each single object. Decisyon, Inc. - Proprietary | 42 Deploy Only Selected Objects The second option for deployment is to manually deploy each single object created in the application. In this case, you will be prompted to select each object that you want to deploy. Decisyon, Inc. - Proprietary | 43 Selecting the “No” option as part of the first step of the Wizard (see figure below), lists the application deployed in the destination. This is where you select the source model for copying or deploying the objects it contains. If you select “Deploy on a different model target application” flag, you enable a drop-down menu that lists the applications contained in the target application, which you can select where to run the deploy. Click on the Next button to return to the wizard step where you can select to deploy all the application objects or a selected list of objects. Important Note: When the Application Deployment starts, the system determines if there are any applications that have been removed locally, but that are still available in Predix. If this is the case, the wizard presents a third option in step 1:  Remove Deleted Application: This option deletes all the applications that have been removed locally from PREDIX as well. Decisyon, Inc. - Proprietary | 44 After selecting the third option, the wizard will show the list of removed applications that can be deleted on Predix. Select the application and confirm by clicking on the ok button. . Decisyon, Inc. - Proprietary | 45 9 Starter Kit 8: Running Your App in Predix In order to run your deployed app in Predix, use the “Open DAC-RT on Predix” icon from the toolbar: A browser page with the login window appears. After logging in using your Predix credentials, you will see your pages. Some of the key DAC functionalities at your disposal while running in Predix are: 1. Advanced BI capabilities (drill down, page by, filtering, etc.). 2. In-context collaboration features (discussion, tasks, etc.). 3. Notification setting. 4. Social toolbar to share analysis. 5. Task generation on specific decision point(s). For detailed descriptions of each type of functionality, please refer to the DAC RunTime and DesignTime Manuals. Decisyon, Inc. - Proprietary | 46 Decisyon, Inc. - Proprietary | 47 10 Decisyon Reference App DAC DevBox also includes a reference application (DAC Demo), a pre-built application that may help you to better understand how an application it is built page by page. Make sure you have successfully completed Starter Kits 1 and 2. If you want to create your app from scratch, go to Starter Kit 3. The app is self-contained and includes the following items: 1. An application called “DAC Demo”; 2. A couple of pages that use the Predix widget and the DAC built-in widget; 3. Simple and complex rule examples; 4. OLAP cube, dimensions and reports already mapped and ready to use. 10.1 Required Predix Services The reference app is built using a specific asset data model and tag names ingested in the time-series service. In order to configure and use the reference app the following Predix services must be used in the space where DAC is instantiated: ● ● ● Asset Data Time Series PostgreSQL Decisyon, Inc. - Proprietary | 48 10.2 Configure the Asset Data Service The reference app works with a specific Asset Data collection that you need to upload to the service. The goal is to simulate the asset hierarchy structure of a hypothetical wind farm where each turbine (the asset) is divided into different components and each component contains a set of sensors. You need to push both the turbine and the components asset data to the Asset service. A sample of the turbine asset collection data is similar to this: [ { "uri": "/turbines/ASSET_1", "description": "Turbine 1", "referenced_object": { "component": "/components?filter=parent=/turbines/ASSET_1" } } ] To push the data model collection: 1. Download the turbine data JSON collection from: https://s3-us-west-1.amazonaws.com/dac-repos/DAC-turbines-asset-collection.json 2. Download the components data JSON collection from: https://s3-us-west-1.amazonaws.com/dac-repos/DAC-components-asset-collection.json 3. Use the Asset service API Endpoints to run the JSON. You can also use the Predix Tool Kit available at this link: https://predix-starter.run.aws-usw02-pr.ice.predix.io/#!/asset Decisyon, Inc. - Proprietary | 49 4. Click on Login as Client. ● Insert your UAA URL (you can get it from the VCAP_SERVICES of your UAA service). ● Insert your Client ID. ● Insert your Client Secret. ● Click on Submit to get the access token. 5. Now click on Asset service. Decisyon, Inc. - Proprietary | 50 Select Choose request: create your custom Asset. In the POST field insert the name of the collection “turbines” For instance: https://predix-asset.run.aws-usw02-pr.ice.predix.io/turbines ● Insert your predix-zone-id (you can get it from the VCAP_SERVICES of your “Asset Data” service). ● Copy the JSON of the file “DAC-turbines-asset-collection.json” and paste it in the Request Body. ● Click on Submit. 6. Repeat the task 6 to create the “components” collection, copying and pasting data from the file “DAC-components-asset-collection.json”. 7. Verify that you have correctly loaded the collections. ● Select “Choose Request: Query Your Custom Asset”. ● In the GET field insert the name of the collections: https://predix-asset.run.aws-usw02pr.ice.predix.io/turbines or https://predix-asset.run.aws-usw02pr.ice.predix.io/components ● Click on Submit. ● ● 10.3 Time Series Data Ingestion The data that you are going to ingest in the Time Series service are compliant with the Asset Model collections loaded in the previous step. The tag name you ingest in the Time Series is the same used in the field “sensor” of the components collection. The following is a sample JSON data that you have to ingest. { Decisyon, Inc. - Proprietary | 51 "messageId": "1453338376222", "body": [ { "name": "SENSOR_02", "datapoints": [ [ 1458038363563, 50.741212768249234, 3 ], [ 1458038378563, 31.028859749418142, 3 ], [ 1458038393563, 30.125612391504788, 3 ], [ 1458038408574, 36.007799668695526, 3 ] ], "attributes": { "asset_id":"ASSET_1", "component_id": "COMPONENT_01", "sensor_id":"SENSOR_02" “tag_ds":"Power_Output" } } ] } To ingest data in the service: 1. Download the turbine data JSON collection from: https://s3-us-west-1.amazonaws.com/dacrepos/DAC-datapoints-time-series.json Decisyon, Inc. - Proprietary | 52 2. Open the Predix Tool Kit available at https://predix-starter.run.aws-usw02pr.ice.predix.io/#!/apiHome 3. Click on Login as Client. 4. Insert your ● UAA URL (you can get it from the VCAP_SERVICES of your UAA service). ● Client ID. ● Client Secret. ● Click on Submit to get the access token. 5. Click on Time Series Ingest. ● Click on Choose Request: Ingestion Request. ● Insert your predix-zone-id (you can get it from the VCAP_SERVICES of your “Time Series” service). Decisyon, Inc. - Proprietary | 53 ● Copy the JSON of the file “DAC-datapoints-time-series” and paste it in the Request Body. ● Click on Open socket. ● Click on Send message. ● Click on Close socket. 6. Verify if your data are correctly ingested. ● Click on Time Series Query. ● Select Choose Request: Latest Datapoints Request. ● Insert your predix-zone-id. ● Insert in the Request Body one of the sensors, in example SENSOR_02: {"tags":[{"name":"SENSOR_02"}]} ● Click Submit. 10.4 PostgreSQL Data Insert DAC DevBox has a local PostgreSQL database containing the alerts triggered from rules and other information used in the training/demo application available in the DevBox. If you would like deploy the training or the demo application in Predix Cloud you have to execute some SQL statements to create the schema fusion_data and its tables in your PostgreSQL service in Predix. In the following steps we will use PG Studio as reference to perform this task, but you are free to use any other solution you like to insert data in your PostgreSQL service. To insert data into the PostgreSQL service: Decisyon, Inc. - Proprietary | 54 1. Download the SQL script to execute from https://s3-us-west-1.amazonaws.com/dacrepos/DAC-ReferenceAppDataModel.zip 2. Deploy pgStudio in your space to be able to execute the script. Please refer to this KB article for details: https://www.predix.io/support/article/KB0010829 3. Open your pgStudio and insert the credentials of your PostgreSQL service (you can get them from the VCAP_SERVICES) 4. Open a SQL Worksheet. Decisyon, Inc. - Proprietary | 55 5. Click on Open and select the SQL Script that you download during step 1. 6. Click on Run to execute the script. 7. You can now select the schema fusion_data to verify is tables and are were correctly loaded. 10.5 Load and Use the Reference App 1. Select the File menu and then load the available reference app. 2. Once the app has been uploaded, you will enter the Starting Page where you will find:  All objects associated with the app.  Shortcuts for accessing the key DAC functionalities.  Links to the tutorial material, and RT and DT manuals. 3. Before navigating the components of the app in the DT, it is recommended that you open the app in your local RT. You can do that by clicking on the application menu of your DevBox, then select the browser and run the demo app. Decisyon, Inc. - Proprietary | 56 Decisyon, Inc. - Proprietary | 57 10.6 Demo App on DT and RT The demo app will be accessible by both DAC-DT and RT. That means that you can create and edit pages in DT, then deploy to Predix and run your app; then perform analysis and collaboration in Predix using the RT. Create the APP in DAC-DT, deploy it to Predix and run in DAC-RT. 1. To view a single component of the app, enter the Starting page of the demo app. 2. In the RT, all the components such as existing pages, the metrics and Time Series widget are listed. 3. Click on the Alert Monitoring page and the Page Designer will be displayed with all the properties set for the demo app. Decisyon, Inc. - Proprietary | 58