AnsweredAssumed Answered

How to use JavaAPI to replace task in workflow without searching

Question asked by MikeBurnham603785 on Feb 7, 2018
Latest reply on Feb 23, 2018 by Antoine_Sauteron_1266
I'm trying to rename all jobs in an automation (simple substring replacement) via the JavaAPI, and update the references to each job in the workflow as well. The way I've found to do this is by sending a RenameObject for each job with the setRenameIfUsed flag turned off, then sending a GetReplaceList if a use is found, and finally sending a ReplaceObject with that list.

That approach works, but takes about 30 seconds per object to run. I know ahead of time (because of our naming conventions) that the usage of each object will be only in the JOBP also included in the set of objects to rename, so what I would like to do is rename each job without checking for use (fast) and then update the names referenced in the JOBP directly.

Does anybody know if that is possible? I see a JobPlan.ReplaceTask(), but I'd need to create a new task to pass in there and I'd like to simply update the name. 

Outcomes