1. Alfresco Javascript API
2. Workflow Administration
U can read and write task variables in JBPM. The Alfresco JavaScript action lets you embed custom JavaScript into process definitions in much the same way that you can embed BeanShell scripts. To do so, simply add an <action> element with class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript" attribute. Inside the <action> element, include a <script> element that defines the JavaScript to execute. As with the BeanShell script definitions, this <script> element may optionally contain <variable> elements
and an <expression> element if you want to limit access to process and task variables.