inject Custom bean in a custom class that implement taskListner interface

cancel
Showing results for 
Search instead for 
Did you mean: 
alaeddine
Member II

inject Custom bean in a custom class that implement taskListner interface

hello,

 

I'm creating a new workflow and in a userTask I'm using activiti:taskListener to invoke MyCustomClass 

 

<!-- begin    -->

<userTask id="STEPID" name="STEPNAME" activiti:candidateGroups="MY_GROUP" activiti:formKey="tw:formKEY" >

<!-- some valid work here --> 

<extensionElements>

<activiti:taskListener event="create" class="myPackage.MyClass">

<activiti:field name="myBean" expression="${myBeanId}">

</activiti:field>

</activiti:taskListener>
</extensionElements>

</userTask>

 

<!-- end  --->

and in .MyClass I've declared a property (onther bean )

<!-- begin --> 

public class MyClass implmentes TaskListner{

  private Expression myBean

    @Overrid
   public void notify(DelegateTask arg0) {

       MyBean mb = (MyBean) myBean.getValue(arg0);

   }

}

 <!-- begin --> 

and i've declared my bean in service-context.xml like these 

<bean id="myBeanId" class="onther.package.MyBean" >
</bean>

 

and i'm using AIO archetype

 

and when i invoke CreatStep i have the follwing error:

Exception while invoking TaskListener: Unknown property used in expression: ${myBeanId}