It was just a matter of time that we tried to use Xatkit to create a bot to simplify modeling. We always like to explore both directions in the AI vs Modeling intersection. And given the limited usability of current UML modeling tools (see our humble experiment) we wanted to experiment with a more “natural” interface.

True, web-based and textual modeling tools offer typically better usability than full-fledged UML modeling tools but they still represent an external tool that a team must install, adopt and learn. Instead, many teams already use tools like Slack for communication purposes. So, why not trying to use that same tool to sketch UML models? And even better, using natural language commands?

Well, it turns out that creating a UML bot that listens to your Slack commands is not that difficult. You just need to combine the Slack and UML platforms in Xatkit (we already sold you the benefits of Xatkit’s modular architecture, right?) and define the UML intents that your chatbot should listen to.  Use this simple example UML bot to get started (note that, for simplicity, this bot does not use DialogFlow for the intent recognition and defaults to regular expressions, you can easily update the properties to change this and get a much more flexible UML dialogue with the bot).

The following figure shows this bot in action. UML modeling in Slack

As we said, the UML bot for this scenario is rather simple. For instance, let’s see the definition of the intent for creating classes (again, if you configure the bot to use DialogFlow for the Natural Language processing you should add more training sentences).


//Intent to recognize the command to create a class
intent CreateClass {
	inputs {
		"create class MyClass"
	}
	creates context Class {
		sets parameter name from fragment "MyClass" (entity any)
	}
}

and the corresponding action to be executed once this CreateClass intent is recognized.


on intent CreateClass do
	def class = action UmlPlatform.CreateClass(name : context(Class).get("name"))
	session.store("class", class)
	action SlackPlatform.Reply(message : "Created class " + context(Class).get("name"))

Internally, this action will create the class as an instance of the Eclipse UML metamodel. The graphical rendering of the model is delegated to PlantuML: the Eclipse UML model is transformed to PlantUML syntax (we’ve to confess this transformation was written in Java) and render by PlantUML before returning it back to Slack.

Before you start asking/complaining about all the intents the bot won’t recognize (e.g. creating inheritance relationships, defining cardinalities,…), let me clarify that the purpose of this experiment was NOT to present the complete definition of a UML chatbot (for that, you better go and read Towards Conversational Syntax for Domain-Specific Languages using Chatbots) but to show how these new “intelligent” technologies and interfaces help us to create new (complementary) ways to create a models.

Note also that thanks to Xatkit, instead of Slack you could use Twitter or any other input platform to create the same model. On the other hand, the collaborative nature of Slack enables interesting extensions to this bot (like easily annotating and visualizing who did what addition/modification on the model and voting on changes suggested by others) towards the collaborative definition of models and metamodels.

Welcome to the future of modeling!

Want to build better software faster?

Want to build better software faster?

Read about the latest trends on software modeling and low-code development

You have Successfully Subscribed!

Pin It on Pinterest

Share This