register the second schema in the web.xml configuration file (see documentation, chapter “Extended Tutorial Using Multiple Schemas”
use a document name for your “main” document (if not, current is implicitly used)
on the create page of the main document you need to create the second document using <bdm:directcommand type=“create” schema=“theLogSchema” document=“logDocument”/>.
in the commit action you need to include both documents in one transaction. Use <bdm:action type=“commit” form=“form1” document=“logDocument,mainDocument”>…link …</bdm:action>
you could use the JSP Logging facility (introduced with X-Application 3.1.2) to check on runtime for created documents, their document names, …
Check the
Documentation chapter “Working with Multiple Document Instances in one Application” => “Creating Multiple Documents” for the creation of multiple documents
Invoice example (xappdir/examples/jsp/invoice/modify.jsp) for the commit action of multiple documents
Tell me, if you don´t succeed (or if you succeed )
where do the values of the log document come from in case of create/modify?
If you create a document e.g. via directcommand the document is expected to be empty. X-Application’s create command creates a new document and adds the mandatory structure of the document (== non optional elements) automatically .
If you need to copy some data from the main document to the log document I see some possiblities: 1. Use Javascript and 2 hidden fields 2. Use JSP Code and X-Application´s Java API 3. Encapsulate solution 2 in your own tag
If you need some hints on these solutions I could give more details.