I implemented this kind of network with CytoScape.js library, but I've got "unexpected end of json input" error.
I have the below list for Nodes. I change it to Json and assign it to "Out1" in "DataAction1",then put "Out1" into "itemsJson" of CytoscapeBlock.
I assign "itemsJson" to a variable as array.
I googled that error and I tried everything but I couldn't figure it out.
Do you have any ideas on why I'm having "unexpectd end of JSON input" error in Client action?
I look forward to your advice.
I've attached my oml file for your information.
I'd appreciate it if you could tell me why I'm missing.
Best,
Hi Tsubasa,
The encountered issue is due to the execution of the block element i.e. CytoscapeBlock before the dependent DataAction completed its fetch operation. As a solution, I suggest you encapsulate the CytoscapeBlock within an IF node as shown below with a condition.
Note: I have renamed the DataAction to --> GetItemListJSON
Condition Expression value:
GetItemListJSON.IsDataFetched and not GetItemListJSON.HasFetchError and Trim(GetItemListJSON.Out) <> ""
Refer to the attached .oml file
See this working screen: Cytoscape Diagram
I hope this helps you!
Kind regards,
Benjith Sam
Hi, Benjith Sam
Thank you for giving me the solution!
I have a question.
I'd like to know about the Expression in that IF node .
Am I correct that you need to use the above expression when you solve "Unexpected end of Json input"?
For me, for example, "Trim(GetItemListJSON.Out)" looks like a unique expression.
I'm curious about it.
Let's break the expression and try to understand
1) IsDataFetched is a runtime property which you can refer from the DataAction and Screen Aggregate
GetItemListJSON.IsDataFetched
2) HasFetchError is a runtime property which you can refer from the DataAction and Screen Aggregate
not GetItemListJSON.HasFetchError // negation of the boolean value
For more info refer this: Documentation | Data_Action
3) Trim function is used to remove all leading and trailing space from the text. So this condition checks whether the Output JSON from the DataAction is a non-empty value.
Trim(GetItemListJSON.Out) <> ""
In short, I just defined multiple layers of strict (AND) conditional check to ONLY load the block if and only if the block input JSON value (i.e. ItemsJson) is available.
Hi Benjith Sam
I understood what you mean.
I got what I want thanks to your advice.
Thanks.