Do you know how to send an Email with java code? you basically need to embed the same code inside an implementation of the WorkItemHandler internface. Once you get that you can bind the WorkItemHandler to the knowledge session (ksession.getWorkItemManager().register("Email", <your implemenatation of the work item handler interface>)) and add a task node to your process with the tns:name="Email". That's it :)
Cheers