EEN-3001 [#Email-5008] – Batch.xml file not always zipped


In the older version, it was identified that the Batch.xml file generated during Export were not always zipped.



This issue has been fixed in the Ephesoft Version

A ZipSwitch is added within the function writetoXML() in all the Batch Class Scripts to make sure that the batch.xml files generated are always zipped.

If you are using an older version and facing this issue, it is recommended to upgrade your application to the Ephesoft Version or above. By doing this, all the scripts are updated with the Zip Switch.

If you do not wish to upgrade right now due to the ongoing activities and need to fix this issue, then you have to manually update all the Scripts in your Ephesoft installation directory.


Update the writetoXML() function in all the Script files at the following path:

<Ephesoft Installation Dir>\SharedFolders\BC1\scripts


You can replace the complete writetoXML() function or add the Zip switch in the function as shown in the below code.




private void writeToXML(Document document) {

String batchLocalPath = null;

List<?>batchLocalPathList = document.getRootElement().getChildren(BATCH_LOCAL_PATH);

if (null != batchLocalPathList) {

batchLocalPath = ((Element) batchLocalPathList.get(0)).getText();


if (null == batchLocalPath) {

LOGGER.error(“Unable to find the local folder path in batch xml file.”);



String batchInstanceID = null;

List<?>batchInstanceIDList = document.getRootElement().getChildren(BATCH_INSTANCE_ID);

if (null != batchInstanceIDList) {

batchInstanceID = ((Element) batchInstanceIDList.get(0)).getText();


if (null == batchInstanceID) {

LOGGER.error(“Unable to find the batch instance ID in batch xml file.”);



String batchXMLPath = batchLocalPath.trim() + File.separator + batchInstanceID + File.separator + batchInstanceID


/*Zip Switch starts here*/

booleanisZipSwitchOn = true;

try {

ApplicationConfigProperties prop = ApplicationConfigProperties.getApplicationConfigProperties();

isZipSwitchOn = Boolean.parseBoolean(prop.getProperty(ICommonConstants.ZIP_SWITCH));

} catch (IOExceptionioe) {

LOGGER.error(“Unable to read the zip switch value. Taking default value as true. Exception thrown is:” + ioe.getMessage(),


}“isZipSwitchOn************” + isZipSwitchOn);

OutputStreamoutputStream = null;

FileWriter writer = null;

XMLOutputter out = new com.ephesoft.dcma.batch.encryption.util.BatchInstanceXmlOutputter(batchInstanceID);

try {

if (isZipSwitchOn) {“Found the batch xml zip file.”);

outputStream = getOutputStreamFromZip(batchXMLPath, batchInstanceID + EXT_BATCH_XML_FILE);

out.output(document, outputStream);

} else {

writer = new;

out.output(document, writer);




} catch (Exception e) {


} finally {

if (outputStream != null) {

try {


} catch (IOException e) {








Was this article helpful to you?