Can't apply output mask functions to user defined metadata

When defying an output preset mask the documentation shows several possibilities Variables available in the Output

Specifically the padding of numbers works fine when using connect built-in variables like ${file.nr,000}, but fails when using user defined ones like ${set.metadata.IDPLICO,000}.

From the Job Preset where the IDPLICO metadata field is first added to the document set metadata fields there is no possibility to specify the value type. From the error, I assume that every metadata field is treated like a string.

I could pad the variable from the datamapper, however, I need to use it not padded in the template and pad it only in the filename. So I would need to duplicate the record property, which is undesirable.

There was an error initiating to the output creation process caused by ApplicationException: cannot format value of class ‘java.lang.String’ at line 1, column 43 in pattern ‘${set.metadata.JOB}${set.metadata.JOB}_${set.metadata.IDPLICO,000}.pdf’

ERROR [21 Feb 2024 11:41:27,867][Worker-17: Printing via the Print Server] com.objectiflune.application.designer.editors.operations.PrintServerOperation.a(PrintServerOperation.java:-1) An unspecified error occurred which was caused by LoggedApplicationException: There was an error running the output creation process caused by There was an error initiating to the output creation process caused by ApplicationException: cannot format value of class 'java.lang.String' at line 1, column 43 in pattern '${set.metadata.JOB}\${set.metadata.JOB}_${set.metadata.IDPLICO,000}.pdf' (SRV000041) (SRV000001)
    com.objectiflune.core.base.ApplicationException: An unspecified error occurred which was caused by LoggedApplicationException: There was an error running the output creation process caused by There was an error initiating to the output creation process caused by ApplicationException: cannot format value of class 'java.lang.String' at line 1, column 43 in pattern '${set.metadata.JOB}\${set.metadata.JOB}_${set.metadata.IDPLICO,000}.pdf' (SRV000041) (SRV000001)
    	at com.objectiflune.core.rest.clients.BaseRestClient.checkResponse(BaseRestClient.java)
    	at com.objectiflune.core.rest.clients.AuthenticatingBaseClient.invokePOST(AuthenticatingBaseClient.java)
    	at com.objectiflune.core.rest.clients.BaseRestClient.invokePOST(BaseRestClient.java)
    	at com.objectiflune.core.rest.clients.AllInOnePrintRestClient.invokePOST(AllInOnePrintRestClient.java)
    	at com.objectiflune.core.rest.clients.AllInOnePrintRestClient.execute(AllInOnePrintRestClient.java)
    	at com.objectiflune.application.designer.editors.operations.PrintServerOperation.a(PrintServerOperation.java)
    	at com.objectiflune.application.designer.editors.operations.d.run(d.java)
    	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
    Caused by: javax.ws.rs.WebApplicationException: HTTP 500 Internal Server Error
    	... 8 more

Try specifying ${parseInt(set.metadata.IDPLICO),000}.

1 Like