I am trying to write a simple emergency script which change the value of the keyword in an xml template file depending on the code entered.
I have these two files in my en_US folder in my document repository.."template.xml" which has this
<?xml version="1.0" encoding="ISO-8859-1"?>
I have used the create file step to create a file based on this template.xml file and referenced this is my create xml document step. My full script is attached in a word document.
The problem I am having is that at the upload document step, the script fails. When I look at the log it says that "java exception....file template.xml (no such file or directory)
SO it has a problem finding the template.xml file. I have used diferent file names such as "\en_US\template.xml" and "\template.xml" all to no avail.
No matter what I do it just keep saying it cant find the "template.xml" file
Can someone please help me look at this script and point me in the right direction.
NB: in my log the script succesfully says its going to replace the keyword %value% with "closed" as expected but then it says it cant find the template.xml file..
Can you please try uploading this xml document manually in the ucx appadmin->application->document management (under the sam path as above) and see if you are hitting the same issue as here.
Note: Is it zipped or unzipped?
Is there any other way to upload the document apart from this way. This is how I uploaded the xml file innitially. I am not aware that there is another way to upload it..Is there some where else I need to put this file. So yes I have already done this and still says file doesnt exist
When you read the template, refer to it as DOC["template.xml"] (no leading slash, assuming that it's un en_US and your trigger language is en_US). If you look at the java exception it will show you the full path it has tried to access and this should help you work out the problem.
So I have changed the template.xml to DOC["template.xml"] as suggested. I no longer get file cant be found. But the value of the keyword %value% in the the template file is not been changed. The upload step upload the emergency.xml as the template file. The state variable is not been inserted into the keyword. When I loked at the trace, it did state that %value% will be transfoirmed to "closed" on the key word transform text step.
and then I see another error, I belive its due to the fact that the value of the template file is not changed, the get xml document stepo fails with
"887876: Mar 04 14:07:28.822 GMT+0000 %MIVR-STEPS_DOCUMENT-7-UNK:Task: 26000000021 Could not get a value from a document variable that has not been created by the Create XML Document Step:'statusDoc'"
I also get the same when I do a reactive script debugging.. Attached is the script again and the errors from reactive debugging
Any ideas with this..Its doing my head in..Cant seem to figure out why the keyword is not been transformed to the current state of the emergency script
The error is basically saying "You are asking me to read an XML document which has not been through the Create XML Document step."
It thinks that because you are overwritting the variable "statusDoc" after the Create XML Document step with the Keyword Transform Step.
Either, arrange your scripting logic so it doesn't happen, or create a new Document variable to use on the Keyword Xform step, and that should take care of it. Make sense?
Many thanks for your response. I understadn what you are saying. I am sure I did this as part of my tickering while I was having issues with the transform step.
Here is what I have originally..
currentDoc=create file document ("template.xml")
docTemplate=create xml document (DOC["template.xml"])
statusDoc=Keyword Transform Document (docTemplate). (and I specified that the keyword "%value%" should be mapped to "state" variable which is already determined earlier in the script.
As you can, the keyword transform step should be acting on the key template (docTemplate) and the output variable should be statusDoc.
Now the challenge I have had all days (over 4 dyas on this now) is that hte %value% keyword is not been replaced by the state variable. The same keyword is inserted into the resulting uploaded document.
Thisis where I am stucked..Is there anything I am doing wrong with this script?
Does this other thread help you? I spent a lot of time explaining how this type of solution works, and would like to know if it helps you too. Please rate all helpful posts. Thanks.