工作流(OSWorkFLOW)的例子改造

阅读更多

/***********本人原创,欢迎转载,转载请保留本人信息*************/
作者:wallimn
电邮:[email protected]
博客:http://wallimn.iteye.com
   http://blog.csdn.net/wallimn
时间:2006-11-15
/***********本人原创,欢迎转载,转载请保留本人信息*************/

相信现在关注工作流的人越来越多了,我也是其中之一,上网狂搜了一下,发现很多人说开源的工作流OSWorkFlow还不错,我也Download下载研究研究。

文档很少,只有上网再搜,发现很多资料都是你转载我,我转载你,原创的不多。反来复去地看了看网上的资料,再看看OSWorkFlow的自带文档,调试带的例子。

发现那个例子说明性不是很强,把人弄得很晕,经过一翻分析,我把例子修改了一下,添加了些注释,一些JSP页面也修改了一下并进行了汉化,设定了几个用户组,分别具有不同的权限,使工作流流转起来真正象个工作流。希望能对刚开始学习工作流的同志有所帮助。下面我贴出工作流定义的XML文件。完整的例子请到我的网络硬盘下载。下载地址:http://wallimn.gbaopan.com

工作流文件内容:






 
 
  
   
    
      true
    

    
      com.opensymphony.workflow.util.OSUserGroupCondition
      writer
    

   

  

  
   
     com.opensymphony.workflow.util.Caller
   

  

  
   
  

 

 

 
 
  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.AllowOwnerOnlyCondition
      

     

    

   

  

  
   
    
     
      
        true
      

      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.AllowOwnerOnlyCondition
      

     

    

    
     
      
                                String caller = context.getCaller();
                                propertySet.setString("caller", caller);
                                boolean test = true;
                                String yuck = null;
                                String blah = "987654321";
                                System.out.println("Step:1预处理函数");
                               

     

    

    
     
      
       
        
         propertySet.getString("caller").equals("newplayer")
        

       

      

      
       
        
                                                                          System.out.println("Step:1的Action后处理函数");
                                        

       

      

     

     
    

    
     
      
                                                          System.out.println("Step:2的后处理函数");
                               

     

                       
    

   

  

 

 
  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
                                                          com.opensymphony.workflow.util.OSUserGroupCondition
                                                          editor
      

     

    

   
  
  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Queued
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        editor
      

     

    

    
     
       com.opensymphony.workflow.util.Caller
     

    

    
     
    

   

   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
                                                          com.opensymphony.workflow.util.OSUserGroupCondition
                                                          editor
      

     

    

    
     
       com.opensymphony.workflow.util.MostRecentOwner
       1
     

    

    
     
    

   

   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        editor
      

     

    

    
     
    

   

  

 
 
  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        publisher
      

     

    

   

  

  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        publisher
      

     

    

    
     
       com.opensymphony.workflow.util.MostRecentOwner
       2
     

    

    
     
    

   

   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        publisher
      

     

    

    
     
    

   

   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        publisher
      

     

    

    
     
       com.opensymphony.workflow.util.MostRecentOwner
       2
     

    

    
     
    

   

  

 

 
  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        publisher
      

     

    

   

  

  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        publisher
      

     

    

    
     
       com.opensymphony.workflow.util.MostRecentOwner
       3
     

    

    
     
    

   

   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Queued
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        publisher
      

     

    

    
     
       com.opensymphony.workflow.util.Caller
     

    

    
     
    

   

   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        publisher
      

     

    

    
     
    

   

  

 

 
  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        publisher
      

     

    

    
     
       com.opensymphony.workflow.util.Caller
     

    

    
     
    

   

  

 

 
  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
        6
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        designer
      

     

    

    
     
    

   

  

 

 
  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
        7
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        designer
      

     

    

    
     
    

   

  

 

 
  
   
    
     
      
        com.opensymphony.workflow.util.StatusCondition
        Underway
        8
      

      
        com.opensymphony.workflow.util.OSUserGroupCondition
        designer
      

     

    

    
     
    

   

  

 

 
 
 
  
  
 

 
  
 

 

 
 
  
   
          "Finished".equals(jn.getStep(6).getStatus()) && "Finished".equals(jn.getStep(8).getStatus())
     ]]>

   

  

  
 

 

 

  完整例子请到我的网络硬盘下载:http://wallimn.ys168.com

你可能感兴趣的:(工作,Workflow,出版,JSP,Blog)