design-first / system-designer

A low-code development platform for creating systems 🇺🇦#standwithUkraine
https://designfirst.io/systemdesigner/
Apache License 2.0
930 stars 136 forks source link

Error when viewing diagrams #119

Closed nadavoid closed 5 years ago

nadavoid commented 5 years ago

When trying to view the diagram of a very simple system, only an error message is displayed: "Error: syntax error in line 59 near '->'".

I'm trying System Designer for the first time today, so it's very likely I'm missing something.

My sample Basic.json system, which contains one schema: Item, with one property: title.

{"name":"Basic","master":true,"version":"0.0.1","description":"","schemas":{"f8303787-00f6-40ed-b62b-079fb8fded2f":{"_id":"f8303787-00f6-40ed-b62b-079fb8fded2f","_name":"Item","_inherit":["_Component"],"title":"property"}},"models":{"ab0c5689-b840-432d-b1e3-91b20141d101":{"_id":"ab0c5689-b840-432d-b1e3-91b20141d101","_name":"Item","_description":"","title":{"description":"","type":"any","readOnly":false,"mandatory":false,"default":""}}},"behaviors":{"b022126b-a514-4996-b6e3-615b820d6c32":{"_id":"b022126b-a514-4996-b6e3-615b820d6c32","component":"a9cbf3e1-45ae-4076-a877-a3c4a0c4ca1e","state":"start","action":"function start() { \n  \n}","useCoreAPI":false,"core":false}},"types":{},"components":{"Item":{"f02ee5ce-d031-44f2-8c43-26446a17ec56":{"_id":"f02ee5ce-d031-44f2-8c43-26446a17ec56","title":"test"}}},"_id":"a9cbf3e1-45ae-4076-a877-a3c4a0c4ca1e"}
ecarriou commented 5 years ago

Thanks for the report.

When you get this error, generally it means that you used some keywords of the DOT language (i.e. node, edge, graph, digraph, subgraph, and strict) in schema or property name. But it is not the case in your system. So the diagram should be generated correctly.

In fact, I have tested your system and I get no error.

What you can do is to export your system in Graphviz format with System Designer, and send the file to see where the problem comes from.

nadavoid commented 5 years ago

Thanks for the quick reply!

A restart and a new day seems to have fixed this for me. Maybe something was stuck in a cache or something.

I did have a different system that had the word Node as a Schema name, which was throwing this error. Renaming it immediately fixed the error and I see a full diagram.

Thanks again for the help! I'll definitely make a note of those reserved words.