Automic Workload Automation

  • 1.  Modify Structured Documentation of an object using Java API

    Posted Aug 30, 2016 10:18 AM
    There are two classes which you can use to modify the Structured Documentation and add/modify attributes of the child nodes.

    class XMLDocuNode:
    provides method setAttribute with which you can add only Text attributes

    class XMLDocumentation:
    provides method modifyAttributeDTD with which you can also add enumeration values and a default value

    Example:
    xdoc.modifyAttributeDTD("Content", "enumAtt", new String[] { "Option1", "Option2", "Option3"  }, "Option1");



  • 2.  Modify Structured Documentation of an object using Java API

    Posted Aug 31, 2016 02:12 AM
    Great ! Thanks !


  • 3.  Modify Structured Documentation of an object using Java API

    Posted Jun 07, 2017 04:46 AM
    Hallo,

    ich habe ein Problem mit dem Anlegen eines neuen XMLDocuNode.

    Wenn ich folgendes ausführe :
    XMLDocuNode node = new XMLDocuNode("JOBPARMS");   
    node.setAttribute("JOBPARMS.001", "JU");

    Bekomme ich eine NullPointerException:
    Exception in thread "main" java.lang.NullPointerException
        at com.uc4.api.objects.XMLDocuNode.setAttribute(XMLDocuNode.java:108)
        at de.gothaer.objectupdater.util.XMLDokuUpdater.<init>(XMLDokuUpdater.java:43)
        at de.gothaer.objectupdater.util.StartXMLDokuUpdater.main(StartXMLDokuUpdater.java:49)

    Die andere Möglichkeit mit modifyAttributeDTD weitere Attribute hinzuzufügen funktioniert zwar, ist aber
    auf den root-Knoten und Pulldowns beschränkt.

    Kann mir jemand meinen Fehler erklären?

    Gruß Norbert



  • 4.  Modify Structured Documentation of an object using Java API

    Posted Jun 07, 2017 08:27 AM
    Kaum gibt man auf, kommt man auf die Lösung  :| 


  • 5.  Modify Structured Documentation of an object using Java API

    Posted Jun 07, 2017 09:49 AM
    Darf ich fragen was die Lösung war? 


  • 6.  Modify Structured Documentation of an object using Java API

    Posted Jun 07, 2017 04:36 PM
    Klar! Man muss den neuen Node erst zum root-Node hinzufügen, damit man ein Attribute setzen kann:

    XMLDocuNode node = new XMLDocuNode("JOBPARMS");   
    j1.docu().xmlDocumentation("Jobattr").root().addChildNode(node);
    node.setAttribute("JOBPARMS.001", "JU");   

    Wenn man einen vorhandenen Nodeserweitern möchte:

    Iterator it = j1.docu().xmlDocumentation("Jobattr").root().iterator();
            while (it.hasNext()){
                XMLDocuNode node = (XMLDocuNode) it.next();
                if (node.getNodeName().equalsIgnoreCase("JOBPARMS")){
                    node.setAttribute("JOBPARMS.002", "BB");           
                }
            }

    Ich finde die Möglichkeiten sind nicht wirklich ausgereift. Liegt wahrscheinlich daran, dass nicht viele Kunden das so nutzen.





  • 7.  Modify Structured Documentation of an object using Java API

    Posted Jun 08, 2017 04:00 AM
    Danke für das Code Snippet! 
    Ja es ist nicht ganz logisch dass man die Node zuerst hinzufügen muss, gut zu wissen!


  • 8.  Modify Structured Documentation of an object using Java API

    Posted Jun 12, 2017 06:24 AM
    Hallo Norbert!

    Vielen Dank für Deine Lösung. Von alleine wäre ich nicht darauf gekommen. Aber wenn man darüber nachdenkt, ist es eigentlich logisch.

    Ein Hinweis zur Verwendung der Funktionen setAttribute() und setValue() wäre jedenfalls sinnvoll.

    //Carsten