Table of Contents |
---|
minLevel | 1 |
---|
maxLevel | 6 |
---|
outline | false |
---|
type | flat |
---|
separator | pipe |
---|
printable | true |
---|
|
Overview
Excerpt |
---|
Triggering events when attachments are created, updated, or removed. |
In the following examples, we show how to trigger a state transition when users add, update, or remove attachments to a page or blog post in a specific workflow state.
Attachment created
If the workflow is in the "Approved" state, adding an attachment will trigger triggers a transition to the "In Progress" state.
Code Block |
---|
|
{workflow:name=Attachment added}
{state:In Progress}
{state}
{state:Approved}
{state}
{trigger:attachmentadded|state=Approved}
{set-state:In Progress}
{trigger}
{workflow} |
Attachment updated
If the workflow is in the "Approved" state, updating an attachment (uploading a new version of an existing attachment) will trigger triggers a transition to the "In Progress " state.
Code Block |
---|
|
{workflow:name=Attachment updated}
{state:In Progress}
{state}
{state:Approved}
{state}
{trigger:attachmentupdated|state=Approved}
{set-state:In Progress}
{trigger}
{workflow} |
Attachment removed
If the workflow is in the "Approved" state, deleting an attachment will trigger triggers a transition to the "In Progress" state.
Code Block |
---|
|
{workflow:name=Attachment added}
{state:In Progress}
{state}
{state:Approved}
{state}
{trigger:attachmentremoved|state=Approved}
{set-state:In Progress}
{trigger}
{workflow} |
Attachment version removed
If the workflow is in the "Approved" state, deleting an attachment version will trigger triggers a transition to the "In Progress" state.
Code Block |
---|
|
{workflow:name=Attachment added}
{state:In Progress}
{state}
{state:Approved}
{state}
{trigger:attachmentversionremoved|state=Approved}
{set-state:In Progress}
{trigger}
{workflow} |
All of the above
If you want to transition on any of the events listed above, you can use the attachmentschanged
attachmentschanged
(note the 's') event, like so:
Code Block |
---|
|
{workflow:name=Any attachment event}
{state:In Progress}
{state}
{state:Approved}
{state}
{trigger:attachmentschanged|state=Approved} {set-message:duration=PT1M}
Attachment added, edited or deleted:
|| File | @filename@ |
|| Size | @size@ bytes |
|| Comment | @comment@ |
{set-message}
{set-state:In Progress}
{trigger}
{workflow} |
We've included a message to provide some details about the attachment; the details are derived from Event event references, which are available in at all attachment-related events. Here's an example output:
Image Removed
...