When I first started working at Logi Analytics, I was struck by the depth of embedded analytics expertise at the company. More specifically, I noticed that Logi was very in tune with the unique needs of application teams. This was manifested in the various aspects of the Logi Info platform. Those aspects range from the really big and obvious like direct connect, adaptive security, and UI/UX customization, to the less obvious—but no less important—like the interplay between action elements and process tasks. Those small but pivotal element combinations give a Logi Info developer the ability to create deep links between the parent application and the embedded content.
As you may have heard, we recently launched a new product, Logi Composer. For those who have been developing with Logi for a while, Logi Composer was designed to give you that effortless, browser-based, out-of-the-box development experience you have been asking for—all without having to sacrifice control and adaptability.
In this post, I’ll be focusing specifically on Logi Composer Actions. While not the same as Logi Info’s action elements and process tasks, Logi Composer Actions serve a similar purpose. Actions give application teams the ability to integrate contextual visual data from Logi Composer into the parent application. The general idea is simple:
- An end user interacting with a visual may choose to take an action.
- That action sends contextual information to an external application.
- That application uses that contextual information to drive interactions with the parent application.
All Actions consist of an Actions Template (defined in Composer), an invocation from the active visual and the Actions Server (maintained and created by the application developer). Read on for an example of how you could integrate Actions into your Logi Composer workflow.
Here’s How It Works
Step 1: Define an Action Template
Working with Actions starts in the Logi Composer UI with an account administrator defining an Action Template. This is where we provide context to the action itself and to our data. For example, the Action Template gives the location of the Actions Server, provides some specifics about the data associated with the action, and connects the action to one or more data sources. A more formal way of describing it would be to say that each Action Template defines an application integration definition connecting Logi Composer with an external application.
Step 2: Invoke the Action
The user invokes an action by simply selecting the Action button in the radial menu. When an action is invoked the following occurs:
- A query definition is created based on the filters applied to the visual used to invoke the actions and the specification in the Actions Template.
- The query definition is sent to the Actions Server in the form of a JSON formatted object.
- An application hosted on the Actions Server uses the Logi Composer API to take some action based on the query definition.
Step 3: Decide What Happens Next
The true power—and almost limitless extensibility of Actions—happens at this step. This is the step where an application team using their language of choice and tools of choice write an application to take full advantage of everything Logi Composer has to offer. It can be as simple as noting the filters that were applied at the time invocation, something more complex such as using the query definition to retrieve data with Composer’s Query API which is then used in the parent application, or something way beyond that. The possibilities are truly endless. The example we use in this exercise is based on Node Express and has the following basic functionality.
- Receives query parameters from Logi Composer
- Creates and sends a query to the Composer API using the parameters in Step 1
- Receives the data associated with the query in Step 2
- Takes some action on that data
Implementing the Actions Server for Testing
- Download the Action server to your Composer instance
- Install Node JS
- Install Yarn
- Start Yarn
- Set the target URL in the Actions Template
- Download the Actions server repository to Desktop
- Copy folder from Desktop to Composer instance
~ sudo scp -r -i ~/.ssh/<your-key> ~/Desktop/actions-server [email protected]:/home/user
- ssh to Composer instance
~ ssh -i ~/.ssh/<your-key> [email protected]
- Install nodejs
- Install yarn on Composer instance (https://yarnpkg.com/en/docs/install#centos-stable)
- cd to actionserver/code
- Start yarn by giving username, password and instance
[[email protected] actions-server]$ yarn start –username admin –password yourpassword –server http://composerinstancehost:8080/Composer
- Actions server is set up
- Set the TargetURL in the action template to http://localhost:3000/invoke
Successful start template
Successful invocation example
The way we think about Logi Composer Actions is a little different from the way we think about Logi Info’s action elements and process tasks. The key here is freedom. With Logi Composer Actions, we use an API-first authoring paradigm to give you the freedom to craft the deep linkages between the embedded content and the parent application in the way you want, using the tools you are comfortable with.