public String btnView_action() { String itemID = (String) hdnSelectedItemID.getValue(); if (itemID == null) { msgPanel.error("No work item selected. Please select a work item to view."); return null; } WorkItemRecord selectedWIR = getSelectedWIR(itemID); // maybe the wir isn't started or was part of a cancellation set and now it's gone if (selectedWIR == null) { msgPanel.error( "Cannot view item contents - it appears that the " + "selected item may have been removed or cancelled. " + "Please see the log files for details."); return null; } _sb.setDynFormType(ApplicationBean.DynFormType.tasklevel); DynamicForm df = (DynamicForm) getBean("DynFormFactory"); String title = "YAWL 3.0 - Edit Work Item"; String header = "Edit Work Item: " + selectedWIR.getCaseID(); if (df.makeForm(title, header, _sb.getTaskSchema(selectedWIR), selectedWIR)) { _sb.setVisualiserReferred(true); _sb.setVisualiserEditedWIR(selectedWIR); return "showDynForm"; } else { msgPanel.error( "Cannot view item contents - problem initialising " + "dynamic form from task specification. " + "Please see the log files for details."); return null; } }