How do you start a workflow on a bundle in the Event System in Tridion 2013 SP1?
Which DLL's do I need to refer to do so?
I have created a bundle ("tcm:26-135-8192") in Tridion and I have associated a Bundle Schema with it which has a workflow.
Bundle bundle = (Bundle)item.Session.GetObject("tcm:26-135-8192");
bundle.AddItem(item);
bundle.Save();
StartWorkflowInstruction instruction = new StartWorkflowInstruction(item.Session);
instruction.Subjects.Add(bundle);
ProcessInstance result = bundle.ContextRepository.StartWorkflow(instruction);
My requirement is to add items to this bundle through event system and start the workflow on this. But i am getting a Error on bundle.Save();
which says "Item is shared".
Any suggestions?
This is what I am getting in Event Viewer . I have created this Bundle in publication 18 and I am trying to add one item in publication 26. Should i be creating this bundle in piublication 18 as well.
The item is shared.
Component: Tridion.ContentManager Errorcode: 0 User: NT AUTHORITY\NETWORK SERVICE
StackTrace Information Details: at Tridion.ContentManager.ContentManagement.RepositoryLocalObject.OnSaving(SaveEventArgs eventArgs) at Tridion.ContentManager.ContentManagement.OrganizationalItem.OnSaving(SaveEventArgs eventArgs) at Tridion.ContentManager.ContentManagement.VirtualFolder.OnSaving(SaveEventArgs eventArgs) at Tridion.ContentManager.ContentManagement.Bundle.OnSaving(SaveEventArgs eventArgs) at Tridion.ContentManager.IdentifiableObject.Save(SaveEventArgs eventArgs) at Tridion.ContentManager.IdentifiableObject.Save() at Tridion.ContentManager.ContentManagement.VirtualFolder.Save() at MetLife.ADD.Tridion.Eventing.PageUnPublishWorkFlow.AddItemToUnPublishBundle(RepositoryLocalObject item) at MetLife.ADD.Tridion.Eventing.PageUnPublishWorkFlow.PageUnPublishWorkFlowChange(Page subject, UnPublishEventArgs args, EventPhases phase) at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Delegate.DynamicInvokeImpl(Object[] args) at Tridion.ContentManager.Extensibility.EventSubscription.b__0(AsynchronousEventWorkItem workItem) at Tridion.ContentManager.StaThreadPool`1.StaThread.DoWork()