Document attachments in a form or process
Hi,
I was trying to add document attachments based on https://access.redhat.com/documentation/en-us/red_hat_process_automation_manager/7.5/html/designing_business_processes_in_business_central/business-process-forms
I can attach a document in a form but the document was failed to be created in RHPAM:
15:03:41,462 ERROR [org.jbpm.document.service.impl.DocumentStorageServiceImpl] (default task-2) Error writing file D:\test\a.pdf: {}: java.io.IOException: Directory '.docs\388f4d34-b732-48d6-b898-d00fd8bb1cf3\D:\test' could not be created
at org.apache.commons.io.FileUtils.openOutputStream(FileUtils.java:361)
at org.apache.commons.io.FileUtils.writeByteArrayToFile(FileUtils.java:2222)
at org.apache.commons.io.FileUtils.writeByteArrayToFile(FileUtils.java:2186)
at org.apache.commons.io.FileUtils.writeByteArrayToFile(FileUtils.java:2171)
at org.jbpm.document.service.impl.DocumentStorageServiceImpl.saveDocument(DocumentStorageServiceImpl.java:87)
at org.jbpm.document.marshalling.DocumentMarshallingStrategy.marshal(DocumentMarshallingStrategy.java:73)
at org.jbpm.marshalling.impl.ProtobufProcessMarshaller.marshallVariable(ProtobufProcessMarshaller.java:269)
at org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller.writeProcessInstance(AbstractProtobufProcessInstanceMarshaller.java:164)
at org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller.writeProcessInstance(AbstractProtobufProcessInstanceMarshaller.java:75)
at org.jbpm.persistence.processinstance.ProcessInstanceInfo.transform(ProcessInstanceInfo.java:244)
at org.drools.persistence.TriggerUpdateTransactionSynchronization.beforeCompletion(TriggerUpdateTransactionSynchronization.java:61)
at org.drools.persistence.jta.JtaTransactionSynchronizationAdapter.beforeCompletion(JtaTransactionSynchronizationAdapter.java:54)
at org.jboss.as.txn.service.internal.tsr.JCAOrderedLastSynchronizationList.beforeCompletion(JCAOrderedLastSynchronizationList.java:113)
at org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:236)
at org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:247)
at org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization.beforeCompletion(AbstractTransaction.java:292)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:360)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:91)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1287)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
Responses
Hi Rudyanto,
by looking at the path '.docs\388f4d34-b732-48d6-b898-d00fd8bb1cf3\D:\test' which is constructed from document storage path + document identifier + document name it seems that for some reason you specified the document name to be 'D:\test\a.pdf'. Can you specify the document name to be just a.pdf? Then the directory to save a document would look like '.docs\388f4d34-b732-48d6-b898-d00fd8bb1cf3' which is a valid path.
Marian
I have just tried the same scenario on Linux (Fedora) and the issue is not present there. So it seems it's an issue specific to Windows environment. I have created a JIRA to track this issue: https://issues.redhat.com/browse/RHPAM-3117.
Feel free to add any comments you have there. Thanks for letting us know!
Marian
Hi Rudy,
the URL is definitely there, but it changes according to your project name, so in general it looks like this:
http://localhost:8080/kie-server/services/rest/server/containers/{nameOfContainer}/processes/{nameOfProcessDefinition}/instances
Maciej's container and process definition were called translations in his example. You should alter the URL to your use case.
Marian
Thanks for the reminder, I didn't check the rendered response after I posted the message, corrected now.
Hi Rudy,
I tried to reproduce the issue by following the steps in the documentation you mentioned, but I'm unable to reproduce it in my Windows 10 instance. Can you please send us a video recording and details of your environment you are using.
Thanks, Abhishek