Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connections support #1330

Open
2 tasks
fcastill opened this issue Aug 21, 2020 · 0 comments
Open
2 tasks

Connections support #1330

fcastill opened this issue Aug 21, 2020 · 0 comments

Comments

@fcastill
Copy link
Collaborator

fcastill commented Aug 21, 2020

Is your feature request related to a problem? Please describe.

Flogo Project introduced the concept of "connection", the Flogo Web UI should support working with connections.

From Flogo Core Docs

A connection is typically used to connect to a networked resource

There are three areas where connections surface:

  1. Type of resource: A connection is implemented as a new type of resource, with type flogo:connection. An example of a connection descriptor can be found in the Pulsar Connection contribution
  2. Data type: connection is also a new data type (see Flogo data types) and a such it can be used to describe activities and triggers settings. See pulsar trigger descriptor and pulsar activity descriptor
  3. In app.json: If a contribution declares a setting of data type connection in its descriptor.json then the value for that setting can be either an in-line connection or a shared connection. Usages of connections will be described below.

Question: can connection data type be used anywhere a data type can be used? Trigger settings, handler settings, trigger output, trigger reply, activity settings, activity input, functions.

Usage of connections in an app (flogo.json)

From Flogo Core Docs

These connections can be shared or defined in-line. When a connection is defined in-line, it is only used by that contribution. Shared connection is defined once in the flogo.json and can shared between multiple resources.

Note that for both inline and shared usages the fields under connections.settings depend on the connection.ref. Those settings should be declared in the corresponding descriptor.json for the connection contribution. That is similar to the way Web UI currently uses the descriptor.json of activities and triggers to extract their "schema".

Also, if a connection is used in a Flogo app then the corresponding ref for that connection should be part of the imports of the app.

In-line

"activity" : {
  "ref": "#sql",
  "settings": {
    "connection": {
      "ref" : "github.com/project-flogo/contrib/connection/sql",
      "settings" : {
        "dbType": "mysql",
        "driver": "mysql",
        "dataSource": "username:password@tcp(host:port)/dbName",
      }
    }
  }
}

Shared

"connections": {
  "myConn": {
    "ref" : "github.com/project-flogo/contrib/connection/sql",
    "settings" : {
      "dbType": "mysql",
      "driver": "mysql",
      "dataSource": "username:password@tcp(host:port)/dbName",
    }
  }
}
"activity" : {
  "id": "a1",
  "ref": "#sql",
  "settings": {
    "connection": "conn://myConn"
  }
},
"activity" : {
  "id": "a2",
  "ref": "#sql",
  "settings": {
    "connection": "conn://myConn"
  }
}

Describe the solution you'd like

The Web UI should be able to handle importing, using and exporting connections for all areas (resource type, data type, app usage) and all usage types (in-line and shared).

Plan

We will introduce the connections to the Web UI in iterations as the shared connections in particular will require designing new UI components and interactions.

We will divide it in at least 2 iterations (subject to change). This Github issue will act as the placeholder for supporting all connections features and we will describe the iterations in subsequent Github issues.

To Do

Questions

  • Is the data type connection supported anywhere a data type can be used? If so:
    • Should it be allowed in the input/output of a resource? Or maybe its usage should be prevented.
  • Is the data type connection supported in the input of an activity/stage? If so:
    • How should it be handled in the inputs of the flow debugger?
    • How should it be displayed in the outputs of the flow debugger?
    • How should it be handled in the stream simulator?
  • Are aliases of connections refs allowed?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant