throw new WfException("Process cannot be null");
if (context == null)
throw new WfException("Context should not be null");
performers.put(process, requester);
WfProcessMgr mgr = process.manager();
// Validate the process context w/ what was passed.
try {
if (Debug.verboseOn()) Debug.logVerbose("Validating w/ signature: " + mgr.contextSignature(), module);
Map<String, String> contextSignature = UtilGenerics.cast(mgr.contextSignature());
ModelService.validate(contextSignature, context, true, null, ModelService.IN_PARAM, Locale.getDefault());
} catch (GenericServiceException e) {
throw new WfException("Context passed does not validate against defined signature: ", e);
}
// Set the context w/ the process
Map<String, Object> localContext = new HashMap<String, Object>(context);
localContext.putAll(mgr.getInitialContext());
process.setProcessContext(localContext);
// Set the source reference id if one was passed
GenericValue processDefinition = process.getDefinitionObject();
String sourceReferenceField = processDefinition.getString("sourceReferenceField");