Advanced DECS usage
The typical DECS use is to define a data connection (tip use OLEDB not ODBC to connect to MS-SQL), a data-form mapping and import the primary keys. In the data form mapping (a.k.a Activity in DECS terminology) you set what events you want to monitor: create, read, update, delete. Typically works like a charm. Any data that is updated on the RDBMS is automatically pulled into the Notes form when opened. The biggest drawback: DECS doesn't monitor record creation or deletion on the RDBMS side (that is what besides other capabilities LEI is made for). So DECS seems to be confined to cases where creation/deletion is limited to a Domino side activity. Also DECS can't trigger stored procedures. With a little creativity however you can push the use of DECS far beyond that. I'll describe some use cases I came across where DECS was used to avoid mixing Domino and RDBMS code in a function or an agent:
- Employee information is stored in a RDBMS as part of the HRMS. The employee ID is populated into the Domino Directory (yes it has a field for that). In an Notes application data is needed from the RDBMS. Instead of writing LCLSX code the application simply looks up the empPara document that is linked to the RDBMS using DECS. The document might not exist yet (if the user never had used that application before). If it does not exist it is created and populated just with the EmpID. When closed and reopened it will pull the employee information from the RDBMS. This is possible since the DECS task only monitors read/update. A scheduled agent removes documents when there is no more match in the Domino directory. In summary: if you can anticipate or know the primary key of a record you need, you can use DECS by not monitoring creation/deletion.
- Based on a workflow stored procedures in a Oracle database need to be triggered. Here some work both on the RDBMS and the Domino side was done, clearly separating both. An auxiliary table was created in Oracle with an INSERT trigger, that would execute the stored procedure using parameters given in that table and write back the success of the operation. Initially it was planned to purge the table regularly (using a Domino agent deleting the documents) but then audit loved the additional documentation, so just archival was established. During the project there were a lot of changes on both ends, however the approach of using a trigger driven table proved to be very efficient to separate the two environments minimizing interference. E.g. one stored procedure would generate a unique identifier according to some obscure, constantly changing rule. By storing that result into the aux table and creating (after reading the document linked to that table) a corresponding Notes document (again create was not monitored in that scenario) application flow was seamless.
- Enterprise parameter management [Updated] was created in a RDBMS application. Many Domino applications would need to use these parameters. Instead of having LotusScript code in every application doing RDBMS lookups DECS was used to populate and update a parameter NSF. In the activity the option "leave values in documents" was selected, so fast selections (like @DBColumn or NotesView.getColumnValues) would work. Since parameter changes happened rarely a copy of the populate keys agent from the DECSAdm database was created that would periodically shut down the activity for the parameter NSF (only the activity not the whole DECS server), pull the keys from the RDBMS based on the activity definition but only insert new keys (the original agent duplicates keys when you run it twice). Lastly it restarts the activities in DECS.
- 


Comments
Is that true?
Thanks
Posted by David Leedy At 19:57:54 On 11/22/2008 | - Website - |
On the iSeries (which is not my core Domain) afaik DECS uses the data catalog, you remote data might work if it is in the local catalog.
Posted by Stephan H. Wissel At 23:57:24 On 11/22/2008 | - Website - |
Posted by Gerry Shappell At 00:25:45 On 11/23/2008 | - Website - |
Once could argue that a document is an abstraction and a very high level one at that.
I would say that people deal with summaries of vast data sets that are otherwise stored in collections or information elements (documents) or collections data elements (records). As such documents are a higher level abstraction partly constructed from relational data.
Posted by Slawek At 22:02:59 On 11/23/2008 | - Website - |
Don't get me wrong: RDBMS do a good job in abstracting/persisting/serializing/querying business data, so I wouldn't toss them out wholesale. However they are not the only way. You can see that in Domino's success being a document database and serving business needs very well. You also can see that in DB/2 where XPath is a valid option to ask for data. Check CouchDB, Cache, XMLdb, Perserve and friends for other approaches (which look suspiciously like document/object databases)
Posted by Stephan H. Wissel At 00:39:49 On 11/24/2008 | - Website - |
I am making a distinction between data and information. As such, I see data as machine oriented (re the machinery of business) and information as people oriented. To me the relationship between data and information is that data gets processed to become information, so that it can inform (information -> in-(a)-formation).
Before it was possible to store vast quantities of data, information was derived from "experience". Now we are in a position to infer information from the data that we gather as part of doing business.
UBL describes documents such as invoices, POs, etc. These are human readable documents that form part of the paper trail to record business activities. The "real" record of these activities is expressed as ledger entries. These entries then form the basis for planning and forecasting, the result of which is once again expressed in documents for the benefit of people.
Posted by Slawek At 02:25:08 On 11/24/2008 | - Website - |
Considering DECS in light of what I know now, I can see that with a better designed database this could certainly make a lot more sense than always coding LC LSX.
Thanks for bringing this up, I had dismissed DECS and LEI long ago since it didn't fit my needs. I'm glad you made me reconsider it.
Posted by Charles Robinson At 00:28:53 On 11/26/2008 | - Website - |