Cancel
Showing results for 
Search instead for 
Did you mean: 

Delay Teamcenter subprocess

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hello everybody,

 

I've created 2 workflows in Teamcenter 11.3: Released and PLMXMLExport
the Workflow Realesed releases the itemrevision and creates a pdf in TC then it calls the suprocess PLMXMLExport.
The Worklfow PLMXMLExport exports the generated PDF to the file system.
The two workflows work well alone. but together it does not work.
Because the Subprocess PLMXMLExport tries to export the pdf immediately, while the PDF has not yet been converted.
Therefore my question can i delay in the subprocess PLMXMLExport until the PDF is generated? or is there another solution?

 

Thanks a lot

11 REPLIES

Re: Delay Teamcenter subprocess

Legend
Legend

How do you create the PDF?

With dispatcher translator? then just add a copy-command to the translator and you can skip the export.

Frederik Verscheure
Evolve Consulting bvba
Freelance NX & Teamcenter consultant
frederik@evolve-consulting.be

Re: Delay Teamcenter subprocess

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

yes. i create the PDF with the dispatcher translator.

i don't want to skip the export. 

What i want is: the 0PLMXML Export should be executed  after the dispatcher has generated pdf.

at the moment the 0PLMXML is exucuted immediatly with no pdf because the PDF has not been created yet.

After 20s or 30s the generated pdf appears in the ItemRevision, but than but then it is too late ( subprocess 0PLMXML already executed).

Re: Delay Teamcenter subprocess

Legend
Legend

I don't think you can make the workflow wait until the PDF is generated. Unless you have a custom handler

But you can make the workflow wait for a fixed time.

 

just use handler "EPM-invoke-system-action"

put a batch-script on the server and use this as argument of the handler.  i.e: C:\PLM\PLMShare\Workflows\wait.bat

 

content of wait.bat

"Timeout 60"

 

This will make the workflow wait 60secs. But you need to be sure this time is enough.

You can push it even further and check if a file exists on the file system. (like i said before copy thepdf to specific location.) And then write a loop in wait.bat to check if the file exists. (delete the file afterwards).

 

Frederik Verscheure
Evolve Consulting bvba
Freelance NX & Teamcenter consultant
frederik@evolve-consulting.be

Re: Delay Teamcenter subprocess

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Thank you. It works.

but the Dialog "new process" still displayed during the time of convertion of pdf.

is there a way to hide it, so that the user can work at this time and does'nt have to wait?

Re: Delay Teamcenter subprocess

Legend
Legend
Put the wait in the sub-process



Sent from my Samsung Galaxy smartphone.
Frederik Verscheure
Evolve Consulting bvba
Freelance NX & Teamcenter consultant
frederik@evolve-consulting.be

Re: Delay Teamcenter subprocess

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

i already do.

the Dialog still opened while converting (about 3 minutes with more Formats: JT and STEP)

Re: Delay Teamcenter subprocess

Phenom
Phenom

I havent tested this, so I have no idea of how it will effect performance....or if it will work!

 

You could have the worklfow loop until the pdf is attached by having one task with epm-attach-related-object handler on trying to attach the pdf to the targets and then a query to see if the PDF has been attached, or if the number of targets =1.

 

The workflow could stay in this infinite loop until dispatcher creates and uploads the pdf.

 

You might have the same problem where it stays with that user, but maybe you could change who the responsible party is and it could sit with another user?

 

There maybe something I have put that can help? Or not!

 

Richard

Richard Bennett
PLM Consultant
www.ProspectPLM.co.uk

Re: Delay Teamcenter subprocess

Experimenter
Experimenter

@ProspectPLM wrote:

I havent tested this, so I have no idea of how it will effect performance....or if it will work!

 

You could have the worklfow loop until the pdf is attached by having one task with epm-attach-related-object handler on trying to attach the pdf to the targets and then a query to see if the PDF has been attached, or if the number of targets =1.

 

The workflow could stay in this infinite loop until dispatcher creates and uploads the pdf.

 

You might have the same problem where it stays with that user, but maybe you could change who the responsible party is and it could sit with another user?

 

There maybe something I have put that can help? Or not!

 

Richard


I wouldn't do this or any other custom programing (custom handlers) to loop workflow....... custom handler executes on the server side and server side is single threaded process. Any kind of infinite loop on the server side will tieup user's session.

 

However, if you must do this, implement some kind of timeout to break the loop.

Re: Delay Teamcenter subprocess

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

ok thank you.

that does not seem to work as I thought.

what about this way:

the workflow released can be used normally without subprocess PLMXMLEXPORT.

and every day at night a PLMXML Export as Batch will be automatically executed, and exports the Datasets (PDF,JT) from the released ItemRevision.

now how should my Batch File looks like so that i can export the Datasets from the released Items?