Unsolved
This post is more than 5 years old
1 Message
1
1185
May 20th, 2012 18:00
Read config data from file in xPression
I am very new to xpression, i.e. I am team leader for a number of xPression developers. I have a development background and having looked at some of the documents the team have developed, I have a question around the ability to read data from a config file/database at run time. The scenario is as follows. Our company has two sales channels that have different phone numbers for the sales office. As a result the developers have developed something like this based on the fact that the company identifier is passed in the XML...
a variable PHONE_NUMBER' is initiated for a phone number. Then the following logic has been programmed...
If company = 'A' then
PHONE_NUMBER = '111111111111'
Else
PHONE_NUMBER = '222222222222'
Considering that we have a LOT of documents and this logic exist in almost all of them, the developer in me says there HAS to be a better way to do this, i.e. read the phone numbers from a config file or something. A change of phone number will mean ALL the documents will have to be changed!!!! Can anyone tell me whether this is possible?
Thank you in advance.



R_14
3 Posts
1
May 25th, 2012 22:00
Hi Rediroma,
Yes it is possible !
We can achieve your requirement by using USE EXIT
About USER EXIT:
1 Java function can be invoked with any number of input parameters (static / dynamic variables) of any type (number/string) from xPression.
2. The java function will be processed by the Application server.
3. After processing the input, a java USER EXIT function can return only a String value back to xPression, The returned value is used to populate in the output .
shankargk
4 Posts
0
June 8th, 2012 08:00
Hi R@ju,
We are passing payload xml through web services to invoke document generation. I am trying to parse payload xml in user exit routine to apply more business rules from database.
I used sample UserExitTest (extends from UserExitDataReader) from the documentation and configured user exit data source from xAdmin. For some reasons, this method is not getting invoked during assembly/publishing. Is there is any documentation or any set of instructions to invoke this method?
Thanks
Shankar
R_14
3 Posts
0
June 13th, 2012 01:00
Hi Shankar,
I guess you are deviating from your requirements, by referring to USER EXIT AUTHENTICATION in the user guides.
There is a lot of difference between USER EXIT AUTEHNTICATIONS and document level USER EXITS
Creation of USER EXIT is a bit different and, it not mentioned clearly in the user guides.
So, I have generated a document which will help you in creating USER EXITS and get the things done!
http://dl.dropbox.com/u/81851060/Steps%20Involved%20in%20creating%20a%20UseExit.pdf
I am attaching it to the same thread, Please let me know if you have any concerns
Thanks,
Raju