starter kit decisyon app composer (dac)...dac is a visual app development environment that allows...

59
Starter Kit Decisyon App Composer (DAC) May 2, 2017 V 1.1 Copyright © 2017

Upload: others

Post on 22-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Starter KitDecisyon App Composer (DAC)

May 2, 2017V 1.1

Copyright © 2017

Page 2: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 1

Table of Contents1 Introduction........................................................................................................................................3

1.1 Requirements for DAC Running in Predix...................................................................................3

1.2 Simplified App Creation Workflow .............................................................................................32 DAC Keywords Definition....................................................................................................................4

3 DAC Login & Predix Space Connection ...............................................................................................63.1 Log in to DAC Using Your Predix Credentials ..............................................................................6

3.2 Create a New Connection Login .................................................................................................63.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 ..................................................................................................134.1 Create a New App.....................................................................................................................13

4.2 Application Starting Page .........................................................................................................144.3 Page Designer ...........................................................................................................................15

4.4 Creating a New Page.................................................................................................................164.5 Widgets in DAC .........................................................................................................................19

4.6 Adding a Widget to a Page .......................................................................................................20

4.7 Create a Custom Widget using Widget Designer .....................................................................215 Starter Kit 4: Insert a Time Series Widget & Publish the Page .........................................................24

5.1 Adding a Time Series Widget to a Page ....................................................................................245.2 Configure Properties of the Time Series Widget ......................................................................25

5.3 Publishing a Page in Local RT ....................................................................................................266 Starter Kit 5: Add User and Group Privileges....................................................................................28

6.1 Assign App Privileges and Groups.............................................................................................307 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.......................................................327.3 Testing a Condition Alert ..........................................................................................................35

7.4 Save Condition Alerts................................................................................................................378 Starter Kit 7: Deploying Your App to Predix.....................................................................................38

8.1 Deploying Your App in Predix ...................................................................................................389 Starter Kit 8: Running Your App in Predix.........................................................................................46

10 Decisyon Reference App...............................................................................................................48

Page 3: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 2

10.1 Required Predix Services ..........................................................................................................48

10.2 Configure the Asset Data Service .............................................................................................4910.3 Time Series Data Ingestion .......................................................................................................51

10.4 PostgreSQL Data Insert .............................................................................................................5410.5 Load and Use the Reference App .............................................................................................56

10.6 Demo App on DT and RT...........................................................................................................58

Page 4: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 3

1 IntroductionThis document describes how to use Decisyon App Composer (DAC) once you are part of the Predixcommunity. You access DAC from Predix.io.

● What is DAC? DAC’s unique drag-and-drop visual app development environment leverages Predixand native microservices to accelerate the creation of insight-driven solutions that inject real-timeintelligence into business operations.

● What can you do with DAC? DAC is a visual app development environment that allows users tocreate, edit, deploy and run IIoT data-driven applications in Predix while leveraging all Predixwidgets 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 yourapp on Predix.

1.1 Requirements for DAC Running in PredixThis is the list of information and task you need to create the DAC instance. Please make sure youhave the following information and services available:

1. Predix Credentials: Username and Password.2. Predix Endpoint URL.3. At least one Predix «space».4. An instance of Decisyon App Composer service in that space (required).5. An instance of UAA service with the Client ID and Secret (required).6. An instance of Time series service (optional).7. An instance of the Asset service (optional).8. An instance of the PostgreSQL database (optional).

1.2 Simplified App Creation WorkflowThe following picture describes the eight fundamental steps needed to configure, create and run anapp in Predix. This flow chart covers the basic functionality in DAC and the following color-coderepresents three different groups of activities:

Green: Set of one-time activities to download a DevBox to your local machine and connect it toyour Predix space.

Blue: Describes how you can rapidly build an IoT solution leveraging both Predix and DAC servicesand widgets.

Yellow: Defines the RunTime environment both locally and on Predix.

Preliminary AdminActivities

DAC DesignTimeEnvironment

DAC RunTimeEnvironment

Page 5: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 4

2 DAC Keywords DefinitionTerm: Definition:DevBox This local development environment includes

everything you need to design and deploy an IIoTapp in Predix. It includes DAC DesignTime,RunTime, web server and Postgres DB. The DevBoxneeds to be downloaded to your local box whereyou can login with your Predix credentials.

DesignTime (DT) This is DAC’s visual app development environmentwhere you can create, edit, test, and deploy yourapp.

RunTime (RT) This is the environment in Predix where you publishthe app created in DT, and the end users run it.

App An App is the business solution/application that youcreate with DAC-DT.

Metadata Schema This is an RDB schema storing all configurationsused to build the application.

User Management This refers to an administration setting that createshierarchies of users and creates teams that cancollaborate in the DAC-DT to create the apps, and inDAC-RT to collaborate around the analysis shown inthe dashboards.

Space This is a dedicated Predix developmentenvironment that you can bind DAC to via a secureUAA (User Account & Authentication) service.

DevBoxDownload

DAC Login &Predix Spaceconnection

Set up yourfirst APP

Configure TimeSeries widget

Add User/GroupProfiling

Configure Alert1-click Deployon Run Time

Navigate yourdata in Predix

1 2 3

68 7

4

5

Page 6: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 5

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 usedto connect DAC with the Predix instantiatedworkspaces.

Time Series This is a data stream generated in real time by asensor.

Report This is the result of a query or of the correlation ofdata. It is usually visualized in the form of a graphor a table.

Page It is the combination of widgets visualized in thesame DAC-RT environment. One app can consist ofone or more pages depending of the complexity ofthe IoT project.

Widget Widgets are part of the pages with specificfunctionalities that you can use to build your page.A page contains one or more widgets; when youhave more widgets, they can interact with eachother. Each widget has its own configurationproperties available in DesignTime.

BRM (Business Rule Management) This is the DAC rules engine that creates alertswhile ingesting time-series data. This tool allowsyou to create the rule and set the thresholds.

Alert/Alarm This is the output of a triggered business rule thatcan be visualized in real time in the DAC-RT page.

Asset This refers to machine and/or sensor data that ispushed in DAC. To create an app, it is necessary tomap and configure the assets that are necessary tobuild a solution.

Collaboration This is a native DAC function that allows the usersto collaborate in real time with in-context data andcreate chat, tasks, emails and messages.

Tags This refers to the standard name that Predix usesfor sensors.

Page 7: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 6

3 DAC Login & Predix Space ConnectionBefore starting the following step-by-step procedure, please make sure you are already a Predix.ioregistered user.

3.1 Log in to DAC Using Your Predix Credentials1. 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 DACDesignTime window.

5. Configure your initial connection using your Predix credentials.

3.2 Create a New Connection LoginTo 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 thenyou can save the connection parameters, so that you do not have to insert them again in the followingworking sessions. The list of saved connections is available on the left of the login screen.

Page 8: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 7

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.iohttps://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 onyour 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 usethe metadata stored in a different virtual machine for working on the same app with otherdevelopers 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 savedand you are not allowed to use a remote metadata source.

Page 9: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 8

3.3 Push DAC RunTime to Predix and Bind ServicesThe first time you start DAC, you need to instantiate DAC-RT in Predix. This will push a DAC RunTime toyour space in Predix and subsequently you will be able to consume the Predix services that areinstantiated in that space. For example, this allows you to display the Time Series service data in awidget, 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 usedfor 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”.

Page 10: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 9

3. Define the number of instances and the memory dedicated for the app and click “Next”. For atest 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 Clientsecret.

5. Once the UAA is connected, you can bind DAC-RT with one Time Series service, Asset serviceand PostgreSQL service available in your space.

Page 11: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 10

6. When the push operation is completed, you will get the URL that you can use to open DAC-RTin Predix.

Important Note: The URL provided will be used in Predix for UAA settings and for accessing DACRunTime. If you want to manually open the URL in the browser, use the URL provided in the previousstep, in this example: https://DemoDACRT.run.aws-usw02-pr.ice.predix.io/adminLogin and then useyour Predix login/pw to access your deployed application in Predix.

Page 12: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 11

If you want to open the pushed RunTime in Predix directly, click the “Open in Predix” button on thetoolbar.

If you need to change the binding and the associated services, you need to run the “Push RunTime toPredix” command again.

3.4 Redirect URI to UAA ClientNow that you pushed DAC RunTime to Predix, you need to complete the UAA client configuration byadding scope, authorities and assign a redirect URI.

You can specify a redirect URI to redirect client after login when the end user will authenticate usingUAA credentials.

To configure the redirect URI:

1. Open the Client Management in your UAA dashboard and click Edit.

Page 13: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 12

2. Copy the app URL that you got from the wizard in the previous section, in this examplehttps://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 yourservice instances (Asset, Time Series and DAC service).

Page 14: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 13

4 Starter Kit 3: Create Your First AppBefore starting your first app, you must have successfully completed the DAC connection using yourPredix credentials.

4.1 Create a New AppJust after the login screen, the “Decisyon Applications” screen opens. From here, you can create a newapplication 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.

Page 15: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 14

4.2 Application Starting PageThe first operational view after creating or loading your app is the “Starting Page”. The Starting Pageconsists of three logical areas:

1. The list of the Latest Objects created (report, page, metrics, rule, etc.), on the left side of theStarting 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 Applicationmenu.

Page 16: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 15

4.3 Page DesignerThe Page Designer allows you to configure, edit and save the pages of your application. Yourapplication can contain one or more pages. Each page is built using one or more widgets. A page is aninteractive dashboard used to display static and real-time data from multiple sources in a single webinterface. 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 isorganized 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 Seriesetc...;

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.

Page 17: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 16

4.4 Creating a New PageTo create a new Page, select the “Not-Published” folder and then press on the new button. A NewPage layout wizard will prompt you to select a page name and an optional template for your pagelayout 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 standardrow/column framework.

Page 18: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 17

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 andthe page is ready to be filled with your widgets.

Page 19: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 18

Visualize the New Page Structure

The “3 box 1 Row” layout will have the structure represented in the picture. You can adjust or reworkthis layout by adding a new row or column containers.

Page 20: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 19

4.5 Widgets in DACYou can create functionalities in a page by adding one or more widgets: combining the same set ofwidgets in different ways gives you the flexibility to build any kind of page you need for yourapplication. 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

Page 21: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 20

4.6 Adding a Widget to a PageBefore applying any changes in the page, remember to click the “Edit” button in the Page Designertoolbar.

1. To add a widget to the canvas, click on the “Widgets” tab and select your widget from thecatalog.

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

Page 22: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 21

4.7 Create a Custom Widget using Widget DesignerWidget Designer is an online development environment that provides a powerful toolset to buildcomplex widgets with rich user interfaces. The development environment is based on AngularJS andcan 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 thecatalog 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.

Page 23: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 22

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 WidgetDesigner” 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 usernameand password to access Widget Designer.

The main components of the Widget Designer are:

Widget Catalog Widget Editor

Page 24: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 23

Widget Catalog

Widget Editor

Folder catalog

Widget list

Menu to create newwidgets and manage

the folders in thecatalog

Link to accessDecisyon model

Resource catalog

Property catalog

Name of thewidget

Window that lets youdisplay the file beingedited or the preview

Full screen mode of thework area view

Buttons to managethe window

Menu to access thedocumentation orselect a different

view

Page 25: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 24

5 Starter Kit 4: Insert a Time Series Widget & Publish thePage

In order to use the Predix Time Series widget on a page, you must have bound DAC RunTime with oneof the Time Series services available in the user’s space.

5.1 Adding a Time Series Widget to a PageThe “Predix widgets” consume Predix’s services API and can be dragged and dropped to the page. Inthis example, we are going to add the “Time Series” widget to the page that leverages the Predix-UIcomponent 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.

Page 26: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 25

3. Select and drag in the page the “Time Series” widget from the Predix folder.

5.2 Configure Properties of the Time Series Widget1. 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 “1h-ago” (relative value).

Page 27: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 26

Tags: You can select one or more tag names from the Time Series service. It’s also possibleto use a parameter to dynamically set the tag name that will be used to query the TimeSeries 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 RTBy default, each new page goes in the “not published” list in the “catalog tree”. To publish a page, youneed to drag and drop the page from the “not published” to the “published” folder. See image below.

Page 28: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 27

Now you can preview the active app in your local DAC-RT environment. In order to preview in a localbrowser the page you are working on the page designer you can click on the “Page View”. See imagebelow.

To open the preview, DAC will start the local DAC-RT, if not yet started; DAC automatically managesthe authentication of the user without the credentials having to be inserted. The system will show thepreview page even if it is not published, and it is not associated with a Group (see next section).

Page 29: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 28

6 Starter Kit 5: Add User and Group PrivilegesAdding users and groups allows you to assign access privileges to individual users so they can view andwork 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 arebound 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.

Page 30: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 29

Once the users are created, it is necessary to associate users with a specific group in order to createprivileges 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.

Page 31: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 30

6.1 Assign App Privileges and Groups1. 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.

Page 32: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 31

7 Starter Kit 6: Configure an Alert

7.1 Anomaly Detection: Role of AlertsThe alerts and rules service in DAC is an advanced tool designed to monitor the data and informationand issue real-time alerts when anomalies in data are detected and/or tolerance thresholds arereached or exceeded.

You can create an alert with the “Rule Designer” (Application >> Rule Designer) service, invoked fromthe Starting page.

Page 33: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 32

7.2 Creating a Condition Alert Associated With a Time SeriesThis example demonstrates the steps to create a simple alert using query-type action for placement inthe 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 orrelative.

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.

Page 34: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 33

2. Define a condition:

Select the “Simple Condition” button, which inserts a simple condition row in the listbelow.

To define the condition, you need to click the button that opens the simple conditioneditor.

Define a condition for TAG SENSOR_02 >100 and click Ok.

Page 35: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 34

3. Define a simple action:

Define a SQL statement executed once the rule condition is triggered. For instance, in theabove example, the information about the triggered alert is stored in a table.

Page 36: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 35

7.3 Testing a Condition Alert1. Use the Play button to start the Rules Execution Test wizard.

a. First, you select the data source where you want to execute and validate the alert. Thereare 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

1

Page 37: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 36

b. After selecting the simple data option, you can use the Excel file available in the DevBoxdesktop:

i. File: select the file in a folder.

ii. Sheet: select the sheet in the Excel file.

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. Name: name of the tested rule.ii. Sensor Data: list of the tags and the associated threshold.

iii. Timestamp: date and time of the event.iv. Attributes: other information available in Excel that is associated with the time series.

b

Page 38: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 37

7.4 Save Condition AlertsTo save the Condition alerts, go back to the rule management wizard and click on Save.

Page 39: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 38

8 Starter Kit 7: Deploying Your App to Predix

8.1 Deploying Your App in PredixThe last step to use your app in Predix is to deploy the app. You can run the Application Deploymentwizard from the main DAC menu or click on the Deployment shortcut on the Starting page.

Page 40: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 39

At this point, you are ready to deploy the app you are currently working on in the Predix DAC-RTenvironment. You are offered two options for deployment: Deploy all application objects, or Deployonly selected objects.

At the first access, the system will inform you, that the selected application is not contained in thedestination 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.

Page 41: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 40

If “Yes” was selected, the wizard will automatically start the deployment process of the app you arecurrently working on.

The wizard will show two options:

1. Deploy all application objects: This option determines all the application objects that havebeen modified after the last deployment to Predix.

2. Deploy only selected objects: This option determines that all the objects to be deployed onPredix can be manually selected.

Page 42: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 41

Deploy All Application Objects1. 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-DTManual.

Page 43: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 42

2. The deployment is currently running and you can monitor the result of the deployment foreach single object.

Page 44: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 43

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.

Page 45: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 44

Selecting the “No” option as part of the first step of the Wizard (see figure below), lists the applicationdeployed in the destination. This is where you select the source model for copying or deploying theobjects it contains.

If you select “Deploy on a different model target application” flag, you enable a drop-down menu thatlists 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 applicationobjects or a selected list of objects.

Important Note: When the Application Deployment starts, the system determines if there are anyapplications 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 removedlocally from PREDIX as well.

Page 46: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 45

After selecting the third option, the wizard will show the list of removed applications that can bedeleted on Predix. Select the application and confirm by clicking on the ok button. .

Page 47: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 46

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 willsee 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 andDesignTime Manuals.

Page 48: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 47

Page 49: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 48

10 Decisyon Reference AppDAC DevBox also includes a reference application (DAC Demo), a pre-built application that may helpyou to better understand how an application it is built page by page. Make sure you have successfullycompleted 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 ServicesThe reference app is built using a specific asset data model and tag names ingested in the time-seriesservice. In order to configure and use the reference app the following Predix services must be used inthe space where DAC is instantiated:

● Asset Data● Time Series● PostgreSQL

Page 50: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 49

10.2 Configure the Asset Data ServiceThe 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 ofthe 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 Kitavailable at this link: https://predix-starter.run.aws-usw02-pr.ice.predix.io/#!/asset

Page 51: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 50

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.

Page 52: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 51

● 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 thefile “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-usw02-pr.ice.predix.io/turbines or https://predix-asset.run.aws-usw02-pr.ice.predix.io/components

● Click on Submit.

10.3 Time Series Data IngestionThe data that you are going to ingest in the Time Series service are compliant with the Asset Modelcollections loaded in the previous step. The tag name you ingest in the Time Series is the same used inthe field “sensor” of the components collection.

The following is a sample JSON data that you have to ingest.{

Page 53: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 52

"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/dac-repos/DAC-datapoints-time-series.json

Page 54: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 53

2. Open the Predix Tool Kit available at https://predix-starter.run.aws-usw02-pr.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).

Page 55: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 54

● Copy the JSON of the file “DAC-datapoints-time-series” and paste it in the RequestBody.

● 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 InsertDAC DevBox has a local PostgreSQL database containing the alerts triggered from rules and otherinformation 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 someSQL 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 useany other solution you like to insert data in your PostgreSQL service.

To insert data into the PostgreSQL service:

Page 56: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 55

1. Download the SQL script to execute from https://s3-us-west-1.amazonaws.com/dac-repos/DAC-ReferenceAppDataModel.zip

2. Deploy pgStudio in your space to be able to execute the script. Please refer to this KB articlefor details: https://www.predix.io/support/article/KB0010829

3. Open your pgStudio and insert the credentials of your PostgreSQL service (you can get themfrom the VCAP_SERVICES)

4. Open a SQL Worksheet.

Page 57: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 56

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 App1. 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 theapp in your local RT. You can do that by clicking on the application menu of your DevBox, thenselect the browser and run the demo app.

Page 58: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 57

Page 59: Starter Kit Decisyon App Composer (DAC)...DAC is a visual app development environment that allows users to create, edit, deploy and run IIoT data-driven applications in Predix while

Decisyon, Inc. - Proprietary | 58

10.6 Demo App on DT and RTThe demo app will be accessible by both DAC-DT and RT. That means that you can create and editpages in DT, then deploy to Predix and run your app; then perform analysis and collaboration in Predixusing 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.