Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
How to Get Form Field Values in a Workflow Definition
			If you want to get Form field values in a workflow definition, below is a sample groovy script for a workflow definition.
Disclaimer: Please note that this is a sample of how to extend your portlet and should only be used as a reference.
		import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.dynamic.data.mapping.model.DDMFormInstanceRecordVersion;
import com.liferay.dynamic.data.mapping.service.DDMFormInstanceRecordVersionLocalServiceUtil;
import com.liferay.dynamic.data.mapping.storage.DDMFormFieldValue;
import com.liferay.dynamic.data.mapping.model.Value;
// Fetch the form record Id from the workflow context
long recVerId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK));
// Initialize form record version
DDMFormInstanceRecordVersion recVer = DDMFormInstanceRecordVersionLocalServiceUtil.getFormInstanceRecordVersion(recVerId);
// Retrieve the form field values
List<ddmformfieldvalue> formFieldVals = recVer.getDDMFormValues().getDDMFormFieldValues();
for (DDMFormFieldValue fmval : formFieldVals) { 
    Value val = fmval.getValue(); 
    String data = val.getString(Locale.ROOT); 
    String name = fmval.getName(); 
    System.out.println("Form field values : "+name+" => "+data); 
}</ddmformfieldvalue>Disclaimer: Please note that this is a sample of how to extend your portlet and should only be used as a reference.
			Thanks a lot! Solves exactly the point I was stuck in my integration