i want to run a import workflow between 7am to 10am and set schedular to run 3times a day..
so workflow will run 3 times between this duration
now when file is received i want the workflow to move to file loadign acitity
but in case file is not received between 7am to 10am i wan to send alert but not evEry hour(ASSSUME FILE NOT RECEIVED WHEN RUN FIR THE FIRST TIME)
but only after Wkf run comlpleteD for 3imes a day and file is not received EVEN THENthen i want TO SEND ALERT
please let me know how can we achieve this
@ParthaSarathy
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @DishaSharma ,
You can try the same approach mentioned in this thread and modify the query condition as below,
File Transfer:
In File transfer activity's Advanced tab, add the below script
vars.hour = formatDate(new Date(), "%2H");
Query:
Targeting & Filtering Dimension: xtk:workflow
Filtering Condition:
(Highlighted in BOLD fonts are newly added/modified condition compared to the reference thread's query condition)
$(vars/@hour) equal to 10
AND
@internalName equal to internal_name_of_current_workflow
AND
Message (log) do not exist such as
@message equal to File Processed
AND
ToDate(@logDate) equal to ToDate( GetDate())
Hello @DishaSharma
If you know the timing of the 3rd run then use this:
You will have to use JavaScript to achieve this.
After the scheduler activity add JavaScript code activity and write this code.
instance.vars.myRunHour=formatDate(new Date(), "%2H");
This will give you the hour when the 3rd run is happening.
Then add a test activity in your workflow to check if the the variable hour is matching with the timing of 3rd run. If yes then it is the third run and send the alert.
If you are not sure the timings of the workflow run
You can use the JavaScript to update value of an option. You can increase the value of this option every time the WF is run.
On every run check if the value of that option is 3 and file status.
// set Option
setOption('WFrunCounter',0);
//get Option
getOption('WFrunCounter');
Views
Replies
Total Likes
thank you for your help but m facing one challenge here
If you are not sure the timings of the workflow run
You can use the JavaScript to update value of an option. You can increase the value of this option every time the WF is run.
On every run check if the value of that option is 3 and file status.
what i am doing is:
this m doing before file transfer activity:
Option
setOption('WFrunCounter',0);
now after file tranafer acitity when no file received m incrementing counter
but when file not received for for first time and then m incmrenting counter
but later on when wkf run fir 2nd time it is stgarting from 0
please please help to provide how can I set these counters AND USE IT WHN FILE NOT RECEIEVD FOR 3RD TIME
RELLAY CONfused and not able to achieve results please help
Views
Replies
Total Likes
Views
Replies
Total Likes
Hello @Shruti1
Do not set the WFrunCounter to 0 at the start of the workflow.
Set it to zero if the file ingestion is complete
Views
Replies
Total Likes
thank you for your help but m facing one challenge here
If you are not sure the timings of the workflow run
You can use the JavaScript to update value of an option. You can increase the value of this option every time the WF is run.
On every run check if the value of that option is 3 and file status.
what i am doing is:
this m doing before file transfer activity:
Option
setOption('WFrunCounter',0);
now after file tranafer acitity when no file received m incrementing counter
but when file not received for for first time and then m incmrenting counter
but later on when wkf run fir 2nd time it is stgarting from 0
please please help to provide how can I set these counters AND USE IT WHN FILE NOT RECEIEVD FOR 3RD TIME
RELLAY CONfused and not able to achieve results please help
Views
Replies
Total Likes
Hi @DishaSharma ,
You can try the same approach mentioned in this thread and modify the query condition as below,
File Transfer:
In File transfer activity's Advanced tab, add the below script
vars.hour = formatDate(new Date(), "%2H");
Query:
Targeting & Filtering Dimension: xtk:workflow
Filtering Condition:
(Highlighted in BOLD fonts are newly added/modified condition compared to the reference thread's query condition)
$(vars/@hour) equal to 10
AND
@internalName equal to internal_name_of_current_workflow
AND
Message (log) do not exist such as
@message equal to File Processed
AND
ToDate(@logDate) equal to ToDate( GetDate())
Views
Like
Replies