Skip to main content

model with errorDoes anyone know what causes the error?

Can you provide screenshots of the StringExtractor and Replacer settings?

I believe you are inserting invalid characters.


stringreplacersubstring extractor


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?


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 @Evie Lapalme​ ,

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

 

Gr. Bas


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.


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


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


Reply