43
Views
4
Comments
Solved
[Drawflow] Save the Data on Dataflow in database
drawflow
Reactive icon
Forge asset by Izam Basiron
Application Type
Reactive

I've dowloaded this Forge and I'm using it.

It's great to edit data on the flow chart but is it possible to save the data into entity?


2024-03-21 04-20-48
Izam Basiron
Solution

Hi @Tsubasa Yoshikawa ,

After looking at where you put the export button, I knew I had to do something :D

I updated the component and the demo to include an export  example. 

Basically what you need to do is:

  1. Assign the Editor instance to a local variable in the OnInitialize_DrawflowEditor
  2. In OnClick event, call the "editor.export()" to get the data
  3. Convert that data into something Outsystems understands

You can find step 2 and 3 in OnClick_Export action in the updated example. Hope this helps.

Kind regards

2024-03-21 04-20-48
Izam Basiron

Hi @Tsubasa Yoshikawa ,

With the editor instance, you can export the data to JSON (https://github.com/jerosoler/Drawflow#export--import). The component has OnInitialize event that will pass the editor instance, where you can assign it to a local variable. In the demo, I listen to events in the OnInitialize_DrawflowEditor action. 

The only issue I see with the JSON is modules and nodes are not in an array. You can loop this in JS to make it more Outsystems structure friendly to be able to use it. 

I hope this helps. Let me know if you need more info. 

Kind regards

UserImage.jpg
Tsubasa Yoshikawa

Hi Izam,

Thank you for your reply.

I tried to add export button.

But I can't find any variables to ExportonClick button and I'm stuck...



Firstly, I made export event with JS like below  however 

I'm really not sure how to implement logic from here. 



I understand I get Data variable with Json and put it into structure variable,

then save it into entity by CreateOrUpdateEntity action, though...


Could you possibly tell me about this? 

I'd like you to lend me your expertise.


Best,


2024-03-21 04-20-48
Izam Basiron
Solution

Hi @Tsubasa Yoshikawa ,

After looking at where you put the export button, I knew I had to do something :D

I updated the component and the demo to include an export  example. 

Basically what you need to do is:

  1. Assign the Editor instance to a local variable in the OnInitialize_DrawflowEditor
  2. In OnClick event, call the "editor.export()" to get the data
  3. Convert that data into something Outsystems understands

You can find step 2 and 3 in OnClick_Export action in the updated example. Hope this helps.

Kind regards

UserImage.jpg
Rahul Sharma

Hello friends I have read many discussion here I found my answer here thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.