I have a job in GECS scheduler which will trigger a informatica workflow, if the job is late for 10 min then we need to create a mapping such a way that it will fail the workflow and trigger a mail to outlook saying the workflow is failed
You can branch off your main workflow line to a timer task which starts as soon as the workflow starts. Set the timer to wait for the specified number of minutes then route to an email task on condition that the last task of the workflow has not succeeded. One caveat to this approach is that the workflow will always run for no less than the timer task is set for even when the rest of it has completed early. For this reason it is pragmatic to replace the timer task with a command task to a script which checks every few seconds for the final task completion and exits when this is true or after the set time interval
Related
In Windows task scheduler I have a task. For example: Test
Under that, I have 3 actions.
Problem is all 3 actions execute at the same time.
I have a requirement that each actions starts only after the previous one ends.
Is there way we can set these conditions?
I've built a system based on Laravel where users are able to begin a "task" which repeats a number of times, with a delay between each repetition. I've accomplished this by queueing a job with an amount argument, which then recursively queues an additional job until the count is up.
For example, I start my task with 3 repetitions:
A job is queued with an amount argument of 3. It is ran, the amount is decremented to 2. The same job is queued again with a delay of 5 seconds specified.
When the job runs again, the process repeats with an amount of 1.
The last job executes, and now that the amount has reached 0, it is not queued again and the tasks have been completed.
This is working as expected, but I need to know whether a user currently has any tasks being processed. I need to be able to do the following:
Check if a particular queue has any jobs started by a particular user.
Check the value that was set for amount on that job.
I'm using the database driver for a queue named tasks. Is there any existing method to accomplish my goals here?
Thanks!
You shoudln't be using delay to queue multiple repetitions of the same job over and over. That functionality is meant for something like retrying a failed network request. Keeping jobs in the queue for multiple hours at a time can lead to memory issues with your queues if the count gets too high.
I would suggest you use the php artisan schedule:run functionality to run a command every 1-5 minutes to check the database if it is time to run a user's job. If so, kick off that job and add a status flag to the user table (or whatever table you want to keep track of these things). When finished you mark that same row as completed and wait for the next time the cron runs to do it again.
I have a following scenario
Change a Flag = start (in database)
Do some processing
Update the Flag back to Finished (in database)
Suppose the system crashes during the step 2. Ideally I would want to set the Flag back to Finished. But because of the system crash it doesn't and it falls into deadlock for that task.
What are the standard solutions/approaches/algorithms followed to address such scenario?
Edit: How the deadlock occurs?
The task will be picked only if the Flag = Finished. Flag = start means it is in progress in the middle of something. So when there is a crash, the task is not complete but the Flag is also not set to Finish next the the system runs. So the task is not going to be picked again.
I don't see any simple solution here.
If your tasks execution time is predictable enough you can store a timestamp of task execution start in your DB and return task to "empty" state (not started yet) on timeout.
Or you can store process ID in your DB and implement a supervisor process that will launch your "executor" processes and check their exit code. If process crashed supervisor would "reinitialise" all tasks marked with crashed process ID.
I am new to jBPM. I am working on jBPM version 6.2.0. I want to perform following tasks.
Send reminder email to user / group.
Remind the user again after 1 business day if the task is not yet complete. Continue to send reminder everyday untill the task is done.
Also what happens if jboss / tomcat server restarts after sending one reminder email. Will the later emails still schedule ?
I am able to add Deadlines (Escalation- Notification) But it runs once and sends only 1 email. I need to keep reminding the user on a daily basis (or hourly) to complete the task.
I tried looking in jBPM 6 user guide but it does not have clarity about Boundary timer events and intermediate catch time events. And when i use any of them then it runs once.
Any help is much appreciated.
Here is an example of something that I did recently for sending periodic emails.
This should loop until a user finally completes the task. You might have trouble with the one business day rule since I do not know if the ISO 8601 spec is flexible enough to know about weekends/holidays/business days. You could add that logic into your service task for sending the email.
Be aware that this loop will continue forever until the task is complete. You might want to consider adding some additional timeout. You could add a loop count so after X amount of times the process will be cancelled. Some of my processes have a rule that if the process is not complete in Y days, the process should be cancelled. I accomplished that by have a process variable CancelDate and set a Timer Event definition to Date/Time and the value #{CancelDate}.
I want to only send out one email at a time so I have a script starting every minute. Is it possible to only send out one email and then stop the delayed job from sending the next queued jobs?
Before you place the next job on the queue, you could look at the last job that's already on the queue, and check it's run_at time. Then set the run_at time for your job to be one minute later. If there's no jobs on the queue, set it to now, or one minute from now, depending on how strict you need to be about one minute between.
You could fetch one specific job from DJ's table itself, invoke it and then destroy it, something like:
job = Delayed::Job.last
job.invoke_job # This will NOT destroy the job
job.destroy
Found it here: https://groups.google.com/forum/#!topic/delayed_job/5j5BmAlXN3g