How can I access a spring bean in Activiti JavaDelegate?

后端 未结 3 574

I\'m trying to get a simple Spring example to work with Activiti 5.5, and having some trouble. I\'m using the process engine configured with activiti under %activiti_home%/a

3条回答
  •  甜味超标
    2020-12-18 08:57

    One of my project uses Activiti with spring. I think that JavaDelagate can be the problem. You can call from activiti's service task every spring bean this way:

    bean definition:

    
    

    activiti xml:

    
    

    You can also pass parameters to the functions for example process variables:

    
    

    I always use service tasks this way, and haven't got problem with singleton beans. Hope it helps. Please take a comment, if I didn't understand your problem.

    UPDATE:

    My project uses activiti like an embedded workflow engine. Activiti uses the same applicationContext with my webapp.

    My process engine configuration:

    
            
            
            
            
            
                       
         
    
    
        
            
        
    

提交回复
热议问题