Skip to main content
Solved

Can't create the destination folder by using the user parameters?

  • September 5, 2022
  • 8 replies
  • 77 views

Forum|alt.badge.img

model with errorDoes anyone know what causes the error?

Best answer by caracadrian

You can create a Custom Transformer containing a single AttributeCreator

Create Custom transformerCreate two Choice User Parameters in it, one for borehole/CPT and one for Route.

Manage User ParameteresParameter choiceNow in AttributeCreator create an attribute with Conditional value. If Parameter1 equals CPT -> a concatenation of both Parameters with the necessary slashes, else, just the first Parameter.

View original
Did this help you find an answer to your question?

8 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • September 5, 2022

Can you provide screenshots of the StringExtractor and Replacer settings?

I believe you are inserting invalid characters.


Forum|alt.badge.img
  • Author
  • September 6, 2022

stringreplacersubstring extractor


evieatsafe
Safer
  • Safer
  • September 6, 2022
bascopier wrote:

stringreplacersubstring extractor

Hi @bascopier​ I'm not sure why your workspace cannot create the destination folder, but it might be that for whatever reason the StringReplacer is not recognizing the @Value for the value of _substring. However, if you are simply wanting to concatenate the .pdf to the _substring attribute value I would suggest using the StringConcatenator. The parameters would look something like this:

image 

May I also ask what version of FME you are using?


Forum|alt.badge.img
  • Author
  • September 7, 2022

I added the string concenator as you said. So far I have a model that allows me to change the names of the PDF files from a certain folder. I'm using FME workbench 2022.0.0.2.

 

The next step is to save these PDF files to another folder. However, I want to be able to indicate to which specific folder the files are written every time I run the model, because it differs every time.

 

I want to be able to determine the location of the destination folder using drop down menus. The link to this location is made up of:

 

- A fixed location on the drive that remains unchanged (no drop down)

- Choice between a borehole and a CPT (drop down)

- Choice between route 1 and route 2 (drop down)

 

So I:\\fixedlocation\\bore or CPT\\section 1 or 2

 

I tried using user parameters and the file copy writer, but kept getting errors. Do you have any suggestions on how I can make this run smoothly with the right writer and (user) parameters?

 

Below is the model without the writer:

fme model pdf's 

I like to hear it,

 

Gr. Bas

 


Forum|alt.badge.img
  • Author
  • September 19, 2022

Hi @Evie Lapalme​ ,

Do you have an idea how I can solve the above problem?

 

Gr. Bas


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • Best Answer
  • September 19, 2022

You can create a Custom Transformer containing a single AttributeCreator

Create Custom transformerCreate two Choice User Parameters in it, one for borehole/CPT and one for Route.

Manage User ParameteresParameter choiceNow in AttributeCreator create an attribute with Conditional value. If Parameter1 equals CPT -> a concatenation of both Parameters with the necessary slashes, else, just the first Parameter.


jkr_wrk
Influencer
Forum|alt.badge.img+29
  • September 19, 2022
bascopier wrote:

I added the string concenator as you said. So far I have a model that allows me to change the names of the PDF files from a certain folder. I'm using FME workbench 2022.0.0.2.

 

The next step is to save these PDF files to another folder. However, I want to be able to indicate to which specific folder the files are written every time I run the model, because it differs every time.

 

I want to be able to determine the location of the destination folder using drop down menus. The link to this location is made up of:

 

- A fixed location on the drive that remains unchanged (no drop down)

- Choice between a borehole and a CPT (drop down)

- Choice between route 1 and route 2 (drop down)

 

So I:\\fixedlocation\\bore or CPT\\section 1 or 2

 

I tried using user parameters and the file copy writer, but kept getting errors. Do you have any suggestions on how I can make this run smoothly with the right writer and (user) parameters?

 

Below is the model without the writer:

fme model pdf's 

I like to hear it,

 

Gr. Bas

 

Maybe writing the UserParameter to a Feature Attribute with an AttributeCreator solves your arr... eh error.

 

Sometimes using a UserParameter in other Transformers does not work as expected, matey


evieatsafe
Safer
  • Safer
  • September 19, 2022
bascopier wrote:

I added the string concenator as you said. So far I have a model that allows me to change the names of the PDF files from a certain folder. I'm using FME workbench 2022.0.0.2.

 

The next step is to save these PDF files to another folder. However, I want to be able to indicate to which specific folder the files are written every time I run the model, because it differs every time.

 

I want to be able to determine the location of the destination folder using drop down menus. The link to this location is made up of:

 

- A fixed location on the drive that remains unchanged (no drop down)

- Choice between a borehole and a CPT (drop down)

- Choice between route 1 and route 2 (drop down)

 

So I:\\fixedlocation\\bore or CPT\\section 1 or 2

 

I tried using user parameters and the file copy writer, but kept getting errors. Do you have any suggestions on how I can make this run smoothly with the right writer and (user) parameters?

 

Below is the model without the writer:

fme model pdf's 

I like to hear it,

 

Gr. Bas

 

Hi @bascopier​ I'm not sure you can have a choice parameter of three potential drop downs as a single parameter. However, you can have multiple different types of parameters (choice/drop downs and file/url) and then combine them in an AttributeCreator with conditional values inside a custom transformer to then use the new attribute as the directory path you are looking for. Similar to @caracadrian​ 

 

Another option is to script your user parameter. I personally have no experience doing this, but have seen it done previously. This would allow you to have the parameter exactly as you described without having to go and make a custom transformer.image


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings