Search code examples
tridiontridion-2011

How to send the activity back to author using coreservice?


I want to create a workflow automatic task (1. Send back to Author 2. Publish to Staging).

Can any one provided the code snippet to do this using SDL Tridion Core Service ?


Solution

  • I don't have a Core Service version, but here is one I wrote using VBScript and TOM which might get you started in the right direction

    Set objAIs = CurrentWorkItem.ActivityInstance.ProcessInstance.ActivityInstances
    Set objAI= objAIs (objAIs.Count - 1)
    strLastMessage= objAI.FinishMessage
    Set objAI= objAIs(1)
    uriFirstUser= objAI.Performer.ID
    Set objAI= Nothing
    Set objAIs = Nothing
    FinishActivity cstr(strLastMessage), "" , uriFirstUser
    

    Just paste that in the script box of your automated activity, and you should be good to go