|
Re: Eclipse Sirius Web's Diagram manupulation by chatbot [message #1860589 is a reply to message #1860588] |
Fri, 18 August 2023 14:58 |
|
Hi,
Interesting subject!
I don't know anything about chat bots, but if you want to control a Sirius Web application programatically, you "simply" need to use the exposed GraphQL APIs.
Everything the frontend code does to query or manipulate the representations (including asking which tools are available on a given diagram element, i.e. in its contextual palette, or invoking such a tool) is done using GraphQL queries or mutations.
Depending on your familiarity with JavaScript/TypeScript/React, your best bet would be either to:
* look at the frontend's source code (for example https://github.com/eclipse-sirius/sirius-web/blob/master/packages/diagrams/frontend/sirius-components-diagrams/src/palette/ContextualPalette.tsx), or
* open your browser's dev tools in the "Network" tab, invoke some tool manually and look at the HTTP request sent by the frontend to invoke the tool in question (and then generalize to pass your own arguments you would have determined from the message in the chat).
For diagrams specifically, you'll get a good overview of the queries and mutations (edition operations, e.g. invoke a tool) by looking at the GraphQL Schema at https://github.com/eclipse-sirius/sirius-web/blob/master/packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/resources/schema/diagram.graphqls
For more generic operations, see https://github.com/eclipse-sirius/sirius-web/blob/master/packages/core/backend/sirius-components-collaborative/src/main/resources/schema/core.graphqls and https://github.com/eclipse-sirius/sirius-web/blob/master/packages/sirius-web/backend/sirius-web-graphql/src/main/resources/schema/siriusweb.graphqls.
Good luck, and if you get intersting results do not hesitate to post some screenshots or videos here to show your work to the community.
Regards,
Pierre-Charles
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04028 seconds