|
public abstract class ContentActivity : Event { |
A common requirement we see in our applications is to have something happen when a new item (of a specific type) has finished its first update. We had to hack this together several times, and I was thinking to add a workflow event (with corresponding activity) for that condition.
The idea would in the WorkflowContentHandler, to memorize OnCreated the ids of the ContentItems we are creating. If in the OnUpdated we have one of those ids, then we fire the new ContentFirstUpdated event.
It shares a possible issue with the existing ContentUpdated: the ContentItem in the context may not actually have that version be created, in case some validation step fails.
Orchard/src/Orchard.Web/Modules/Orchard.Workflows/Handlers/WorkflowContentHandler.cs
Line 41 in 6e410a3
Orchard/src/Orchard.Web/Modules/Orchard.Workflows/Activities/ContentActivity.cs
Line 9 in 6e410a3
A common requirement we see in our applications is to have something happen when a new item (of a specific type) has finished its first update. We had to hack this together several times, and I was thinking to add a workflow event (with corresponding activity) for that condition.
The idea would in the WorkflowContentHandler, to memorize
OnCreatedthe ids of the ContentItems we are creating. If in theOnUpdatedwe have one of those ids, then we fire the newContentFirstUpdatedevent.It shares a possible issue with the existing
ContentUpdated: the ContentItem in the context may not actually have that version be created, in case some validation step fails.