Get document reference as output based on document name

Hello,

Is it possible to create a service which takes as input the name of a specific document and returns as output the corresponding document reference?

At runtime, there is no such thing as document reference. There are just documents. References exist only at design time to make development (type reuse) easier.

So, the answer to your question is: No, it’s not possible since there is no such thing.

This is what I am trying to achieve: I have some publishable documents which have the exact structure, just their names are different.
They are named like following:doc_trigger%DataType% and each one of them have two string fields: country and filename.
I want to dinamically map such a document based on his name(which is taken from a config file) and then publish the document on the broker.
Let’s say I have dataType ‘X’ in the config->then it should map a document with the name doc_triggerX and publish it on the broker.
The goal is basically to avoid changing anything in the flow when the client requests new transfers for other data types so that the only change to make should be in the config file.
Is there any workaround for this?

Hi Avram,

unfortunately I have to agree with fml about this.

Can you provide some sample code of your requirement?

Regards,
Holger

Then just do it like this: Create a document (without any type) and place two values there, under the names “country” and “filename.” Then call “publish” and specify the created document as the “document” and “doc_trigger%DataType%” as “documentTypeName.”

Little late to reply but hope it helps…!!!

why don’t you add another field in the document namely dataType and map the value of the specific data type to this field and then publish it to Broker. On the subscribing side, based on the value of the dataType field, you can branch and setup your processing logic accordingly.

Even if your customer adds new dataType’s in future, you can manage it by extracting the dataTypes from config while your subscribing side code is being processed.

regards,
Kushal