1. add user Task in yout bpmn-xml-file:
<userTask id="myTask" name="My Task" activiti:formKey="myappwf:myTask">
<extensionElements>
<activiti:taskListener event="create" delegateExpression="${CreateMyTaskListener}" />
</extensionElements>
</userTask>
2. add CreateMyTaskListener bean to the workflow-context.xml file
<bean id="createMyTaskListener"
class="de.lustin.alfresco.workflow.CreateMyTaskListener"
parent="activitiCreateTaskListener">
</bean>
<bean id="createMyTaskListener.activitiBeanRegistry"
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"
depends-on="activitiBeanRegistry">
<property name="targetObject">
<ref bean="activitiBeanRegistry" />
</property>
<property name="targetMethod" value="put" />
<property name="arguments">
<list>
<value>CreateMyTaskListener</value>
<ref bean="createMyTaskListener" />
</list>
</property>
</bean>
3. Create a Java class
import org.alfresco.repo.workflow.activiti.tasklistener.TaskCreateListener;
public class CreateMyTaskListener extends TaskCreateListener {
@Override
public void notify(DelegateTask delegateTask) {
...