Fire Workflow Launcher on Content Fragment save | Community
Skip to main content
mpalme1
Level 3
September 8, 2020
Solved

Fire Workflow Launcher on Content Fragment save

  • September 8, 2020
  • 1 reply
  • 3093 views

I'm trying to configure a workflow launcher to fire when a content fragment is saved and not before. Currently, my launcher is configured like this:

 

Event Type: Modified

Nodetype: dam:Asset

Path: /content/dam/mysite/us/en/content-fragments/insights(/.*)

Run Mode: Author

Conditions:

jcr:content/data/master/cq:tags!=

jcr:content/data/master/insight-title!=

jcr:content/data/cq:model==/conf/mysite/settings/dam/cfm/models/insight

Workflow: MyWorkflow

 

The conditions keep it from firing unless insight-title field is populated, there are cq:tags, and the model is of type "insight", but if those conditions are met, the launcher fires BEFORE the content fragment form is saved if any of the fields on it are touched. I know this because the WorkflowProcess implementation I've written fires the execute method as soon as the cursor leaves a field on the form after changing it and before saving.

 

I have been looking at the /jcr:content/data/master/fieldname@LastModified fields hoping to see these field changes recorded before save so I could write a condition to account for them, but they appear unchanged until save.

 

Is there a way to write a launcher which will fire on save of a content fragment instead of when a field is touched in the form but not yet saved?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijayalakshmi_S

Hi @mpalme1,

I am able to reproduce the scenario in my local with your launcher configuration. 

I tried changing the launcher config as below and it was triggering only upon save (and not when we move out of the field)

Event Type : Modified

Path : /content/dam/learnings/content-fragments/events(/.*/)jcr:content/data(/.*)

NodeType : nt:unstructured

Conditionsmaster/eventTitle!=covid

Please try and let know if it works for you. Screenshot below for reference

You can cross verify in Workflow Instances(Running) / Workflow Archive(completed) console based on the execution status of the workflow.

 

1 reply

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
September 9, 2020

Hi @mpalme1,

I am able to reproduce the scenario in my local with your launcher configuration. 

I tried changing the launcher config as below and it was triggering only upon save (and not when we move out of the field)

Event Type : Modified

Path : /content/dam/learnings/content-fragments/events(/.*/)jcr:content/data(/.*)

NodeType : nt:unstructured

Conditionsmaster/eventTitle!=covid

Please try and let know if it works for you. Screenshot below for reference

You can cross verify in Workflow Instances(Running) / Workflow Archive(completed) console based on the execution status of the workflow.

 

mpalme1
mpalme1Author
Level 3
September 9, 2020
Thanks, @vijayalakshmi_s. In my case, there are a variable number of folders between /content-fragments and /jcr:content/data. I'm not clear from any of the documentation I've looked at what syntax is supported for path conditions. Is this documented anywhere? Is it some limited form of regex?