We are on Tririga 11.1 / Platform 4.1.1
We have a use case where we are using a OCR / Scanning solution to extract data from the Payables Invoices we receive from our Vendors.
We create Payment Records (Invoices) for our Leases in IBM Tririga using IO imports.
We also want to create IBM Tririga Documents using the pdf files that we send for OCR / Scanning. And create an association between the Invoice Records and the Document record in IBM Tririga.
To create the Document in IBM Tririga we are using
Step 1. Create the Document Record using IBM Tririga Connector for Business Application saveRecord API https://<tririga-url>/ws/TririgaWS operation saveRecord
Payload
<ws:saveRecord xmlns:ws="http://ws.tririga.com">
<ws:IntegrationRecords xmlns:dto="http://dto.ws.tririga.com">
<!--Zero or more repetitions:-->
<dto:IntegrationRecord>
<dto:actionName>CREATE</dto:actionName>
<!--Optional:-->
<dto:guiId>106615</dto:guiId>
<dto:id>-1</dto:id>
<!--Optional:-->
<dto:key>string</dto:key>
<dto:moduleId>11</dto:moduleId>
<!--Optional:-->
<dto:name>Document</dto:name>
<!--Optional:-->
<dto:objectPath>\ROOT\Object Attachments\InvoiceFolder</dto:objectPath>
<dto:objectTypeId>106615</dto:objectTypeId>
<dto:objectTypeName>Document</dto:objectTypeName>
<!--Optional:-->
<dto:projectId>1</dto:projectId>
<dto:sections>
<!--1 or more repetitions:-->
<dto:IntegrationSection>
<!--Optional:-->
<dto:fields>
<!--Zero or more repetitions:-->
<dto:IntegrationField>
<dto:name>Name</dto:name>
<dto:value>ABC-Test-Doc9999.pdf</dto:value>
</dto:IntegrationField>
</dto:fields>
<dto:name>General Info</dto:name>
</dto:IntegrationSection>
</dto:sections>
</dto:IntegrationRecord>
</ws:IntegrationRecords>
</ws:saveRecord>
We are succesfully getting a recordId Back and can see it in IBS_SPEC. We also compared the API created record to a Document created from UI (Document Manager) and it looks good. We can also see this record in Document Manager (without the file)
Step 2. Upload the file to the Document Record using IBM Tririga Connector for Business Application upload API https://<tririga-url>/ws/TririgaWS operation upload
Payload
<ws:upload xmlns:ws="http://ws.tririga.com">
<ws:content xmlns:con="http://content.dto.ws.tririga.com">
<con:content>ZQ==</con:content>
<con:recordId>10</con:recordId>
</ws:content>
</ws:upload>
recordId - The recordId (IBS_SPEC_ID) got from step 1.
content - passed binary content. Also tried Bas64 content, Also tried Byte Array Content without any success
API is giving below error when binary is being passed
<ns2:message>
PreparedStatementCallback; SQL [INSERT into DM_UPLOAD ( token, filename, filesize, userid) values(?,?,?,?)]; ORA-01400: cannot insert NULL into ("TRIRIGA"."DM_UPLOAD"."FILENAME")
; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("TRIRIGA"."DM_UPLOAD"."FILENAME")
</ns2:message>
Document clearly states that for "Document" objects we shouldn't pass File Name, It will take it from Record.
fileName - If the record is a Document object, the file name from the record will be used.
Has someone used IBM Tririga Connector for Business Application to create Documents with Binary Files.
We really appreciate your help.
------------------------------
Vikram Hebbar
------------------------------