This project is read-only.

Orchard 1.7 Workflow feature team

Topics: Announcements
Nov 6, 2012 at 9:03 PM

This thread is to discuss a possible new workflow feature for Orchard 1.7.

The feature would enable site administrators to define workflows that define states for content items and the transitions between those states.

Nov 6, 2012 at 10:26 PM
Edited Nov 10, 2012 at 12:49 AM

To have an idea of what could be done, please watch this video on how Drupal handles it:

Doing the exact same thing as in this video would be very simple, yet powerful. We could leverage Rules Module to implement custom actions.

There is another module in Drupal which is more advanced and provide better reporting for workflows:

Here is some quick facts about my vision for this module.

1- Be able to define States
2- Published is the last state of all, kind of a mandatory state in the loop
3- Show a button for each possible transition for the current State and current User. So if a user can go directly to Published state, it should always show the Publish button in the editor. If the next state is Review, then a corresponding button should be created.
3- If no next step is allowed, just the Save button is shown, to update the content item and keep the current state.
4- Should also let users define a Comment text when changing states., optionally.
5- For each states transition, a permission could be created. The other solution is not to leverage permissions for this, but handle it as part of the module's logic. This would not create noise in the Permissions view.
6- We need a way to filter content items by current state, for instance to provide a nice actions dashboard to users
7- Emails can be sent automatically to recipients using the Rules module.
8- Workflows can be assigned to Content Types or to Roles. The scenarios are "we want all our News to be reviewed by the CEO before going online", and "we want the CEO to review everything that the Marketing Role users are producing"
9- UI steps would be:
- Create a named Workflow
- Add/Remove named States
- Edit transitions between each state to: Enable/Disable, define and transition name (for the buttons in the Editor), define who can trigger this transition
10- New, Published and Deleted are hard coded states with predefined behavior when they are reached.

Please agree/disagree on those suggestions

Nov 6, 2012 at 11:50 PM

I agree with everything. One thing I'm wondering about, but this is low-pri, is a graphical representation of the workflow. The Drupal module is a little hard to read.

Also, do we want to integrate media into the story?

Nov 7, 2012 at 8:27 AM
Edited Nov 7, 2012 at 11:12 PM


I have been looking Drupal demo and am not satisfied with this kind of workflow. It looks like the first database workflows used in Rainbow 1.0 using triggers in the modules'stored procs....

I am an MS CRM user and especially appreciate its powerful workflow, based on WWF since v 4.0 and even better in v2011, here is some demo from youtube,( the easiest way is to open a test CRM Online and have a free try)

Essentially, the idea is to have workflow being able to:

- be fired on an event : creation of some object, update (even on part of objects) , delete, status update (having a status for each content/part would be great....), some calendar date/time, something occuring on the web site (reach a limit in connection, in DB size, special user connecting, etc.)

- or to be fired manually using a special selector list

- be composed of ,several steps, each step using rules on content, global values, result of previous rules,

- being able to do actions, not limited to approve or publish, but send, create content/part, wait some external event (date, status change, etc.), fire another 'sub-workflow', etc.

This also necessitates a workflow monitor from which we could stop/start/pause/delete..

MS CRM Entities could be compared to Orchard Content, Orchard owns a dedicated feature with Parts and manages fields in a far better way than CRM, this is ideal for a WF engine with triggers attached to event occurring on these objects.

The technical difficulty seems to be related to the WWF integration and may limit the engine to Windows/Azure environments.


May be I am out of scope ?


Nov 8, 2012 at 7:06 PM

@csadnt: MS CRM workflows can be compared to Orchard Rules. What is demonstrated in this videos can be done already, even though the UI is less advanced. Please take a look at it.

Here what we call a workflow is just set of states. And those states can trigger events, that you can intercept to create actions.

@bertrand: yes, we could also have a graphical representation of a workflow ... display only or edit ? Do you have some examples in mind ?

Nov 8, 2012 at 9:06 PM
Edited Nov 8, 2012 at 9:09 PM

@sebastien the mass of code inside Orchard is 'planetary' and my brain is full of years working with plain without last c#extensions so I am slow in discovering all this....
Are you saying that Orchard is using Windows Workflow Foundation and all theses powerful asynch features as is doing CRM ? I don't think so, does it?

I will dig into the code about rules.

In my previous CMS project I was on the way to create this kind of asynch interface, but mvc was more adapted working with WWF, moving to mvc would have been a mandatory step but I ran out of resources.

In MS CRM you take Visual studio, create a WWF assembly using the CRM sandox and inject it into the CRM DB, then it can be called as an action from workflow using prepared parameters.
The idea of using an interface between the site (IIS) and WWF engine opens many possibilities of batch processes which would have been quite impossible to manage from a traditionnal web site where you are always limited by the transaction max delay.

With WWF an asynch action could take several days, months, eventually more, it is current with CRM.
You may also decide some system actions as preparing thousands emails in back ground or throwing a code update or DB update or code warm up, etc.

I would be interested participating building the Orchard WWF hub for workflow. 

Nov 8, 2012 at 11:06 PM

It's not "async" and I think by async you actually mean "long running" which is more like stop now and start later. Then the new workflow module we intend could do that.

Not sure we want to rely on WWF to handle it. In orchard the state and the actions are completely separated, and you don't need WWF to create them.

What would be the concrete advantages of using WWF ?

Nov 9, 2012 at 12:48 AM

By async I was meaning another process, outside of the IIS Application pool and not submitted to its constraints.

How do you do this in Orchard ? Different threads ? Different processes ? 

I have been playing with basics samples for WWF 4 and MVC 3 of Ron Jacobs (, the designer was very easy to use, and XAML files for declarative programming also, but I get difficulties with some parts of the 'WCF cabling', lack of support on the samples and process hosting logic. May be its more clear today.

The interest of WWF is in its integration with WCF  (and its weakness considering WCF is a totally MS limited product), also in the 'great' designer interface which could be hosted in any client, and the easy way to create simple activities with just some XAML files and text editor. May be having an 'Orchard WCF library' could be interesting enough to generate many workflow modules.
I think it's what has been done by CRM team.

Nov 9, 2012 at 1:10 AM

We had attempted to integrate WWF into ASP.NET a few years ago and it wasn't pretty. I haven't looked more recently (did it change?) but my impression was that it wasn't a web product at all.

Nov 9, 2012 at 2:09 AM

We have background tasks, and one of them is about Rules too, to trigger some events after some specific amount of time. For instance with this new workflow module we can move a content item into another state after a specific amount of time, or execute any other Rule's module action.

The scenarios you are describing for MSCRM are included into the scope.

Nov 9, 2012 at 8:18 AM
Edited Nov 9, 2012 at 8:29 AM

I will dig further into rules, my opinion is not valuable until I have a better understanding of Orchard internals.

There are too many mysteries for me around technologies you deployed in Orchard (injection, rules, etc.)
I read today the announcements for Workflow Foundation 4.5, the team seems to have progressed for a better usage (no more VB when using C#, even better designer, better hosting, version management, process identity management, the clientTestUtility is also very useful when implementing activities), couldn't be worth doing another try ?

Reinventing the wheel has always be some Pandora Box inside developers collective mind. 

If 'ite missa est' concerning Orchard's workflow, I would just propose you keep some door open to have an interface compatible with WWF 4.5.

PS: after writing previous text I found this demo by Ron Jacob

I would say it's a perfect exemple of what I would expect from an ecommerce or company  website. 
The code is very elegant.... 

Nov 9, 2012 at 7:32 PM

I see you point, what we want to achieve here is just a State Machine in terms of WWF. The Rules module we have today is able to trigger custom action based on changed states.

Having a full WWF based workflow is possible in Orchard, it would replace Rules and this new Workflow module completely. And if you think there is a need for that feel free to do it, but I don't think we will ever take a dependency on it. This would assume all of our users would need to use WWF to create simple states and rules. This is more about SharePoint's market.

Also, the Rules module doesn't handle long running workflows right now, but this might become something we would like to dive in. I can easily see some scenarios here, and have a graphical interface for it would be nice, maybe a Rules 2 effort.

Nov 9, 2012 at 8:10 PM

@csadnt You are inspiring me ...

Nov 9, 2012 at 11:18 PM

Thanks, Orchard is an inspiring work, hope I could reach some active level soon, but I have still to fight on the business side here before spending all the time I would like on Orchard.

Nov 10, 2012 at 12:55 PM

I am very excited to see this new feature for 1.7. Since I want to start using Orchard as a platform as well as a CMS, I do have some suggestions:

1) please make the end state configurable.  You can definitely default to publish, but make it adjustible. Especially now with WebAPI where you can open up Orchard to various data coming in and going out, publish doesn't make sense to every bit of data
2) put some thought in acceptance flows, where a set of users/roles can be assigned to a transition between states, so that multiple pieces in an organisation can have their say about whether a specific piece of data can transition from one state to another. For instance, the manager, backoffice and sales are roles that can accept, but manager acceptance is mandatory.  Also allow people to enter reasons and even custom data (WebAPI) for not accepting for instance, this is data that can be aggregated into the dashboard (long running processes would be mandatory for acceptance flows I think)
3) provide a standard (the buttons you spoke about) but also custom mechanisms for accepting, for instance allowing for a callout making a message appear on mobile devices for accepting (just some wild thoughts here)
4) I also implement MSCRM, so I see where csadnt is coming from, but I also understand that you don't want to take dependencies on third party software (even Microsoft :)).  Maybe provide a custom action to launch a (external/WWF) workflow with some params? This would remove any hard dependency but still allow a lot of flexibility for external workflows, once again keeping WebAPI data coming in and going out in mind
5) maybe think about these workflows allowing to trigger on system and/or module events as well, or even make it possible to trigger them from within a module.  Same goes for accepting/state transitioning
Nov 11, 2012 at 10:10 PM

@2LM we are quite in phase.
What could we exactly consider as a dependency in Orchard, I am not sure that Workflow Foundation could be a dependency, it seems so .NET.
There are already existing dependencies, sometime heavy (Log4Net, Nhibernate.....)
Is Orchard looking for something as Mono Project compatibility as a dependency criteria ?

Nov 12, 2012 at 1:18 AM

That's an excellent remark. I don't think that WWF would work on Mono.

Nov 12, 2012 at 8:22 AM

Is mono compatibility a criteria ?
I am not sure it is a serious one ?
Who uses it, some active Novel minority ? I don't even know a customer here (fr-FR)  who uses it (and I have been looking at .NET since its first day)

Looking on Mono site, they say they support WWF 4 :), so no show stopper here....but they only support partially MVC 4 :)

Moreover, I am interested to know an Open C# based project providing same services as WWF: instant and long transactions with state storage, Wab Api, SQL Server, Designer, Debugger, etc.

Nov 12, 2012 at 11:53 AM

Please. Do not use WWF in Orchard. WWF is pain in @#$ when you try to migrate for newer version of workflow process. Workflow in Orchard must be simple and possible to migrate during working production site when some processes are in the middle of the workflow.

I can see workflow on Orchard only as event based workflow. When States are changed by reacting on "events" ... not states are changed by pushing objects instances by "commands". It will be much flexible and expenditable.

Nov 12, 2012 at 1:00 PM

@rodpl Seems you have been suffering in the past from the unfamous change between the original WWF an the version 4 (or 3.5 don't remember exactly) where very few things were compatible. But the last version seems to be better, no more suffering from these youth errors, managing identities.

In MS CRM you may migrate your server and do correctly the job concerning workflows.

I am fearing that the kind of workflow you are requesting would be limited to tasks having as a maximum running time the limit you put in your HTTP transactions for IIS.
Usually other security and performance constraints limit this to less that 5 minutes ? with pool restart each 20 minutes...
This is often not enought to do some Web Service connection on a distant server and run your service....what I would appreciate to be able to do in my web site.

Nov 12, 2012 at 1:13 PM
Edited Nov 12, 2012 at 1:18 PM
csadnt wrote:

@rodpl Seems you have been suffering in the past from the unfamous change between the original WWF an the version 4 (or 3.5 don't remember exactly) where very few things were compatible. But the last version seems to be better, no more suffering from these youth errors, managing identities

In MS CRM you may migrate your server and do correctly the job concerning workflows.

I am fearing that the kind of workflow you are requesting would be limited to tasks having as a maximum running time the limit you put in your HTTP transactions for IIS.
Usually other security and performance constraints limit this to less that 5 minutes ? with pool restart each 20 minutes...
This is often not enought to do some Web Service connection on a distant server and run your service....what I would appreciate to be able to do in my web site.

I was using 4.0 version of WWF

?! About what running tasks are you talking about ? There is all about state machine workflow not flow chart based I think.

Another issue ... how much time and memory takes WWF to start ? 

Nov 12, 2012 at 1:18 PM

I think that Orchard should provide that States defined in Orchard like sebastien said in 2nd post, would be used by external module for controlling  workflow. there should be simple workflow engine build in Orchard but there should be extensibility point to use ex. WWF based external module which uses already defined States to control contents. 

Nov 12, 2012 at 5:55 PM

I have spent the last two days thinking about it, and you can't imagine the head hake right after ;)

I think I have found a very nice solution which will please everyone, would be based on flow charts instead of state engines, and would reuse what has been done so far with Rules. I will take some time to write about it here today, so you can give some feedback.

Nov 12, 2012 at 11:34 PM

Time to share my thoughts, again.

Even if the first design was good, there was obviously some missing pieces in the puzzle. There are so many different ways of starting with workflows that it's hard to find the right solution. Not sure I have it yet, but I am close.

The main idea is to create a new module which will replace Rules, let's call it Workflows. I thought about possible way to migrate the existing one, but it's impossible, and instead of breaking it, making current rules module to fail miserably, and at the same time having a not well suited design, I think it's best to provide a new module which will be recommended over Rules. The advantage is that the migration will be smooth, and because Rules is shipped on the gallery it won't break upgraded websites.

- A Workflow will be like a Rule as in Orchard.Rules. We won't talk about editorial workflows specifically, it's just a example of usage of the overall Workflow module, as @csadnt was suggesting.
- A workflow is a directed graph of activities/tasks (whatever it will be called). An activity can have one or more outcomes (succeded/failed for instance,red/blue/green, ...)
- An activity can be blocking (old events) such that a workflow can be long running, i.e. it will be serialized waiting for an event to wake it up.
- The outcome of a workflow can be anything, such as publishing a content item (editorial workflow/moderation) of just sending a message like tweets or emails. 
- The editor will be graphical, provide  drag and drop of activities, and in the end the workflow will be more user friendly than the current Rules module. The editor needs to be integrated in the dashboard to engage users.
- A screen will display the currently running workflows (the ones waiting for something to happen), what they are waiting for and provide a way to inspect the current state (kind of debugging tool)

Editorial workflows

An editorial workflow will require content items to have some sort of workflow state attached to them. As a content item could be part of several workflows at the same time (moderation, translation, ...) it needs to be a Field. This could be a specific field type so that we can provide dedicated activities in the workflow designer. The field will be configured by providing the possible states, not their order.

In the workflow designer, Editorial Workflow States can be changed by a specific activity, and the field will display the current value and other useful links/information on the content item editor/summary view.

To go over all the possible editorial states of some content items, we need to call for user actions, like approval/denial. This will be done with a specific activity to create a User Driven action which will define what are the possible outcomes (approved and declined for instance). There will be a specific screen under Workflows to display all the active instances of those activities, such that a user can see what can be done for his role, a.k.a tasks. Sending emails while creating tasks is the responsibility of the workflow. Those tasks will show links to trigger the decision, which will call the blocking event with the desired outcome.

Security to go from a state to the other is also handled by the workflow with specific activities. For instance it's very easy to have a starting even waiting for a content type to be created, then have another step to check for the user's role and drive the outcome based on it, or any other condition like a value in the content item.


This is inspired by how WF is working, and also some other tools. I think it respects all the feedback you have given so far, and adds some real value to Orchard.

Nov 13, 2012 at 2:11 AM

I love it. Couple of questions however:

  1. should messaging be deeply integrated with this? Seems like most activities will involve notifications to a specific group of users.
  2. how do you see permissions integrated with this? Most activities will have to be restricted, but what role/group gets to do what is likely to vary by section/category/taxonomy or who knows what. It seems like the current item permissions and general permissions are either too fine or too coarse grained.

@csadnt: yes, Mono is a very big deal. Look at this: Mono support comes *before* workflow. We should be careful about any new dependency so we still have that possibility.

Nov 13, 2012 at 7:58 AM

@sebastien  I vote 5 times for it :),  great step further, I will support effort, may be do not bother to much with permissions now, it will come naturally later.
@bertrand Mono has been a great idea missed by MS, I had been disapointed at the time, now I see the Attachmate/Novell story and it do not smell good. Anyway I discovered the Orchard voting panel I have not paid attention, and I will post my opinion. You know the problem of the blinded active minority is it imposes bad directions.... sometimes it's also good practice to decide leaving some old furnitures down on the corner (near the 4 guys playing :) ). Orchard should have a discussion about all this products dropped in the global scope by the dev energy of some individuals and fading away little by little.

Nov 13, 2012 at 10:33 AM

Sounds good, as long as it is as extendable as everything else in Orchard, as that is why I like Orchard so much.  I suppose you will allow for custom activity types like with WF?  How about the ability to trigger workflows from code or within WebAPI?  I really like the idea, I just don't see very clearly at this point where and how I can inject and/or intercept in this approach...

Nov 13, 2012 at 1:52 PM

I lost track of what you were trying to say with this part. Would you mind rephrasing without analogies or metaphors? 

csadnt wrote:

 You know the problem of the blinded active minority is it imposes bad directions.... sometimes it's also good practice to decide leaving some old furnitures down on the corner (near the 4 guys playing :) ). Orchard should have a discussion about all this products dropped in the global scope by the dev energy of some individuals and fading away little by little.

Nov 13, 2012 at 2:06 PM
Edited Nov 13, 2012 at 2:09 PM

@TheMonarch I was only stating that nobody is protected against an error, discovering it a long time later. We could continue on this idea outside this thread if you want. So many great products have disappeared since the firts time I entered in the software area, sorry but I am very old :)

Nov 13, 2012 at 5:42 PM


We will migrate the current rules to activities, which includes emailing, twitter, sms messages, ... We can also add new ones if necessary, like by using external email services (mailchimp, sendgrid, ...). The activity needs to be simple as it will be used often.

What do you mean by "activities need to be restricted" ? The execution of an activity at a specific point in the workflow might depend on the permission, and it can be defined as another activity: "Is the current user CEO ?" => Yes -> continue to next activity; No -> stop workflow

Nov 13, 2012 at 5:54 PM
Edited Nov 13, 2012 at 5:55 PM

I see. You are going in the direction of activities that are as small as possible. That makes sense but may make the system a little too "engineery" in its admin interface. Here's an idea: why don't we apply what's worked great with content items and make activities compositions of aspects? This way, if you want to add notifications or role-based permissions, you can. Are activities content items, simply put?

I don't think permission checking can be an activity in itself: it needs to be integrated with the activity that it's protecting. If you separate them, there is a possibility that the workflow advances beyond the permission checking activity and then another user gets to the next step, at least in principle.

Nov 13, 2012 at 6:12 PM

Composition. We could add the composition scenario, that a Workflow can be encapsulated as another activity, in order to reuse common scenarios. Also because activities are custom, we can also create those by code. Or make administration screens which would configure a workflow by themselves. Like "Create a moderation system with 3 steps using those roles", as a mini clever recipe/wizard .. sounds like a deja vu.

You are talking about user actions, which I called Tasks. Tasks will be protected. Most of the other ones will be executed by the system, or use the contextual user as some information.

Nov 13, 2012 at 7:42 PM

Would this composition scenario also enable recursive flows or flows calling other flows?

Nov 13, 2012 at 7:46 PM

Exactly. Unless an unknown complexity is hidden somewhere and I don't see it.

Nov 13, 2012 at 8:15 PM
Edited Nov 13, 2012 at 8:17 PM

looks great.
There is always the never ending loop scenario. So shouldn't we keep  in the 'context call' a 'call stack' and limit the levels of reentrancy ?
One question: does these tasks will run in the IIS 'caller thread' or independantly ?  eventually being triggered by an OS call ?
Keeping small 'base' activities could allow playing with inherance adapting each activity response on a number of standard (interface) situations ?

Nov 13, 2012 at 8:54 PM

It will run on the caller thread unless it's triggered back a background task

Nov 13, 2012 at 10:40 PM

I was writing a Moderation module for my the Orchard Forum module. I would assume that anything done within what has been mentioned thus far will supersede a moderation module correct?

Nov 13, 2012 at 10:42 PM

Yes, it should work with forum threads too, the goal is that it works on any content item.

Nov 13, 2012 at 10:44 PM

Can it also be made to work on non-content items, such as data coming from external systems/sources through WebAPI?

Nov 13, 2012 at 10:47 PM

How would you see this working with say, A Moderators closes a thread, and gives a reason for closing that thread.. i,e. Dupe or Sock Puppet.

Would that be covered?

Nov 13, 2012 at 10:47 PM

Content Item is one scenario. The activities can be triggered by anything. If you want a WebAPI call to trigger an activity then you just have to raise the event like any other one (content published, user logged, ...). Look at the current Rules module, this will be almost the same implementation.

Nov 13, 2012 at 10:53 PM

I assume that the thread would have a property for that, then you could reuse the comment given in the user task to set the thread property once the moderator has taken the decision.

Nov 13, 2012 at 11:09 PM
Edited Nov 13, 2012 at 11:12 PM

Sorry I didnt explain myself at all. (Its late)

So lets say I write a Post. That post needs to be moderated, so ends up in the moderation Inbox for a particular role., A member of that role could then go an approve that piece of content, and that content is then shown on the UI.

Are we saying that workflow would be able to be implemented out of the box for this scenario? If so... How would I tell in my module, just go get content that is or is not moderated?

Nov 14, 2012 at 7:55 AM

This sounds brilliant! You alluded to the wizard/recipe support above, hopefully this covers the use case where a site has a shopping cart checkout system and steps can be contributed dynamically to the process by various modules. For example switching in a different payment gateway module or adding tracking, confirmation, or terms and conditions pages to the checkout flow.

Having flexible user registration flows would be another use case when different user information needs to be collected on a range of steps depending on the modules installed. Insurance websites collect a lot of information and have final manager approval steps that this would work very nicely with.

Being able to see the list of active workflows and their current progress will be very useful, sales support could even assist the user with their checkout by adding or removing items and discounts from the workflow administration... this will be an awesome feature for Orchard!

Nov 14, 2012 at 7:16 PM

Seb what do you think of that scenario I described...?

Nov 14, 2012 at 7:26 PM

If you want a "moderated box" you will need to make it, by having a custom projection for instance. But the workflow could assign a specific property when a post is created to flag it as "needs moderation" which you would filter. This could use the State Field I am referring to in a previous message. You can also instead not make this box, but generate a User Task for the moderators, thus they could see exactly what needs moderation. So answer is YES.

Nov 14, 2012 at 7:27 PM

Cool. I just wanted to be sure.

Nov 27, 2012 at 12:46 AM

I would start making the most simplistic state based workflow and go from there. 

That would include:

1) States (The current state)
2) State Transitions.  What transitions a state can make to various other states with ability to develop transition logic (async is nice here for sending e-mails, etc).
3) Work containers (would handle the content items and who is assigned to them).
4) Work container contains many content Item(s) that become active based on the state.
5) User assignment (Direct or Role based) along with a task list to work containers.
6) Context should be page level I suppose?

I believe state based workflows are better suited for users and their user interfaces vs. sequential workflows that are better for system to system processes.

Just getting into Orchard but that is my experience from developing workflow products.


Nov 27, 2012 at 12:48 AM

I think WCF is good for sequential workflows but to bulky for simple page level state based workflows.

Feb 12, 2013 at 4:38 PM
The new workflow module looks great!

But I am wondering if the current workflow implemented the following feature: (I tried, but didn't find it)

Take "Approval" action as a example. The data "who did this approval action to the content item" should be saved somewhere in the database.
Feb 20, 2013 at 1:13 AM
We might need to add some audit trail within the activities so that we can keep a log of each workflow. But it should be another module for that, because what data to save and where to save it could have multiple answers.
Mar 6, 2013 at 9:01 AM
I've been having a try of the new Workflow module, just a small point I'd like to make:
  • It's very unclear as to whether the workflow is started or not (a greying of the icon is unclear)
  • When using the 'Content created event' you select content types in a list and click 'Save' but when you return, nothing is highlighted to indicate what you selected previously. Maybe a second list could be displayed that shows selected items? (the usual add/remove/add all/remove all type dual list boxes)
Apart from that, it's great to see workflow being introduced, well done!
Apr 23, 2013 at 1:50 PM
Edited Apr 23, 2013 at 1:51 PM
Testing the module: Orchard.Workflow
Clone: d70b75f4c925
  • Subsection Manage Workflow Definitions, filter All values produces an error
  • Why can't I edit the name of the Workflow?
Apr 24, 2013 at 3:21 AM
Please file bugs.
Apr 24, 2013 at 4:21 AM
Edited May 6, 2013 at 12:50 AM
BertrandLeRoy wrote:
Please file bugs.
Apr 24, 2013 at 6:34 AM
May 10, 2013 at 9:22 PM
I realize that Workflows is in pre-release, but I desperately need some of the features it provides. I have a couple of questions.

First, the Decision activity's Execute method simply returns true. Is this feature not yet implemented, or is the intent that conditions would be registered to the activity with the results AND'd together? What's your vision of what these conditions would look like?

Many activities, like Send Email, simple have a single {Done} outcome. Whether the Activity succeeds or fails, the next step occurs (e.g. Notification that the message was sent successfully). Shouldn't there be Success and Fail outcomes for most "task" activities?

I am trying to solve the scenario where a simple contact form appears in more than one location of a site. Each location uses a separate Custom Form Widget, but each widget uses a common Basic Contact Form contenttype. Since the content events in Rules and Workflow are triggered by content of a certain contenttype being created, each Custom Form Widget will trigger the same Workflow (same is true for Rules). However, I want to be able to add context to the resulting activity, For example, send an email that says "thank you for your interest in cumquats" vs. "thank you for your interest in plums". I was hoping to use the branch and decision activities as a kind of switch statement to invoke the appropriate Send Email activity.

Is there a better way to accomplish this conditional response in Orchard? If not, how's can I understand how to implement conditions in the decision activity?

BTW, the workflow module was incredibly easy to use. And it looks like something the community could build upon to make a really powerful tool.
May 11, 2013 at 1:37 AM
The Decision activity is a placeholder right now, it's not done, but you can do it. The goal is to have CSharp code inside. If you want to implement it you can. There is a custom validation part in the Orchard.Scripting.CSharp. You will need almost the exact same code, and a dependency on this module too. The result of Execute() will then be triggered by the execution of the script (returning a Boolean), and the possible outcomes being simply Success/Fail, as you are suggesting.

A switch statement could be another activity, where the outcomes are defines statically (like for the Branches activity) but the one executed depends on the evaluation of a script of a token.