Removing workflow from multiple assets via a trigger


(Innes Zenati) #1

Matrix Version: v5.4.1.3

Hi there, looking for some help when trying to remove some old workflow from multiple assets (standard pages) under 1 folder. I have created a trigger and added the following within the trigger:

Events

Status changed

Conditions

Asset is of type *
Match any one of these types:
Page

Asset status *
Asset has the current status of: Under construction

Actions

Pointing to correct workflow schema to be removed & to cascade the removal to all children

I then start a batch trigger pointing to the parent folder, it runs through all the child assets but itā€™s not removing the workflow. Have I got something wrong in the conditions etc.?

Cheers
Innes


(Bart Banda) #2

Have you got ā€œinheritā€ enabled on the Page type for the Asset if of type condition?

Besides, you could also try and add the workflow schema to the parent, then remove it again which should remove it from any children as well, all without using a trigger.


(Innes Zenati) #3

Hi Bart thanks for taking the time to reply.

No I didnt so I added inherit but Iā€™m still getting error messages, see image.

I did try this originally but it didnt work, this is how we removed old permissions and metadata schemas and it worked perfectly when we cloned down the pages to our new beta site. We are currently building a new site hence the reason why Iā€™m cloning assets down (in this case its the news pages so there is quite a lot of assets to remove workflow from).

No sure if the error message gives you any indication of what iā€™m doing wrong.

Thanks
Innes


(Bart Banda) #4

Hmmm, looks like you donā€™t have admin access over those pages? Can you confirm you do?
If you do, can you check if you can manually remove the workflow schema of those assets that itā€™s failing on to see if the manual approach at least works?


(Innes Zenati) #5

Hi Bart, sorry been on a weekā€™s leave. Yeah I have admin permissions so should be able to do this. Yes I am able to remove the workflow manually.

I have raised a support ticket for the cascade function not working when adding the workflow to the parent folder and cascading the removal to all children. This might be a bug so Iā€™ll see what they say and post up.


(Bart Banda) #6

Ok no worries, let us know how it goes.


(Innes Zenati) #7

Finally got the trigger working! Changed the condition to add a ā€˜tree locationā€™ and has finally removed all the workflow from over 80 assets in one fell swoop so a very useful trigger to have which will save alot of time. I will post a picture up in case anyone else needs this in future.

Still waiting to hear back if there is a bug for the deletion of workflow and trying to cascade the deletion to all children, at the minute this doesnt work for workflow but does for permissions and metadata schemas.

Thanks
Innes