...
(this particular example is used within the <onSave> tag:
Code Block |
---|
public void fillOrderDatesAndWorkers(final DataDefinition dataDefinition, final Entity entity) { if (("02inProgress".equals(entity.getField("state")) || "03done".equals(entity.getField("state"))) && entity.getField("effectiveDateFrom") == null) { entity.setField("effectiveDateFrom", new Date()); entity.setField("startWorker", securityService.getCurrentUserName()); } if ("03done".equals(entity.getField("state")) && entity.getField("effectiveDateTo") == null) { entity.setField("effectiveDateTo", new Date()); entity.setField("endWorker", securityService.getCurrentUserName()); } } |
3.3 View hook (preRender) example:
...