Updating a Task based on an export from another Task

Primary tabs

Hi all,

We are working on getting a number of non-code based configurations and settings in fully automated deployments, and I was wondering if anyone had any ideas on how to "update" a task that already exists.

What's in our repository is a separate file for each task in the standard .xml format for:
##class(%SYS.Task).ExportTasks($lb(tTaskID),"c:\TasksExport\"_tTaskName_".xml")

The problem is, the ImportTasks method doesn't update or overwrite if the task name already exists, and there's no DeleteTask method.

We could of course, delete the task by querying %SYS.Task, finding the OID based on the name of the task, then import it.  I was also considering using a file reader of some kind and correlating the xml elements to properties of the %SYS.Task object, but it gets a little hairy. 

Does anyone have any other thoughts on how I could tackle this?

 

Thanks!

Craig

Replies

Work with %SYS.Task objects.

Here's an example of creating a task but you can open an existing task too and modify it.

Thank you Eduard, this will definitely work for simple tasks as in the example, but I don't think we can account for existing tasks, especially ones with custom parameters.  I believe we're going to have to delete and import them.