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
- /// <summary>
- /// This is a small class that demonstrates the use of states in
- /// a personnel request.
- /// The class is very simple only allowing a request to made and
- /// then approved.
- /// </summary>
- [Jazz]
- public class
PersonnelRequest :
jObject
- {
- // Constructor
- public PersonnelRequest()
- {
- this.data =
"";
- }
- private
string data;
- // Make a request by setting the data.
- public
string Request
- {
- get {
return this.data; }
- [GrantStates("Start")]
- set
- {
-
this.data = value;
-
// prevent the data from being changed.
-
this.EnterState("Approval");
- }
- }
- // The approve method is only allowed to be executed when this instance is in the 'Approval' state.
- [GrantStates("Approval")]
- public
void Approve()
- {
- // prevent the workflow from being approved again.
- this.EnterState("Completed");
- }
- // A PersonnelRequest instance has its 'CurrentState' set to one
- // of the following states.
- [StartState]
- void Start() {}
- [State]
- void Completed() {}
- [FinalState]
- void Approval() {}
- }
Testing the example.
- /// <summary>
- /// This demonstrates that an exception occurs when access is not allowed.
- /// </summary>
- [TestMethod]
- public void StateExample()
- {
- using (ClientNexus nexus =
ClientNexus.Create(NexusConfig.DefaultVerbose()))
- {
- PersonnelRequest myFlow =
new PersonnelRequest();
- nexus.Bind(myFlow);
- // Enter some data - this will change the current state of 'myFlow' to the Approval state.
- myFlow.Request =
"May I leave early on Friday?";
- try
- {
-
// Enter some more data. This will cause an exception.
- myFlow.Request =
"I changed my mind, I want to leave Friday at noon.";
- }
- catch (Exception ex)
- {
-
Assert.IsTrue(ex is
AccessViolationException);
- }
- // 'Data' has not been changed.
- Assert.AreEqual("May I leave early on Friday?", myFlow.Request);
- // but it can be apprroved
- myFlow.Approve();
- Assert.AreEqual("Completed", myFlow.CurrentState.Name);
- // executing 'Approve' now will cause an exception
- }
- }
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'.