Archive an asset using a workflow

a-vennerstrom's Avatar

a-vennerstrom

11 Dec, 2014 05:05 PM

I'm attempting to archive an asset using a workflow and it won't work. When I select an end date and submit it by bypassing the workflow, the asset archives correctly and unpublishes. However, my web authors don't have the option to bypass the workflow and I need them to be able to archive their pages.

I've created a simple workflow with the following xml. This is the 2nd workflow I've tried and neither have worked.

<system-workflow-definition name="Archive Job Posting" initial-step="initialize" >
    <triggers>
        <trigger name="com.cms.workflow.function.AssignStepIfUser" class="com.cms.workflow.function.AssignStepIfUser" />
        <trigger name="com.cms.workflow.function.AssignToGroupOwningAsset" class="com.cms.workflow.function.AssignToGroupOwningAsset" />
        <trigger name="com.cms.workflow.function.AssignToSpecifiedGroup" class="com.cms.workflow.function.AssignToSpecifiedGroup" />
        <trigger name="com.cms.workflow.function.AssignToWorkflowOwner" class="com.cms.workflow.function.AssignToWorkflowOwner" />
        <trigger name="com.cms.workflow.function.CopyFolder" class="com.cms.workflow.function.CopyFolder" />
        <trigger name="com.cms.workflow.function.CreateNewWorkflowsTrigger" class="com.cms.workflow.function.CreateNewWorkflowsTrigger" />
        <trigger name="com.cms.workflow.function.Delete" class="com.cms.workflow.function.Delete" />
        <trigger name="com.cms.workflow.function.DeleteAndUnpublish" class="com.cms.workflow.function.DeleteAndUnpublish" />
        <trigger name="com.cms.workflow.function.DeleteParentFolderTrigger" class="com.cms.workflow.function.DeleteParentFolderTrigger" />
        <trigger name="com.cms.workflow.function.EmailProvider" class="com.cms.workflow.function.EmailProvider" />
        <trigger name="com.cms.workflow.function.Merge" class="com.cms.workflow.function.Merge" />
        <trigger name="com.cms.workflow.function.PreserveCurrentUser" class="com.cms.workflow.function.PreserveCurrentUser" />
        <trigger name="com.cms.workflow.function.PublishContainingPublishSetTrigger" class="com.cms.workflow.function.PublishContainingPublishSetTrigger" />
        <trigger name="com.cms.workflow.function.PublishParentFolderTrigger" class="com.cms.workflow.function.PublishParentFolderTrigger" />
        <trigger name="com.cms.workflow.function.PublishSetTrigger" class="com.cms.workflow.function.PublishSetTrigger" />
        <trigger name="com.cms.workflow.function.Publisher" class="com.cms.workflow.function.Publisher" />
        <trigger name="com.cms.workflow.function.Version" class="com.cms.workflow.function.Version" />
    </triggers>
    <steps>
        <step type="system" identifier="initialize" label="Start workflow" >
            <actions>
                <action identifier="initialize" label="Start workflow" move="forward" />
            </actions>
        </step>
        <step type="system" identifier="archive" label="Archive" >
            <actions>
                <action identifier="archive" label="Archive" move="forward" >
                    <trigger name="com.cms.workflow.function.Merge" />
                </action>
            </actions>
        </step>
        <step type="system" identifier="finish" label="Finished" />
    </steps>
    <non-ordered-steps/>
</system-workflow-definition>
  1. Support Staff 1 Posted by Tim on 12 Dec, 2014 02:08 PM

    Tim's Avatar

    Hi,

    If this is an 'edit' Workflow, I believe you may be able to change your 'archive' step from:

    <step type="system" identifier="archive" label="Archive" >
                <actions>
                    <action identifier="archive" label="Archive" move="forward" >
                        <trigger name="com.cms.workflow.function.Merge" />
                    </action>
                </actions>
            </step>
    
    to this:
    <step type="system" identifier="archive" label="Archive" >
        <actions>
            <action identifier="archive" label="Archive" move="forward" >
                <trigger name="publish">
                    <parameter>
                        <name>unpublish</name>
                        <value>true</value>
                    </parameter>
                    <parameter>
                        <name>authorizing-type</name>
                        <value>system</value>
                    </parameter>
                </trigger>
                <trigger name="com.cms.workflow.function.Merge" />
            </action>
        </actions>
    </step>
    
    Want to give that a shot and let me know if it works as you're expecting?

    Thanks

  2. 2 Posted by a-vennerstrom on 12 Dec, 2014 02:33 PM

    a-vennerstrom's Avatar

    hm... I copied what you gave me and ran it through the workflow and still nothing happened. It didn't unpublish or move to the archive folder.

  3. Support Staff 3 Posted by Tim on 12 Dec, 2014 02:36 PM

    Tim's Avatar

    OK, I'll look into this some more when I have the chance and I'll update you once I have more information. Thanks!

  4. 4 Posted by a-vennerstrom on 12 Dec, 2014 02:43 PM

    a-vennerstrom's Avatar

    I did a little looking around and I'm wondering if your publish trigger name was wrong.

    I changed it to this and it actually did something this time! It unpublished my page, however, it didn't archive it for me. Any thoughts on why that would be or how to get it to archive instead of just unpublishing?

    <step type="system" identifier="archive" label="Archive" >
                <actions>
                    <action identifier="archive" label="Archive" move="forward" >
                        <trigger name="com.cms.workflow.function.Merge" />
                        <trigger name="com.cms.workflow.function.Publisher" >
                            <parameter>
                                <name>unpublish</name>
                                <value>true</value>
                            </parameter>
                            <parameter>
                                <name>authorizing-type</name>
                                <value>system</value>
                            </parameter>
                        </trigger>
                    </action>
                </actions>
            </step>

  5. Support Staff 5 Posted by Tim on 12 Dec, 2014 02:55 PM

    Tim's Avatar

    I did a little looking around and I'm wondering if your publish trigger name was wrong.

    Yep! I just noticed that as I was posting this followup. Good catch! I had it matching the triggers I had in my local instance, but forgot to check how you were referring to those triggers in your Workflow.

    It unpublished my page, however, it didn't archive it for me. Any thoughts on why that would be or how to get it to archive instead of just unpublishing?

    This behavior sounded a bit familiar to me and I was able to locate this bug which was just discovered recently. This appears to be related to the problem you're seeing. I don't have an ETA for when this will be fixed, but given that multiple people have run into this I'm going to raise the priority on it.

    Keep an eye on our Release Notes for any new versions we make available to see when this issue is addressed.

    In the meantime, unfortunately I can't think of any way to get this functioning while still using Workflow. I apologize for the inconvenience.

    Let me know if you have any questions.

    Thanks

  6. 6 Posted by a-vennerstrom on 15 Dec, 2014 08:06 PM

    a-vennerstrom's Avatar

    Is there a parameter we can add to the workflow that will uncheck the 'include when publishing' and 'include when indexing' boxes so the pages don't accidentally get published again?

  7. Support Staff 7 Posted by Tim on 05 Jan, 2015 04:05 PM

    Tim's Avatar

    Unfortunately there isn't any way to interact with those options via a Workflow. I bumped the underlying issue in priority again and we'll look to implement the fix in the near future. I'm sorry for the trouble in the meantime!

  8. Tim closed this discussion on 20 Apr, 2015 12:20 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac