📜 ⬆️ ⬇️

Automation of the company's business processes in Trello using semantic modeling technology

In recent years, Trello is increasingly spoken of as an excellent tool for organizing and planning. In our company, we have been using Trello for 3 years for planning many processes, starting with vacations, business trips and negotiating contracts and ending with project management.

Unfortunately, not everything is so beautiful in Trello. It is impossible to make a custom workflow. That is, we need to take one employee who will be dragging cards with hands on different boards. How to make so that this employee could be transferred to another, more interesting and creative work?

Of course, you say, you can write a script that will do all this for us. But there is a problem. The script can be written only by a programmer or a person who understands how to do this. Support the script will have to him. We found a simpler and more logical solution - this is semantic modeling.
')
Semantic modeling allows you to write all the logic of the work of the board in Trello in natural language.

Approval of travel and vacations


Take the simplest process: the coordination of travel and vacations. According to our existing regulations, every employee who plans to take a vacation or go on a business trip, publishes an application to Trello. The application is placed on the “For approval” sheet.



As soon as the application is approved (in fact, this means that the head of the employee and / or the representative of the finance department ticked the required checkbox), she is moved to the sheet “Agreed travel”. The application for the leave falls accordingly in the "agreed vacation", etc. After that, you need to notify the employee that his application has been agreed.

Suppose we want to automate this process so that the application after approval will move to the desired sheet automatically, and the employee will be notified of the change in the status of the application. Consider what we need for this.

Required Tools


To develop the model, we chose the ide from Jetbrains MPS (Meta Programming System). The d0SL - Delta0 Semantic language, created on the basis of semantic (logical) models, is used as a modeling language.

The whole process of installing Jetbrains MPS and the necessary plugins is fully described here: https://d0sl.imtqy.com/en/quick/installation/ .

Install the finished model Trello boards can be on the link: https://d0sl.imtqy.com/en/quick/trello/ .

Semantic model. What happened?


Let's see what the resulting semantic model of the Trello board looks like. It contains our rules:




The model has a checkBoard predicate, which is called for each card in the board. He is given the ID of the card, the name of the user who performed the last transaction with the card, the sheet from which the card was moved and the sheet in which it is now located. Further in checkBoard we can set the rules according to which we plan to process our applications.



Note that the semantic modeling allows you to make all the logical business rules in one document and write these rules in the language of the subject area, the "native language" for users of the model.

The ability to do something with the card provides the basic model of TrelloBoard, which looks like this:



If we run the model, then as soon as the application in the “For approval” sheet passes the approval process,



The system will move it to the appropriate section and notify the creator of the card about the change in the status of the application.



If the request that was not agreed, try to move it manually, the system will send it to the site and write an angry comment.

And what's under the hood?


The base TrelloBoard model is essentially an interface that we implement in Java (in this case, in the com.gav.semanticTrelloBoard.TrelloBoardDSL class).

It looks like this:



We set the names of the functions with the help of decorators and implement them.
We also have a class AiTrelloBoard, which allows you to work with Trello. It implements java-implementation functions such as start:



In the trelloBoard.properties file we keep all the parameters of the trello api (such as application_key, board_id, etc.) and last_update_timestamp - the timestamp of the last update'a.

Thus, at the cost of not too much effort, we can automate the necessary business processes in Trello. It is much more convenient to use and maintain this solution than the program code.

It is obvious that the possibilities of semantic modeling are not limited to the solution of this problem. After all, if in the classical approach to solving problems, the analyst first creates specifications, on the basis of which developers subsequently implement the architecture and write code, then using the semantic modeling language d0sl, the analyst can create task specifications in a formal logical language that will be converted into executable code without human intervention. This can significantly reduce the cost of developing, deploying and testing new services.

We made the decision to work with Trello open and laid out on the githab .
We wanted not only to provide a tool for modernizing processes in Trello, but to demonstrate the advantages of using such a modern approach as semantic modeling with this simple example. We will be happy if you can add something of your own to this case and share your experience using our solution.

useful links


You can read more about the semantic modeling language d0sl here .
The mathematical foundations of semantic modeling are outlined here .

Source: https://habr.com/ru/post/453492/


All Articles