0
votes

I am trying to link 2 workflows together:

Item is created/edited in workflow "A". When that item is submitted it goes to workflow "B" for approval. Once it is approved it goes into approved state in workflow "B".

What I want is for the item to go back into workflow "A" after it is approved by workflow "B". Is this possible? if so how?

(using sitecore 7.2)

2
Does your workflow B automatically publish the item? Do you want to publish and then create a new draft in workflow A? Do you want not publish the item and move it to state Y in workflow A? - Marek Musielak
Workflow B will publish the item. Yes, want a new draft to be created in workflow A once it has been approved and published. - harnamc

2 Answers

3
votes

It sounds like a custom Workflow Action will do the trick. Assuming that your item has Workflow A configured as the Default Workflow on the template's standard values, all this workflow action would need to do is add a new version. The new version will be automatically placed into Draft state in Workflow A.

public class AddVersionWorkflowAction
{
    public void Process(WorkflowPipelineArgs args)
    {
        // TODO: check for nulls, assertions, etc.

        args.DataItem.Versions.AddVersion();
    }
}
0
votes

You will not need to implement a custom workflow action. You can define a "next state" on the workflow command item that does belong to a different workflow. Just tested and it works.