We have designed a very basic Workflow with the following activities:
1) The first activity is Manual and in diagram we have set the Approval State as "Publish_Stage", which means that the page with this component can only be published to Staging & not to Live.
2) The second activity is "Automatic" with Approval State as "Publish_Stage" and this assigns the task to group of Approver based on some business logic.
3) The third task is to either "Approve" the content or "Return to Editor" which ends the Workflow with the Approval Status as "Publish_Live" & "Publish_Stage" respectively.
The problem we are facing is that the component locked by the WF can still be published to Live, though we have the Minimal Approval Approval Status set "Publish_Live" which is somehow getting set automatically overriding the Approval Status I have set in Workflow Diagram i.e. "Publish_Stage"
I can explain it with the following scenario:
- Edit an existing/approved Component which has the Approval Status as “Publish_Live“, now check-in the component.
- The Workflow gets invoked on that component and a manual activity is assigned to the editor with the Approval Status as “Unapproved”.
- Now Editor open the activity and click “Finish Activity”, the Approval Status changes to “Publish_Live” instead of “Publish_Stage“ even though being explicitly set in Visio diagram.
- At this stage if someone try to publish the page to Live, it gets published successfully being component locked by the WF.
I have reached to the conclusion that Visio setting is overridden by the last Approval Status because I tried another scenario:
- Edit an approved Component which has the Approval Status as “Publish_Live“, now check-in the component.
- Open the Admin console and force finish the Workflow by setting the Approval Status to "Publish_Stage".
- The component is now saved & checked in with Approvals Status as “Publish_Stage”.
- Now edit the same component, and check-in after making changes, the component gets saved with status “Unapproved” and locked by the Workflow.
- Editor clicks on “Finish Activity”, and this time the Approval Status being printed in logs as “Publish_Stage” (i.e. the last state of the Component).
I have put the loggers to get the Approval Status on different events like:
EventSystem.Subscribe<Component, SaveEventArgs>(ComponentSaved, EventPhases.TransactionCommitted);
EventSystem.Subscribe<ActivityInstance, FinishActivityEventArgs>(FinishActivityCall, EventPhases.Initiated);
EventSystem.Subscribe<ActivityInstance, AssignActivityEventArgs>(AssignActivityCall, EventPhases.Initiated);
EventSystem.Subscribe<ActivityInstance, ReAssignActivityEventArgs>(ReAssignActivityCall, EventPhases.Initiated);
Can someone please provide some pointers what could be the reason for such strange behavior, because the Workflow diagram is not really complex and its very straight forward.
The SDL version is 2013SP1.
Thanks in advance.
Publish_Live
.Publish_Staging
status and not being published as you need. it's just the old/existing version that got published. --Also if you complete the workflow with final status asPublish_Staging
then the item should not be published to your Live target