Automic Workload Automation

Expand all | Collapse all

Automic Application Interface - Transfer an object from one client to another

  • 1.  Automic Application Interface - Transfer an object from one client to another

    Posted Mar 15, 2019 10:52 AM

    Hello,

     

    Currently I am trying to configure a script which moves an Object from one client to another with the Automic Application Interface - For example from DEV Client 2 to DEV Client 3.

     

    For now I tried with the following configuration:

     

    //In this case uc4Source is the connection to Client 2 and uc4Dest is connection to Client 3

     

    //Load and Open the object from the source
    UC4ObjectName jobObjectNameSource = new UC4ObjectName(jobNameString);
    OpenObject jobOpenSource = new OpenObject(jobObjectNameSource);
    uc4Source.Send(jobOpenSource);

     

    //Assign the Source object
    UC4Object objectSource = (UC4Object) jobOpenSource.getUC4Object();

     

    //Create the object on the dest
    UC4ObjectName newObjectDest = new UC4ObjectName(jobNameString);
    CreateObject createNewObjectDest = new CreateObject(newObjectDest, Template.JOBP, folderTree.root());
    uc4Dest.Send(createNewObjectDest);

     

    //Open the new object from the dest

    OpenObject openObjectDest = new OpenObject(newObjectDest);
    uc4Dest.Send(openObjectDest);

     

    //Assign the Dest Object

    UC4Object objectDest = (UC4Object) openObjectDest.getUC4Object(); 

     

    //Save the object to client 305(Probably very stupid idea but this is the only thing that came to my mind)

    objectSource = objectDest;
    SaveObject saveObjectDest = new SaveObject(objectDest);
    uc4Dest.Send(saveObjectDest);

     

    With that setup the exception I get is "Exception in thread "main" java.lang.RuntimeException: '': Access denied" on the line where uc4Dest.Send(saveObjectDest); is placed. 

     

    When I comment this line(from the stupid idea) objectSource = objectDest; the script completes successfully but the new object on Client 3 is empty which is an expected behaviour but not the desired one.

     

    Additionally I saw that there are the following methods in the UC4Object() class -  load(com.uc4.util.XMLDocument doc, ConnectionAttributes session) and  store(com.uc4.util.XMLDocument doc, org.w3c.dom.Element request, ConnectionAttributes sessionInfo, boolean override) which I am willing to use but there is no information or examples how half of the values are used - again for example there is no constructor for com.uc4.util.XMLDocument and I cannot find any Documentation for the classes from uc4.

     

    I will be very happy If someone can provide additional information or solution to my problem.

    Thank you for the time! 

     

    Best Regards,

    Kaloyan Yanev



  • 2.  Re: Automic Application Interface - Transfer an object from one client to another

    Posted Mar 21, 2019 11:19 AM

    why not use the ExportObject/ImportObject classes to move from one client to another...