Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
I am wondering if it is possible to export a document via a trigger, but I would like to be able to select a template item from the Gateway Export Wizard.
Additionally, I would then like to be able to take the exported document and send via e-mail attachment in the trigger.
Does anybody know if this is doable?
Solved! Go to Solution.
Doable, YES.
Recommended, IMHO NO.
1. The main point is that the server side trigger framework depends on "quick responding" triggers scripts, as a running script is a "blocking" single task.
The export of document can take up to minutes, based on the size of the document and it's attachments. During the export no other trigger script can be performed which might lead to nasty user experience in other areas.
2. you would need a installed client (that contains the gateway) on your server machine. Performing exports on your server would also store all the temporary data that is needed on your server machine. So you would need extra maintenance and care to cleanup your server's file-system after an export.
We use a design where the trigger in integrity only "fires" and event that is performed by a second server (Jenkins). The Jenkins Server performs the export just as any other build job in a temporary workspace and cares for archiving result and cleaning up temporary files itself.
HTH Matthias
Doable, YES.
Recommended, IMHO NO.
1. The main point is that the server side trigger framework depends on "quick responding" triggers scripts, as a running script is a "blocking" single task.
The export of document can take up to minutes, based on the size of the document and it's attachments. During the export no other trigger script can be performed which might lead to nasty user experience in other areas.
2. you would need a installed client (that contains the gateway) on your server machine. Performing exports on your server would also store all the temporary data that is needed on your server machine. So you would need extra maintenance and care to cleanup your server's file-system after an export.
We use a design where the trigger in integrity only "fires" and event that is performed by a second server (Jenkins). The Jenkins Server performs the export just as any other build job in a temporary workspace and cares for archiving result and cleaning up temporary files itself.
HTH Matthias
Thank you, Matthais, for the great information. I understand the drawbacks of doing it this way; it seems like it would cause a lot of server headaches.
This was in attempt to try to export a document during review process that could e-mail the document to non-PTC Integrity users. My supervisor was hoping to use a particular template format for export. I guess my other option is to just call a 3rd party executable that could run in the background to generate a document export and e-mail.
Thanks again for the info.
To get the best of both worlds, you could have the trigger send a message to another process, which would independently make the command line calls. If you wanted to minimize the lifting within the trigger, you could have your other process be kicked off by an email sent from an emailAdvanced trigger, with the content of the message being the document ID and maybe the export configuration to use. This would let your trigger complete quickly, but still produce the content for you.
The harnessing challenge, then would be having an email handler kick off your process, rather than having JavaScript kick it off. The difficulty is probably comparable, but you have the benefit of freeing the scheduled triggers queue relatively quickly.
If turn-around time wasn't a factor, you could even queue the processing to happen during off hours, assuming you're not a 24/5 or 24/7 shop.
Regards,
Kael
Hello Martin,
This certainly isn't something that Integrity Lifecycle Manager will do out of the box. While I'm not certain it's doable, I can provide some more information.
So yes, I think it's doable,
Regards,
Kael
I see Matthias beat me to the punch here. His point about blocking is particularly pertinent, if you're trying to export a large document.
Kael,
Thanks for the additional information. I think this should definitely help with what I'm trying to accomplish. I think using Javascript to call the command line with gateway.exe is the way to go.
Thanks again.
Regards,
Martin