cancel
Showing results for 
Search instead for 
Did you mean: 

Executing System Tasks using Unity API

Anthony_Boyd
Star Collaborator
Star Collaborator

Hi, 

Is there a way to execute a system task from within the Unity API?  I could not find anything in the SDK related to Systems Tasks.

Thanks
Anthony 

9 REPLIES 9

Daniel_Quill
Elite Collaborator
Elite Collaborator

Anthony,

You will need to look under the Hyland.Unity.Workflow namespace.  There you will find the TaskList.Execute().

Regards,

 

Anthony_Boyd
Star Collaborator
Star Collaborator

Hi Daniel,

I did see that but the TaskList.Execute method requires a queue and document object and a system task can be execute on a document that may not be in any workflow queues so there wouldn't be a queue object to use.

Thanks

Anthony

Daniel_Quill
Elite Collaborator
Elite Collaborator

Anthony,

Sorry about that. I was thinking of an Ad-hoc task which can be executed.  However, we don't have any methods to execute a system task.

Regards,

Marcus_Santodon
Confirmed Champ
Confirmed Champ

I'm not sure if a method to execute a system task has been added to the API since this post, but I also ran into the need to do this.  In my case, I needed a way to programmatically create chart objects for chartless documents that would never get resolved because they will never receive the HL7 data to create a chart object for them.

As a workaround, I wrote a Unity script that (1). queries the database for the documents I wish to process and (2) adds them to a lifecycle that performs the work I need done (sends an ADT A01 mesage to the localhost for each document). 

To provide a way to execute the script in the GUI, I created a dummy document type called "Workflow Script Trigger” and also a dummy lifecycle that does nothing but run the script.  Then, I created a dummy system task for the dummy document that adds it to the dummy lifecycle.  When I need to run the process, I just open the document and click the dummy system task.

I am not sure if there is a more elegant way to handle this but it meets my needs.