Skip to main content
1-Visitor
October 18, 2016
Solved

AfterEDRloader

  • October 18, 2016
  • 1 reply
  • 2676 views

I have set up the AfterEDRloader according to CS216668.

Everything is working fine. My pdf is shown as an attachment.

But I want to add the lifecycle state in the filename. This should not be that hard to do?

I guess I just need to modify the AfterEDRloader.java file but I dont know how exactly.

Anyone with experience of the AfterEDRloader method?

Best answer by BjoernRueegg

You can add it e.g. in the method renameAdditionalfiles

if (fileExt.equals("zip"))

  {

  sFileName = sFileName.substring(0, sFileName.lastIndexOf(".")) + "_" + iterationInfo +  "_" + postfix;

  } else {

  sFileName = sFileName.substring(0, sFileName.lastIndexOf(".")) + "_" + iterationInfo + cadDoc.getLifeCycleState().getDisplay(Locale.US) + "." + fileExt;

  }

1 reply

17-Peridot
October 18, 2016

You can add it e.g. in the method renameAdditionalfiles

if (fileExt.equals("zip"))

  {

  sFileName = sFileName.substring(0, sFileName.lastIndexOf(".")) + "_" + iterationInfo +  "_" + postfix;

  } else {

  sFileName = sFileName.substring(0, sFileName.lastIndexOf(".")) + "_" + iterationInfo + cadDoc.getLifeCycleState().getDisplay(Locale.US) + "." + fileExt;

  }

1-Visitor
October 18, 2016

Thanks!

Yes, thats kind of how I solved the problem, I added:

String StateInfo = ((EPMDocument)ch).getLifeCycleState().toString();

and

String StateInfo = cadDoc.getLifeCycleState().toString();

and then called + StateInfo + for sFileName.

Now my problem is that the "publisher" will not publish the file under attachment when the state is changed. In my case when a drw is released.

even though I have set: publish.republishonepmdocumentchange=true

17-Peridot
October 19, 2016

The file is not being published as attachment. The step or dxf will be included in the representation itself. You need to set the preference to ALL or the appropreate value to download the secondary files.

Capto_Capture 2016-10-19_08-00-42_AM.png