Follow the section 5.2 in Activiti In Action.