Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

How to run a distribution task from a batch file?

Hi all,

Does anyone know if it's possible and how to run a distribution task from a batch file?

8 Replies
Not applicable

Re: How to run a distribution task from a batch file?

Bump it up...

bnichol
Valued Contributor

Re: How to run a distribution task from a batch file?

Section 25.2 Reloading a file from the command line in the QlikView Server Reference Manual explains it fairly well.

Here's an example of the type of batch script that I use...

set AppProgram="C:\Program Files\QlikView\Publisher\Distribution Service\QlikviewDistributionService.exe"
set QvwName={Document Name}.qvw
set ProcessName={Document Name}
set QvwPath=C:\ProgramData\QlikTech\Publisher\Sourcedocuments\{Document Path}

%AppProgram% -out=%QvwPath%\%ProcessName%_reload_%date%.log -r=%QvwPath%\%QvwName%

IF %ERRORLEVEL% NEQ 0 goto Error

@echo Finished-%date% %time%
EXIT

:Error
blat -body "%date% %time%" -to "{address}" -server "smtp.company.com" -f "{From Address}" -subject "{ProcessName} - Reload Failed"
@echo Finished-%date% %time%
EXIT

The blat line allows me to receive email notification if the reload fails.

Good luck,

B

Not applicable

Re: How to run a distribution task from a batch file?

Thank you, but I need to distribute the file and not reload it. That's why I want to run a distribution task and not a reloading one.

bnichol
Valued Contributor

Re: How to run a distribution task from a batch file?

You could configure a distribution task and trigger it using "on an external event".  Then call the task from you batch program.

See section 27.5 Triggering EDX Enabled Tasks in the QlikView Server Reference Manual

Good luck,

B

Not applicable

How to run a distribution task from a batch file?

The problem is that I am not very good in that kind of scripting and the manual does not show a real example...

bnichol
Valued Contributor

How to run a distribution task from a batch file?

Here's a good link for EDX help, including a script file that you can modify...

http://community.qlik.com/thread/15988

Hope this helps,

B

Not applicable

How to run a distribution task from a batch file?

hi bnichol,

Could you please explain what do you mean by document name here is it filename.qvw or the task name? And the QVWpath is it the QEMC path or the path where qvw file physically exists? Plus, in the blat part below - address meaning our email address and from address meaning ?? Please explain in detail I am really confused about it. I am trying to use this code as a batch fiel to trigger my qvw task present in QEMC.

set AppProgram="C:\Program Files\QlikView\Publisher\Distribution Service\QlikviewDistributionService.exe"
set QvwName={Document Name}.qvw
set ProcessName={Document Name}
set QvwPath=C:\ProgramData\QlikTech\Publisher\Sourcedocuments\{Document Path}

%AppProgram% -out=%QvwPath%\%ProcessName%_reload_%date%.log -r=%QvwPath%\%QvwName%

IF %ERRORLEVEL% NEQ 0 goto Error

@echo Finished-%date% %time%
EXIT

:Error
blat -body "%date% %time%" -to "{address}" -server "smtp.company.com" -f "{From Address}" -subject "{ProcessName} - Reload Failed"
@echo Finished-%date% %time%
EXIT

Regards,

Avi

bnichol
Valued Contributor

How to run a distribution task from a batch file?

This script will reload a qvw file(document name), but it does not use the task identified in QEMC.

To call a Task identified in QEMC using EDX please refer to my previous postings in this thread.

The open source e-mail command line tool I'm using is called blat(http://www.blat.net/), but you can use any e-mail tool. To understand the command line format, please refer to documentation on the web site.

Good luck,

B

Community Browser