You will need to write a (java) listener that will run when the form has been completed and the task will end.
Here is how to get the NodeRef of your file from your workflow execution context:
public NodeRef getFirstPackageItem(DelegateExecution execution){
ActivitiScriptNode packageItemsbpm = (ActivitiScriptNode) execution.getVariable("bpm_package");
try {
if (packageItemsbpm != null && packageItemsbpm.getHasChildren()){
return nodeService.getChildAssocs(packageItemsbpm.getNodeRef()).get(0).getChildRef();
}
} catch (Throwable e) {
logger.error("",e);
}
return null;
}
Setting the name out of the form propery values is done by getting the values from your task object, and storing them on your NodeRef:
NodeRef file = getFirstPackageItem(execution)
Object filenameprefix = task.getVariable("mymodel_regnumber");
Object filenamesuffix = task.getVariable("mymodel_sender");
nodeService.setProperty(file, ContentModel.PROP_NAME, filenameprefix+"/"+filenamesuffix );