Skip to main content
12-Amethyst
August 8, 2025
Question

Copy Primary file to attachment on check in and lifecyclestate

  • August 8, 2025
  • 2 replies
  • 671 views

Version: Windchill 12.1

 

Use Case: For exporting packages/deliveries we want the filenaming to be consistent: number_iteration_name_lifecyclestatus This is currently achieved by using the afterEDRloader script, and works on all published files, that are renamed and set as an attachment. We would like to do the same with the files where there is not generated a representation (currently CSV and ZIP). Suggestions to do this would be appreciated.


Description:

For exporting packages/deliveries we want the filenaming to be consistent: number_iteration_name_lifecyclestatus
This is currently achieved by using the afterEDRloader script, and works on all published files, that are renamed and set as an attachment.
We would like to do the same with the files where there is not generated a representation (currently CSV and ZIP).
Suggestions to do this would be appreciated.

 

One suggestion that I would like to validate the idea of before starting on an implementation:

Could we utilize the Custom Publishing filtering method to call a function that will copy the primary file to an attachment (similar to the afterEDRloader scripts)? 

2 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
August 11, 2025

Hi @JM_12529808 

A custom publishing is not the right way how to achieve what you need. 

The custom publishing sends the publish request to the queue based on your own logic.

This action can be somehow activated from a workflow, listener and so on. 

 

In my opinion the best way could be some short workflow after the document is ready to copy the content. For example set state.

But it depends on your needs. It can be a post check-in listener where you just create a copy of the content and save it as a attachment.

It can be done by own process queue where you could control the behavior.  

Also I would apply some logic that only needed objects are processed 

 

In the end any option is possible. 

 

PetrH

12-Amethyst
August 19, 2025

Hi PetrH

 

Thanks for pointing in this direction. After having read up a bit on workflows, I agree that this seems to be the right way. I will take a look into it, and see if I can figure out to set it up correctly.

 

 

18-Opal
August 11, 2025

@JM_12529808 , to be clear, you need the files in the zip file to be renamed using the object that the file was derived from’s number, iteration, name and lifecycle state.

 

This is very doable.

Do you want this to happen to ALL packages or is there a criteria that filters which packages would have their zip file contents renamed.

 

Send me private message if you want assistance.

 

David

12-Amethyst
August 19, 2025

Hi David

 

Thanks for taking the time to respond.

I dont want to rename the files in the ZIP file, I'll try to make it more clear:

I want to make a copy of CSV and ZIP files set them as attachement, with the name defined by: number_iteration_name_lifecyclestatus

 

As PertH have pointed out, workflows might be the correct solution.

18-Opal
August 19, 2025

I think I’d use a listener rather than a workflow but at the end of the day you just need to trigger code to run to create the attachments with the desired filenames.


You could also create a custom action to trigger the code that creates the attachments.

 

Lots of options. The way to proceed really depends on how your company works.

 

David