As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<f:event type="preRenderView" listener="#{businessProcess.startTask(taskId, true)}" />
<h:commandButton action="#{businessProcess.completeTask(true)}" value="Complete" />
public class Controller {<br><br> @Inject<br> private BusinessProcessAssociationManager associationManager;<br> <br> @Inject <br> private TaskService taskService;<br> <br> public void pauseUserTask() {<br> Task task = associationManager.getTask();<br> if(task == null) {<br> throw new RuntimeException("Not working on a task");<br> }<br> // flush the variables<br> Map<String, Object> changedVariables = associationManager.getBeanStore().getAllAndClear();<br> if(changedVariables.size()>0) {<br> taskService.setVariables(task.getId(), changedVariables);<br> }<br> // remove the association with the current task. <br> associationManager.disAssociate();<br> }<br> <br>}