cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow

Carlos_Guerra
Champ in-the-making
Champ in-the-making

Hi, 

Could I trigger a Workflow using Unity Api?

Regards,

Carlos

4 REPLIES 4

Jonathan_Thorn2
Confirmed Champ
Confirmed Champ

Yes, either create an instance of a document/eform that is subscribed to the desired WF or inject into the WF yourself:

Workflow wf = unityapp.Workflow;LifeCycle lc = wf.LifeCycles.Find("My Lifecycle");wf.AddDocumentToLifeCycle(myDoc, lc);

Carlos_Guerra
Champ in-the-making
Champ in-the-making

Thanks   

Carlos_Guerra
Champ in-the-making
Champ in-the-making

Thanks Smile

Rob_Herman
Star Contributor
Star Contributor

Thank you, Jonathan!

In addition to the AddDocumentToLifeCycle() function, the Unity API provides several other methods to add objects to Workflow. One important difference is that  unlike AddDocumentToLifeCycle(), they support WorkView items or managed folders when Unity Lifecycles are configured for those objects.

  • Workflow.AddToWorkflow() takes a Document, managed Folder, or WorkView object, and doesn't require you to specify a Lifecycle.
  • Workflow.AddToLifeCycle() takes any of those objects, and also provides an overload for adding to a specific Queue.

--|Rob