updating dimensions hierarchies from JYTHON

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • updating dimensions hierarchies from JYTHON

      I have suffered a bit yesterday to get my program works when updating hierarchies. With the JAVA API as with the .NET API you must update arrays of Consolidations for the parent element. The initial array you get is wrapped by JYTHON in a pyarray structure which is not a list and cannot be extended using the .append list function. You must create a larger array (type: org.palo.api.Consolidation) with Jarray.zeros and copy the initial array's elements into the new array, adding next a new Consolidation at the end of the array. I wonder if there is not a simpler way of updating hierarchies, as with EXCEL or PHP APIs ?If this is the only way to do it, could not it be integrated in a method of the JAVA API ? Perhaps one can use the ElementNodes, but only the internal methods seem useful to do the trick ... (but I have not yet well understood that part of the API...)
    • RE: updating dimensions hierarchies from JYTHON

      Hi,

      i guess you are looking for a utility method that just adds a consolidation ...

      Sorry, but that is not provided in jpalo right now ...

      you could help yourself out with the following code ...


      Source Code

      1. void addConsolidationToElement(Element element, Consolidation consolidation)
      2. {
      3. ArrayList tmp = new ArrayList(Arrays.asList(element.getConsolidations()));
      4. tmp.add(consolidation);
      5. element.updateConsolidations(
      6. (Consolidation[]) tmp.toArray(new Consolidation[tmp.size]));
      7. }


      This utility method would provide the functionality to add a single consolidation.

      Hope this helps,
      Stepan
    • Hi,

      i believe even adding a few 10000 consolidations should be ok. I haven't tested such high-load consolidations. But chances are good that other parts of the system show performance problems before updateConsolidation() does.

      I will get back to you on this issue. I am not yet convinced that the java API is a bottleneck here.

      Thanks,
      Stepan
      Stepan Rutz, Tensegrity-Software