Run workflow from command prompt


(sivaraman gangadharan) #1

hello ,
please correct if the syntax is wrong for kicking off the workflow from command line , it fails with this command .

@echo off

set DQC_HOME=C:/Program Files/DQC/runtime
set projectpath=E:/HCA/ITS/PatientFinancials/DQD/dqd_Patient_Financials/Files
set logpath=E:/HCA/ITS/PatientFinancials/DQD/dqd_Patient_Financials/Files/logs/
set logfile=run_workflow_EDWPF_Patient_Financials.log
echo %DATE% %TIME% > %logpath%%logfile%

call “%DQC_HOME%\bin\run_java.bat” com.ataccama.adt.runtime.EwfProcessor -wfRuntimeConfig=%projectpath%\etc\dqd.runtimeConfig -state %logpath%%logfile% -log=true %projectpath%\workflows\wf_check_sftp.ewf

if not errorlevel 1 (
echo “Success exit code” %errorlevel% >> %logpath%%logfile%
exit %errorlevel%
)
if errorlevel 1 (
echo “Error exit code 99” >> %logpath%%logfile%
exit 99
)


(Petya Minovska) #2

Hi Siva,

Please, follow this documentation. Here you will find detailed information about all possible methods of workflow execution.
If you have any further questions, do not hesitate to ask us.

Regards,
Petya


(sivaraman gangadharan) #3

I did go over the documentation but still throwing error . I would really appreciate if you have sample script to kick off workflow .
I just have SFTP task now which runs fine when ran manually but fails with this command. I am planning to add task like Run DQD Processing later after this works fine .

A sample script would be really great . please let me know.

script ( failing right now )
call “%DQC_HOME%\bin\run_java.bat” com.ataccama.adt.runtime.EwfProcessor -runtimeConfig=%projectpath%\etc\dqd.runtimeConfig -state %logpath%%logfile% -log=true %projectpath%\workflows\wf_check_sftp.ewf >> %logpath%%logfile%


(sivaraman gangadharan) #4

full script:

set DQC_HOME=C:/Program Files/DQC/runtime
set projectpath=E:/HCA/ITS/PatientFinancials/DQD/dqd_Patient_Financials/Files
set logpath=E:/HCA/ITS/PatientFinancials/DQD/dqd_Patient_Financials/Files/logs/
set logfile=chk_run_workflow_EDWPF_Patient_Financials.log
echo %DATE% %TIME% > %logpath%%logfile%

call “%DQC_HOME%\bin\run_java.bat” com.ataccama.adt.runtime.EwfProcessor -runtimeConfig=%projectpath%\etc\dqd.runtimeConfig -state %logpath%%logfile% -log=true %projectpath%\workflows\wf_check_sftp.ewf >> %logpath%%logfile%


(Said Abduraimov) #5

Hi Siva,

We assume that your configuration is almost correct. The only suggestion is to try replacing run_java.bat with runewf.bat.
Please, kindly refer to this part of the documentation

We will try to provide an example shortly.
In addition, we would kindly ask you to share the error you are receiving. It would help us to analyse the root-cause of the problem.


(sivaraman gangadharan) #6

I am trying this link of documentation to run from the console . I think runtime config file needs some changes and need some guidance on it .

https://docs.ataccama.com/v9/shared-components/workflow-and-scheduler-reference-documentation/workflow-management/

script:

@echo off

set DQC_HOME=C:/Program Files/DQC/runtime
set projectpath=E:/HCA/ITS/PatientFinancials/DQD/dqd_Patient_Financials/Files
set logpath=E:/HCA/ITS/PatientFinancials/DQD/dqd_Patient_Financials/Files/logs/
set logfile=chk_run_workflow_EDWPF_Patient_Financials.log
echo %DATE% %TIME% > %logpath%%logfile%

call “%DQC_HOME%\bin\run_java.bat” com.ataccama.adt.runtime.EwfProcessor -runtimeConfig=%projectpath%\etc\dqd.runtimeConfig -state =No -log=true %projectpath%\workflows\wf_check_sftp.ewf >> %logpath%%logfile%

error

Fri 12/30/2016 12:03:13.03
Using java at: "C:\Program Files\DQC\jre\bin\java.exe"
Using DQC at: "C:\Program Files\DQC\runtime"
30.12.2016 12:03:14 [INFO] Using following licenses:
30.12.2016 12:03:14 [INFO] C:\Program Files\DQC\runtime\license_keys\license_hca_PROD-1-engine_v10.plf
30.12.2016 12:03:15 [INFO] Processor started
30.12.2016 12:03:15 [INFO] Task ‘SFTP Download File’ : IN_QUEUE
30.12.2016 12:03:15 [INFO] Task ‘SFTP Download File’ : RUNNING
30.12.2016 12:03:15 [INFO] Task ‘SFTP Download File’ : failed with exception: missing UrlResourceContributor in runtime configuration
30.12.2016 12:03:15 [INFO] — Stop initiated —
30.12.2016 12:03:15 [DEBUG] [WF persister] waiting for writer to finish
30.12.2016 12:03:15 [INFO] — Stop done : processor stopped with status : FINISHED_FAILURE—
30.12.2016 12:03:15 [DEBUG] [WF Persister] saving state-model took: 23
30.12.2016 12:03:16 [DEBUG] [WF Persister] saving state-model took: 5
30.12.2016 12:03:16 [DEBUG] [WF persister] writer done, returning


(Said Abduraimov) #7

Hi Siva,

We hope you had a great New Year’s eve celebration. :slight_smile:

Thank you for sharing the error information.
We believe that we can see the whole picture now.
When you invoke a workflow that requires a remote connection (for example, to a server), you need to define this connection in the default.runtimeConfig file.
Please, take a look on this guide which describes how to configure the URL under the contributedconfigs flag.
Please note, by default, this section is commented out. Thus, you will need to uncomment it first.

If you have concerns regarding storing the password in the unencrypted form, please, refer to this guide. It describes how to encrypt the password in DQC.


(Petya Minovska) #8

Hi Siva,

I apologize for my late response.
Please find an example for executing a workflow via console RunWorkflowExample.zip (1.9 KB). This is just an example and you have to update the path according to your environment in order to execute it.
Regarding the error you are receiving: Task ‘SFTP Download File’ : failed with exception: missing UrlResourceContributor in runtime configuration, we assume that it is caused by a misconfiguration in the ContributedConfigs section in the default.runtimeConfig file. Please, follow the guide provided by Said.
In addition, we would like to mention that any remote server connections that are referenced from various steps or configuration files should be defined in the default.runtimeConfig file.

Regards,
Petya


(Petya Minovska) #9

Hi Siva,

Were you able to run the workflow from a command prompt? Do you have any further questions?

Regards,
Petya


(sivaraman gangadharan) #10

Petya,
I am not able to run the workflow from command prompt yet . we will try to open a ticket ti get some additional support with your team to go over the config files and set up issues all at one time .

Thanks
Siva