This morning, Ken and I defined a detailed use case for Sutoiku Activities, from which we outlined an architecture and implementation roadmap. As mentioned earlier, Activities will be the default sample application for the Sutoiku platform, therefore we’re trying to keep it as simple as possible, while ensuring that it properly demonstrates most of the platform’s key features.
Object Model
The application will be built around three main objects:
For the first release, most of our attention will be focused on the Task object.
In situ Task Capture
One of the primary goals of Sutoiku Activities is to make it easier for users to quickly create tasks from whichever tool they’re using at any point in time. We call this in situ task capture. In order to implement this feature, we’re making the assumption that knowledge workers spend a majority of their computing time using either an email client (eg. Gmail, Outlook) or a note taking tool (eg. Evernote, Google Docs, Microsoft Word). In such a context, we want to make it possible to create tasks directly from these tools.
Email Task Capture
To create a task from an email client, the user can simply forward an email to a particular email address (eg. tasks@mydomain.com). The email will be automatically picked up by some email gateway that will parse it and create a matching task for it. Optionally, some meta-data about the task can be added at the top of the email’s body, before its forwarded content. The syntax is directly inspired from the one used in OmniFocus. For example, the following line will create a task called “Buy milk” associated to the “Replenish fridge” project, due by Monday, expected to take an hour, and marked with a priority level 1.
-- Buy milk :: replenish fridge # monday $ 1h ! 1
This form of task capture will work with any email client, from any device. An alternative mode will be offered for Gmail (if we find a way to implement it) by adding a “Create Task” button allowing a task to be created in relation to a particular email. This button should allow most of the task’s fields to be set, including its assignee (by default, a task is assigned to its creator). Either mode will store a link to the original email within the task’s record.
Document Task Capture
To create a task within a document stored in Google Drive, the user can simply use the exact same syntax, anywhere in the document. A cron job running on the Node.js server will search for documents containing the double hyphen prefix on a regular basis (maybe every 30 seconds) and parse the activity expression upon finding one, then create a corresponding task.
This mechanism will work with any note taking tool that produces files which content can be indexed and searched by Google Drive. But when used with Google Docs, any processed activity expression will be automatically replaced by a link to its related task, while it will be left untouched when using any other note taking tool (unless we develop a connector for it later on). Based on the previous example, the link will look like that:
[Task: “Buy milk” related to the “Replenish fridge” project, due Monday, 1 hour, Priority High]
The link will point to the related task displayed by Sutoiku’s record view. Ideally, users should not modify this link, since any modifications will be ignored (for performance reasons). Instead, users should click on the link and modify the task from the record view. In order to prevent links to be modified, we might display them as images, ideally using the SVG format. It should also be noted that when using another note taking tool, the activity expression is left untouched, therefore users should not modify them once a task has been created.
Gateway Object
In order to create tasks from an Email or a Document, we need to either execute custom JavaScript code or add some new capabilities to the platform. The former would be nice but would require that we make our Node.js server multi-tenant, which is a massive undertaking, therefore we must do the latter, through the implementation of a Gateway object. This object will let users create custom gateways capable of creating records for any object based on the reception of an email or the addition of specific expressions within files stored in Google Drive. The Gateway object will have the following fields:
Related Object (su_task in the current example)
Expression Syntax (a JSON object describing the expression’s syntax)
Email Username (tasks in the current example)
Document Link (a JavaScript expression describing the Document’s link format)
In the context of our previous example, the Expression Syntax will be something like this:
{
prefix: "--",
mappings: [
{prefix: "::", field: "su_project"},
{prefix: "#", field: "su_due_date"},
{prefix: "$", field: "su_time"},
{prefix: "!", field: "su_priority"}
]
}
The Email Username will be optional. Setting it will activate the email gateway.
The Document Link will be optional. Setting it will activate the document gateway.
Task List
For obvious reasons, users will need a way to lookup lists of tasks, either the ones assigned to them, or the ones they are managing and that might be assigned to them or others. To do so, they will use the Object View with two pre-built views defined with the query builder, My Tasks and My Managed Tasks. But for these views to work out of the box, the filtering component of our query builder needs to support the use of filtering variables as filter values. This is something that we will discuss in a future post.
Platform Requirements
This use case added a few requirements to our platform:
- Filtering variables in query builder
- Cron jobs on server
- Gateway object
JavaScript Libraries
At a high level, this use case will require the development of the following JavaScript libraries:
- Google Event Connector
- Google Task Connector
- Activity Expression Parser
- Email Gateway (over SMTP)
- Document Gateway (over Google Drive)
Implementation
Ken will be responsible for developing this application. Luckily for him, our CTO already implemented a connector for the Task virtual object using the Google Task Service, which is by far the most complex component for this project. Therefore, Ken will start by implementing the Activity Expression Parser, Email Gateway, and Document Gateway as standalone components, then integrate them with the rest of the product when it’s in good enough shape. After that, we will start to use it internally in order to get most of the bugs out of the system.
If you have any idea to improve this first use case, let us know!