Here's the background:
I'm executing a mapping using the template "INTEGRATION Rdbms to Wsdl". The mapping is part of a process executed as a delivery where 10 sessions run in parallel.
Here are the errors:
Engine Exception : Impossible to replace file:/Applications/Stambia/StambiaDesigner18.1/stambiaRuntime/temp/_xcCTwy2YEeaUi6BCFjsWuw.xml
Engine Exception : /Applications/Stambia/StambiaDesigner18.1/stambiaRuntime/temp/_xcCTwy2YEeaUi6BCFjsWuw.xml (No such file or directory)
Troubleshooting:
I watched the files being created here: StambiaDesigner18.1/stambiaRuntime/temp
I see many files created with names like this: 1465663175019.temp.1._xcCTwy2YEeaUi6BCFjsWuw.xml
But I see only one file with a name like this: _xcCTwy2YEeaUi6BCFjsWuw.xml
It appears that most steps in the template are creating temp files based on the session ID. This is good.
But one step in the template is using a filename based on the delivery name. This is bad because the parallel sessions interfere with each other.
When I look at the variables for this step I can see the issue:
IN_FILE_NAME: /Applications/Stambia/StambiaDesigner18.1/stambiaRuntime/temp/_xcCTwy2YEeaUi6BCFjsWuw.xml
I can set the RECEIVED_MESSAGES_FOLDER and SENT_MESSAGES_FOLDER. But I don't see how to set the IN_FILE_NAME.
Probably I'm failing to set some parameter correctly for the integration template. But when I set "Out File Name" I get errors. Here I set the out file name to "abc":
Engine Exception : null/1465673579932.temp.1.abc (No such file or directory)
I see that my param was taken into account. But I don't know how to control that
null at the beginning of the file path.
My solution:
I edited "INTEGRATION Rdbms to Wsdl". I changed the Code for the XSL variable "fileName"
original (whitespace added for readability in this post):
md:ifEmpty(
md:paramValue($this,'OUT_FILE_NAME'),
$REF/ref:target()/tech:xmlFilePath(),
concat('${/CORE_TEMPORARY_FOLDER}$/',$REF/ref:target()/@id,'.xml')
)
modified (whitespace added for readability in this post):
md:ifEmpty(
md:paramValue($this,'OUT_FILE_NAME'),
$REF/ref:target()/tech:xmlFilePath(),
concat(
'${/CORE_TEMPORARY_FOLDER}$/',
concat('${/CORE_SESSION_ID}$',$REF/ref:target()/@id,'.xml')
)
)
Also, I changed the Triggering Behavior on the link to FileDelete. I made it non-mandatory from SqlToXml to FileDelete (mandatory didn't really make sense here). And I changed the outbound link from "Call WebServices" to go to FileDelete instead of going directly to "Unlock of CDC table". That way my files get cleaned up. When the same file name gets reused as it was in the original, then keeping it forever isn't really an issue. But with my change I would accumulate temp files.
Can you please validate this fix? Is this a good way to fix the template's inability to handle concurrent executions? Is there a better or easier solution?