2

I've read the question/answer of how to start bundle workflow by event system and I've leveraged the stuff here to create bundle and add items via core service. But, I can't quite figure out how to start workflow on a bundle. I see the StartWorkflow method in ICoreService2012. but that doesn't accept a bundle. That expects the ID of a repository and StartWorkflowInstructionData. Am I able to use StartWorkflowInstructionData to specify the bundle to start the workflow?

  • yes Frank. thanks for the link... was in a rush to get it posted and should have taken the time to be more thorough. – Warner Soditus Sep 4 '14 at 16:32
3

Try this:

 StartWorkflowInstructionData startWorkflowInstruction = new StartWorkflowInstructionData();
 startWorkflowInstruction.Assignee = new LinkToTrusteeData { IdRef = client.GetCurrentUser().Id };
 startWorkflowInstruction.ActivityTitle = "A title for the activity";
 startWorkflowInstruction.ProcessInstanceTitle = "A title for the process instance";
 startWorkflowInstruction.Subjects = new[] { new LinkToIdentifiableObjectData { IdRef = bundle.Id } };
 client.StartWorkflow("THE_URI_OF_PUBLICATION", startWorkflowInstruction, new ReadOptions());

Basically the StartWorkflowInstructionData has an array of Subjects, you just add your bundle to that collection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.