playMaker

Author Topic: Datamaker, Xml select nodes bug?[SOLVED]  (Read 1937 times)

puddlepouncer

  • Playmaker Newbie
  • *
  • Posts: 18
Datamaker, Xml select nodes bug?[SOLVED]
« on: May 06, 2018, 01:25:33 PM »
Hi,

I have have encountered what might be a bug with datamaker and the "Xml select nodes" action (or I have made something wrong on my end :) )

I fetch data from a database and convert the json response to xml and fill the data in an xml proxy. Then I loop through the data and fill a hashtable. It works fine and dandy on the first go but when I do it a second time with new data the properties won't update in the XML get next node list properties. I end up with the initial result in the hashtable instead of a new one.

The xml-proxy gets updated so it seems to stem from "store reference" defined in the "Xml select nodes" action but i'm not sure. Maybe it won't get updated with new node data?

The way I use it is I just type a arbitrary name in store reference and use that name in the "Node list reference" in "Xml get next node list properties" action. Using a variable for store refrence doesn't seem to work.

Any idea what the problem might be?


best regards

Fredrik



« Last Edit: May 11, 2018, 02:00:20 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Datamaker, Xml select nodes bug?
« Reply #1 on: May 07, 2018, 04:30:53 AM »
Hi,

 it's your looping that needs to be reseted.

 create a bool variable, and set it to true one state before you loop, in your looping state, the getnext action as a reset variable, reference your bool, it will then understand it and if true loop from the start, and set that bool variable to false.

 Bye,

 Jean

puddlepouncer

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Datamaker, Xml select nodes bug?
« Reply #2 on: May 07, 2018, 02:15:53 PM »
Thanks though if I set the bool to true it just skips looping altogether. Setting it to false makes it loop but with the same behavior as described originally. Feeling stupid/confused :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Datamaker, Xml select nodes bug?
« Reply #3 on: May 09, 2018, 04:02:46 AM »
Hi,

 you need to only set it once to true and then enter your looping state where you have the getnextxxx, and you might not set the index value back to 0 neither.

check out the meface sample on the ecosystem, it makes uses of this action and design pattern.






Let me know if you still struggle.

 Bye,

 Jean

puddlepouncer

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Datamaker, Xml select nodes bug?
« Reply #4 on: May 10, 2018, 08:18:44 AM »
Thanks, you the man!

Setting the index value to 0 before looping solved the problem.