Fire up your applications with Jetfire
processing
// Rate Content Workflow
//===================================================================================
// RateContent.txt
//===================================================================================
// Copyright (C) 2009 TrackerRealm Corporation
// This file is part of Jetfire.
// 
// Jetfire is open software: you can redistribute it and/or modify it under the terms
// of the GNU Affero General Public License (AGPL) as published by the Free Software Foundation
,
// version 3 of the License.
// 
// Jetfire is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
// See the GNU Affero General Public License (AGPL) for more details.
// 
// You should have received a copy of the GNU Affero General Public License (AGPL) along with J
etfire. 
// If not, see http://www.gnu.org/licenses.
// REMOVAL OF THIS NOTICE IS VIOLATION OF THE COPYRIGHT.
//===================================================================================

namespace JetfireApps
{
   public workflow RateContent
   {
      // C O N S T R U C T O R - Instantiate the RateContent
      // The RateContent starts in the Start State.
      // Subject property is used to identify the content being rated
      // Description property is used as the rater's option comment
      // Rating property is numbered from 1 (poor) to 5 (outstanding)
      public RateContent()
      {
         enterstate Start();
         Subject = "Content being rated";
      }
      // P R O P E R T I E S
      int rating = 0;

      public int Rating
      {
         get { return rating;   }
         set 
         {
            if (value < 1)
               throw exception ("Rating must be between 1 and 5");
            if (value > 5)
               throw exception ("Rating must be between 1 and 5");
            rating = value;
            enterstate Completed();
         }
      }
      // the dns name of the user's computer - set in custom WebPart
      public string User
      {
         get;
         set;
      }
      
      // S T A T E   M E T H O D S
      // State Transition      Command      Comment
      // New -> Start         new         The workflow enters the start state
      // Start -> Completed   Complete   The content is rated
      public Start()      { }
      public Completed()   { }
   }
}