playMaker

Author Topic: DataMaker Xml xPath and Json [ECOSYSTEM] [FEBRUARY 2022]  (Read 55433 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #75 on: January 09, 2017, 02:55:44 AM »
I have an issue with the datamaker.

The "Conver Json String to Xml Node" isn't working properly.

It gives me an error "After Parsing a value an unexpected character was encountered"

I have a JSON String which I'm using:
{"root": [{"money":"2105","cars":"","power":"1","weight":"1","grip":"1","wins":"0","losses":"0","experience":"0"}] }

The node cannot parse arrays?

It works here:



Bye,

 Jean
« Last Edit: January 29, 2018, 04:00:16 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #76 on: January 09, 2017, 03:04:25 AM »
Can someone check whats wrong with "Xml Create Node" action?

oups, good catch, it's fixed now, please redownload from the Ecosystem.

 Bye,

 Jean

gozda

  • Junior Playmaker
  • **
  • Posts: 88
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #77 on: January 09, 2017, 04:08:52 AM »
Thank you

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #78 on: January 29, 2018, 04:02:34 AM »
Hi,

 New update with few fixes for capricious Action editor and new actions:

- "XmlNodeRemoveAttribute"
- "XmlCloneNode"
- "XmlParentNode"

also, there is a new scripting symbol defined DATAMAKER which allows developers to better provide support for DataMaker and check that it's installed to avoid unity errors and act nicely.

More updates will come soon as I finish the meFace sample.

 Bye,

 Jean

Hayato

  • Playmaker Newbie
  • *
  • Posts: 36
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #79 on: February 27, 2018, 07:36:10 AM »
Hello , I got a problem with "XmlGetNextNodeListProperties" .

I just download DataMaker from ecosystem and using playmaker 1.8.9 and unity 2017.3.0f3.

When I use "XmlSelectNodes" to Query and setup Store Reference then use "XmlGetNextNodeListProperties" to get properties in nodes , it works as well at the 1st time .
Then I change the xPath Query words and do 2nd query again , I can see the Xml Result in "XmlSelectNodes" have changed as what I do , but "XmlGetNextNodeListProperties" still give back the properties as 1st Query , even I chang Store Reference everytime I make query.

By the way , after install DataMaker , I got a lot of "good" message on unity console window when mouse around playmaker editor in editor time and playing time , is that any way totrun off it ?



Hayato

  • Playmaker Newbie
  • *
  • Posts: 36
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #80 on: February 27, 2018, 10:10:46 AM »
Okay finally I find out the reason why , there are 2 things need to do.
1.MUST setup the reset bool variable in "XmlGetNextNodeListProperties" action , and set true evertime before take a new reference.
2.Open "XmlGetNextNodeListProperties" script and hide line 117:
Code: [Select]
index.Value = nextItemIndex;
to fix the index bug.
Hope there will be a update that need not to setup reset veriable and set true everytime .

Although I still don't know how to trun off the mass "good" message in console please help me to stop it .
Thank you.


Hello , I got a problem with "XmlGetNextNodeListProperties" .

I just download DataMaker from ecosystem and using playmaker 1.8.9 and unity 2017.3.0f3.

When I use "XmlSelectNodes" to Query and setup Store Reference then use "XmlGetNextNodeListProperties" to get properties in nodes , it works as well at the 1st time .
Then I change the xPath Query words and do 2nd query again , I can see the Xml Result in "XmlSelectNodes" have changed as what I do , but "XmlGetNextNodeListProperties" still give back the properties as 1st Query , even I chang Store Reference everytime I make query.

By the way , after install DataMaker , I got a lot of "good" message on unity console window when mouse around playmaker editor in editor time and playing time , is that any way totrun off it ?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #81 on: February 28, 2018, 02:40:52 AM »
Hi,

 oups :) let me remove the spam log, it was when I wanted to debug it.

 to remove it right now, simply double click on the log entry and comment that line ( put // in front)

the trye reset must be done by you. I can not do this automatically. So have a state prior the state where you run this action, and set a bool variable to true, and reference that bool variable in the reset property of that action.

This flag is menat to be used only if you are shunting the action so that is starts again at index 0 when it will be entered the next time.

Bye,

 Jean
« Last Edit: February 28, 2018, 03:01:49 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #82 on: February 28, 2018, 06:32:06 AM »
Hi,

 new version is out on the ecosystem :)

 Bye,

 Jean

Hayato

  • Playmaker Newbie
  • *
  • Posts: 36
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #83 on: March 07, 2018, 01:11:04 AM »
Hello Jean,

Thank you for removing logs from console .
But in the new version "XmlGetNextListProperties" still go wrong after the 2nd run.

Line 117
Code: [Select]
index.Value = nextItemIndex;When DoGetNextNode() it just set Index to the last "nextItemIndex" value get at the end of 1st run.
It make 2nd run start with the wrong index.

Please check about it , thanks !


Hi,

 new version is out on the ecosystem :)

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #84 on: March 08, 2018, 07:23:50 AM »
Hi,

Ok, yes, I see. you need to create a variable index that you put in the action, and set that 0 in the same state as you reset, otherwise it starts at the index of this property. And the bug in this action is if index property is not set.

so for now do the step above, while I finish up some pending work, I want to update soon with the Reference browser as well as some new Utils features.

Thanks for pointing that out :)

Bye,

 Jean

Hayato

  • Playmaker Newbie
  • *
  • Posts: 36
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #85 on: March 08, 2018, 08:23:54 AM »
Hi,

OK I know if I setup a variable index and always set it to 0 before the state will make fine after 2nd run , but if I hide Line 117 it will work well even I setup a index or not (also the index can be set to any int will works as well when hind line 117).
That's because you have use "nextItemIndex" to deal with DoGetNextNode() loops , maybe it's not necessary to save back nextItemIndex value to "index" in line 177 , and that will make this action more easy to use .:)

DataMaker is a super powerful tool , but it's some what hard to learn without hints , if you can give a hint in the action tell the RESET is MUST HAVE , that will help a lot .
Thank you for taking time with my questions !




Hi,

Ok, yes, I see. you need to create a variable index that you put in the action, and set that 0 in the same state as you reset, otherwise it starts at the index of this property. And the bug in this action is if index property is not set.

so for now do the step above, while I finish up some pending work, I want to update soon with the Reference browser as well as some new Utils features.

Thanks for pointing that out :)

Bye,

 Jean
« Last Edit: March 08, 2018, 09:14:12 AM by Hayato »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2018]
« Reply #86 on: March 14, 2018, 02:41:12 AM »
Hi,

 Yes, It's always tricky to find the right balance between a simple action and a feature rich action.

What I would suggest is that you duplicate this action and rename it and modify it to your liking.

 I actually highly recommend this, as all this work is really a base for you to expand, and really is one approach to development, that is mine, but not necessarily adapted to everyone, and so feel free to just duplicate and modify them.

The reset is not a must have, it's only needed if you are going to reuse this state over and over. But also, as I write, maybe the action is buggy in another place that is when the action has finished looping, maybe I should reset it as well. I'll double check.


Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [ECOSYSTEM] [NOVEMBER 2019]
« Reply #87 on: November 12, 2019, 02:36:57 AM »
Hi,

 New update for DataMaker packages, with updated PLayMaker utils and a new dll for json, for compatibility with mobile on latest Unity versions.

The last package featured json support by default, and it should not ( there is a dedicated version of DataMaker with json support for this), so simply delete the json folder inside the playmaker folder if you don't need it, saves some extra compilation time)

Bye,

 Jean

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: DataMaker Xml xPath and Json [ECOSYSTEM] [NOVEMBER 2019]
« Reply #88 on: July 28, 2020, 08:24:58 AM »
This comes from another Datamaker thread (the one with djayino's tutorials).
I was looking at this field and doing tests and wondering why no data appeared in it, since it was located in the 'result' area of the action. It left me puzzled because the description of what this field does is not clear.

Reference is stored in memory

That's what I thought but then I don't see the point of having this field since it's not filled with a string. It's confusing because you expect it to be filled with some string data but it remains empty.

You can either leave it as it is by default, or decide to use a string variable, but the FsmString var remains empty nonetheless too.

Well, I think I got a eureka moment. That string is used to actually give a name to the reference, so that name can be used in other actions.
Being in the result area of the action led me to think it would actually store some text generated by the action.

The description of that field is confusing:

Quote
The result of the xPathQuery stored in memory. More efficient if you want to process the result further

You then expect a result to actually be displayed in this field.
When it should be:

Quote
Name of the reference that will be used to point to the result of the xPathQuery stored in memory

It's not perfect but I find it more explicit, especially since the code does this:

Code: [Select]
DataMakerXmlUtils.XmlStoreNode(node,storeReference.Value);
And we can see that a node is stored, attached to that specific reference.

Could be reworded:

Quote
Name of the reference that corresponds to the resulting node found with the xPathQuery. This node is stored in memory and can be called with this reference in other actions

A bit more wordy but at least it clearly explains what is going on and what is to be expected.

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: DataMaker Xml xPath and Json [ECOSYSTEM] [NOVEMBER 2019]
« Reply #89 on: July 28, 2020, 08:31:09 AM »
I've had a bug in Xml Get Node Properties action while trying to use the Use Variable option for the Source selection enum. I got this:

Quote
ArgumentException: GUILayout: Mismatched LayoutGroup.repaint
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:311)
UnityEditor.EditorGUILayout.BeginHorizontal...

It's a long one, possibly made longer by the fact that I had already set up three properties to collect so there could have been a repeat.
The Graph view flickers, some areas remain gray, etc.