Project Description
Jazz is a compact, modular framework that allows new, or existing, applications to easily employ roles, states, ACLs and void safety. Jazz provides security by allowing business objects, and their methods and properties,  to have their visibility and accessibility controlled, on a per instance basis, by roles, object states and ACLs.

Jazz allows complete workflows to be implemented in only a few hundred lines of C# or VB code. 

Build robust, secure applications quickly with Jazz.
Use a ‘happy path’ programming style letting Jazz insure the integrity of your application.

Jazz Features  (see feature summary):

Also see  CodeProject article
Jazz Wiki – currently under construction

Licensing

Coming Soon

  • Rules
  • Windows based visual editor
  • Dynamic Objects – Create Code on-the-fly
  • Database storage of Jazz objects
  • Dataflow
  • Audits
  • Versioning of application code.
Jazz Example
  1. /// <summary>
  2. /// This is a small class that demonstrates the use of states in
  3. /// a personnel request.
  4. /// The class is very simple only allowing a request to made and
  5. /// then approved.
  6. /// </summary>
  7. [Jazz]
  8. public class PersonnelRequest : jObject
  9. {
  10.     // Constructor
  11.     public PersonnelRequest()
  12.     {
  13.         this.data = "";
  14.     }
  15.     private string data;
  16.     // Make a request by setting the data.
  17.     public string Request
  18.     {
  19.         get { return this.data; }
  20.         [GrantStates("Start")]
  21.         set
  22.         {
  23.             this.data = value;
  24.             // prevent the data from being changed.
  25.             this.EnterState("Approval");
  26.         }
  27.     }
  28.     // The approve method is only allowed to be executed when this instance is in the 'Approval' state.
  29.     [GrantStates("Approval")]
  30.     public void Approve()
  31.     {
  32.         // prevent the workflow from being approved again.
  33.         this.EnterState("Completed");
  34.     }
  35.     // A PersonnelRequest instance has its 'CurrentState' set to one
  36.     // of the following states.
  37.     [StartState]
  38.     void Start() {}
  39.     [State]
  40.     void Completed() {}
  41.     [FinalState]
  42.     void Approval() {}
  43. }

 

 
Testing the example.
  1. /// <summary>
  2. /// This demonstrates that an exception occurs when access is not allowed.
  3. /// </summary>
  4. [TestMethod]
  5. public void StateExample()
  6. {
  7.     using (ClientNexus nexus = ClientNexus.Create(NexusConfig.DefaultVerbose()))
  8.     {
  9.         PersonnelRequest myFlow = new PersonnelRequest();
  10.         nexus.Bind(myFlow);
  11.         // Enter some data - this will change the current state of 'myFlow' to the Approval state.
  12.         myFlow.Request = "May I leave early on Friday?";
  13.         try
  14.         {
  15.             // Enter some more data.  This will cause an exception.
  16.             myFlow.Request = "I changed my mind, I want to leave Friday at noon.";
  17.         }
  18.         catch (Exception ex)
  19.         {
  20.             Assert.IsTrue(ex is AccessViolationException);
  21.         }
  22.         // 'Data' has not been changed.
  23.         Assert.AreEqual("May I leave early on Friday?", myFlow.Request);
  24.         // but it can be apprroved
  25.         myFlow.Approve();
  26.         Assert.AreEqual("Completed", myFlow.CurrentState.Name);
  27.         // executing 'Approve' now will cause an exception
  28.     }
  29. }

Console Output from the example:

PersonnelRequest:'3b1bb08b-de94-446b-9b75-c1dd140fc492'.GrantState:        Execute Method 'set_Request' - State checked - CurrentState = Start
PersonnelRequest:'3b1bb08b-de94-446b-9b75-c1dd140fc492'.Change:        Set Property - set_Request = May I leave early on Friday?
PersonnelRequest:'3b1bb08b-de94-446b-9b75-c1dd140fc492'.EnterState:        Entered the state 'Approval' via the Method 'EnterState'. The previous state is 'Start'.
PersonnelRequest:'3b1bb08b-de94-446b-9b75-c1dd140fc492'.GrantState:        Execute Method 'set_Request' - State checked - CurrentState = Approval
PersonnelRequest:'3b1bb08b-de94-446b-9b75-c1dd140fc492'.AccesViolation:        Access is not allowed to 'set_Request'.  The current state is Approval.  Valid states are: 'Start'.
PersonnelRequest:'3b1bb08b-de94-446b-9b75-c1dd140fc492'.GrantState:        Execute Method 'Approve' - State checked - CurrentState = Approval
PersonnelRequest:'3b1bb08b-de94-446b-9b75-c1dd140fc492'.EnterState:        Entered the state 'Completed' via the Method 'EnterState'. The previous state is 'Approval'.

Last edited Jun 21, 2012 at 2:14 AM by JohnHansen, version 55