Heigvd / Wegas

A Web Game Authoring System coded in Java and Javascript for rapid development of serious games without programming skills.
https://wegas.albasim.ch
MIT License
28 stars 15 forks source link

FSM saving changes on states sometimes fails #1889

Open xgo-work opened 1 year ago

xgo-work commented 1 year ago

To reproduce open UnPeuDeReact and open the view on the testDelay state machine. Try to edit the label of the lowest state on screen. Save. The following error should show up.

At first sight, it seems related to connecting transitions that have no assigned label.

[default] {"refId":"State:24034102:sxFP0j","version":2,"x":215,"y":424,"id":51302,"index":2,"onEnterEvent":{"content":"RequestManager.sendCustomEvent(\"popupEvent\", {\"timeout\":0,\"content\":\"<p>Hellooooo</p>\"});\nDelayedEvent.delayedFire(0, 10, \"stopCoffeeBreak\");","language":"JavaScript","parentType":"State","parentId":51302,"@class":"Script"},"transitions":[{"refId":"Transition:#0:2ktGao","id":51303,"version":1,"index":0,"nextStateId":3,"preStateImpact":null,"triggerCondition":{"content":"Event.fired(\"stopCoffeeBreak\");","language":"JavaScript","parentType":"Transition","parentId":51303,"@class":"Script"},"dependsOnStrategy":"AUTO","dependencies":[],"label":null,"stateMachineId":51295,"parentType":"State","parentId":51302,"@class":"Transition"}],"label":"sdfdffsdf","parentType":"FSMDescriptor","parentId":51295,"@class":"State"} [ { "path": [ "transitions", 0, "label" ], "property": "instance.transitions[0].label", "message": "is not of a type(s) string", "schema": { "required": true, "type": "string", "value": "", "view": { "featureLevel": "DEFAULT", "index": 0, "label": "Label" } }, "instance": null, "name": "type", "argument": [ "string" ], "stack": "instance.transitions[0].label is not of a type(s) string" } ]

xgo-work commented 1 year ago

Current workaround Edit the transitions that are linked to the edited state and give it a label