Dynamically calling an Action

Dynamically calling an Action

  
Any ideas on how to dynamically calling an Action in the same sort of way of using a Delegate in C#?
I would like to have a datamodel capable of storing the rules that when a certain record is updated to a certain value (in detail, it's a Status field: "Submitted, Completed, Closed, ..."), then a parameterized Action, for that status transition, is called. The important thing here is being able to parameterize the Action being called, preferably using the datamodel to do so.
Thanks in advance for any suggestions.
Hi,
 
From your status field i believe it would be better to have 3 different actions to acomplish this, but if you realy want to use just one you need to check your Status field value, I imagine Status field is an atributte of some entity?

So i would suggest this logic approach to the situation:


Hope it helps.

Best Regards,
Miguel Vieira
Not quite what I need :)
What I meant with dynamically calling an Action, was, for example, to call a Web Service X, but be able to change which Web Service is called without having to change my application's code (just by maintaining the correlation between status A and Web Service X or Y in some data model).
I'm also interested in this as I want to be able to create a mapping between Active Directory groups and OS roles to grant.  But, to do that efficiently, I need to be able to call the role actions dynamically (Check/Grant/Revoke).
Francisco Vasco wrote:
Not quite what I need :)
What I meant with dynamically calling an Action, was, for example, to call a Web Service X, but be able to change which Web Service is called without having to change my application's code (just by maintaining the correlation between status A and Web Service X or Y in some data model).
This might help you.  As I would expect, it will require writing some C# code.
https://www.roelvanlisdonk.nl/?p=3545
Great find Sumo... this actually helped solve something similar we were looking to achieve.  Figured that there must be an easier way.
Luis Camarena wrote:
Great find Sumo... this actually helped solve something similar we were looking to achieve.  Figured that there must be an easier way.
 Now the trick is to figure out how to call Actions that take parameters.  :)