Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Question Integrate more than file

More
01 Sep 2015 17:39 #1 by Anas
Integrate more than file was created by Anas
Hello,

I want to integrate more than xml file at the same time using "XML_Validator", I use for this "WaitFile" and in the parameter WAIT_FILE_NB_FILES I put -1, the problem is in the "XML_Validator", I can't give it the path of the new file, how can I solve this problem ?

regards
More
01 Sep 2015 18:01 #2 by Thomas BLETON
Replied by Thomas BLETON on topic Integrate more than file
Hi,
What is "XML_Validator" ? How is it executed ?
What kind of link did you place between WaitFiles and "XML_Validator" ?
Surely a screenshot of your process will help understanding :)
More
01 Sep 2015 19:17 - 01 Sep 2015 19:24 #3 by Anas
Replied by Anas on topic Integrate more than file
Hi,
In the edition expression of componnent 'Scripting' i made the :

factory = javax.xml.validation.SchemaFactory.newInstance(" www.w3.org/2001/XMLSchema ") ;
sourceentree = new org.xml.sax.InputSource(new java.io.FileInputStream("${../XsdPath}$"));
sourceXSD = new javax.xml.transform.sax.SAXSource(sourceentree);
schema = factory.newSchema(sourceXSD);
validator = schema.newValidator() ;
validator.validate(new javax.xml.transform.stream.StreamSource(new java.io.File("${../XmlPath}$"))) ;





this is used to validate a XML file with Schema XSD.
the problem: I put a static path, I don't konw how can I use a dynamic one which we find in the File wait ?



i already tried using variables.
Thank you,
Attachments:
Last edit: 01 Sep 2015 19:24 by Anas.
More
02 Sep 2015 13:20 #4 by Anas
Replied by Anas on topic Integrate more than file
Hi,
In other way, there is any way to retrieve the File name one by one, to make our treatment and at the end we start it with the next file ?
More
02 Sep 2015 14:07 - 02 Sep 2015 14:07 #5 by Thomas BLETON
Replied by Thomas BLETON on topic Integrate more than file
FileWait can be used as source for a Bind link.
Please see this article for more information : www.stambia.org/index.php/doc/80-process...s-on-a-list-of-files
:{FILE_DIR}: will contain the path to the file's directory, and :{FILE_NAME}: will contain the file name.

Important : the target action has to be a single action, or an Execute delivery. It cannot be a subprocess (this will work in a future version, but not currently).
Last edit: 02 Sep 2015 14:07 by Thomas BLETON.
More
03 Sep 2015 13:10 #6 by Anas
Replied by Anas on topic Integrate more than file
Thank you for your answer, it's helpful,
I have another question: how can I retrieve :{FILE_NAME}: from Execute delivery in the process under it ?
More
03 Sep 2015 14:04 #7 by Thomas BLETON
Replied by Thomas BLETON on topic Integrate more than file
In the example of the article, the value is passed through the ExecuteDelivery property fileName, and the process can use the ${~/fileName}$ parameter.
Add a property to the ExecuteDelivery action, and it will be passed to the called delivery.
More
03 Sep 2015 16:47 #8 by Anas
Replied by Anas on topic Integrate more than file
Thank you
It's helpful