Hi Isomorphic,
I'm going to create a function for my product next year where I allow the user to define some kind of process.
My process will consist of steps:
A process will be displayed and edited in a ListGrid "SELECT * FROM process where id=4711 ORDER BY position".
After every change of a row a "server constraint" should run. As the rules depend on many fields and also previous rows(!), I'll either use DataSource.validateRecord() you introduced here or a DMI I call to Create/Update/Remove after request.execute() (on violation of the rules, I'll return new DSResponse.setFailure(reason) then). So far I don't see problems here.
Now for the easy of editing, also persisted reordering like in this sample should be possible. This always results in a Queue with many operations. Here I only want to run my business-rule-check after the last request in the transaction. My questions are: How do I do this best? I think in validateRecord() can get from context -> getDSRequest() -> getRPCManager() to the RPCManager, but what then? How do I find out I'm not at the last request and should therefore skip my logic? Same for the DMI way, where I also have the RPCManager available: How do I find out I'm in the last request of a Queue?
Perhaps a boolean DSRequest.isFirstRequest() and boolean DSRequest.isLastRequest() would make sense?
More abstract: I'm looking for a way to express an INITIALLY DEFERRED constraint (or better: ASSERTION) in SmartGWT server code. How to do this best?
As this is not planned this year anymore, it is not urgent for me, but I'm very interested in your best practice here.
For anyone interested in the topic: With some luck, we are going to get CREATE ASSERTION in the next Oracle version, which would be really great IMHO.
Thank you & Best regards
Blama
I'm going to create a function for my product next year where I allow the user to define some kind of process.
My process will consist of steps:
- Do A
- If after time n the status did not change, do B
- If after time m the status did not change, do C
- ...
A process will be displayed and edited in a ListGrid "SELECT * FROM process where id=4711 ORDER BY position".
After every change of a row a "server constraint" should run. As the rules depend on many fields and also previous rows(!), I'll either use DataSource.validateRecord() you introduced here or a DMI I call to Create/Update/Remove after request.execute() (on violation of the rules, I'll return new DSResponse.setFailure(reason) then). So far I don't see problems here.
Now for the easy of editing, also persisted reordering like in this sample should be possible. This always results in a Queue with many operations. Here I only want to run my business-rule-check after the last request in the transaction. My questions are: How do I do this best? I think in validateRecord() can get from context -> getDSRequest() -> getRPCManager() to the RPCManager, but what then? How do I find out I'm not at the last request and should therefore skip my logic? Same for the DMI way, where I also have the RPCManager available: How do I find out I'm in the last request of a Queue?
Perhaps a boolean DSRequest.isFirstRequest() and boolean DSRequest.isLastRequest() would make sense?
More abstract: I'm looking for a way to express an INITIALLY DEFERRED constraint (or better: ASSERTION) in SmartGWT server code. How to do this best?
As this is not planned this year anymore, it is not urgent for me, but I'm very interested in your best practice here.
For anyone interested in the topic: With some luck, we are going to get CREATE ASSERTION in the next Oracle version, which would be really great IMHO.
Thank you & Best regards
Blama
Comment