PRE_SUBMIT Event
With PRE_SUBMIT, we have the option to do something before we submit the document.
PRE_SUBMIT Event Example 1
events PRE_SUBMIT: {context, document ->
context.getNSFHelper().executeAgent('(agentName)', document)
}
Here is another code snippet as an example.
PRE_SUBMIT Event Example 2
events PRE_SUBMIT: {
context, document ->
def now = new Date()
def timestamp = now.toTimestamp().toString();
def payload = context.getResultPayload();
def fc = context.getFacesContext();
def helper = context.getNSFHelper();
def tsAdd = helper.createJsonObject();
tsAdd.put('stamp', timestamp);
tsAdd.put('path', 'irgendwas');
payload.put('timestamp',tsAdd);
}