Schedule a Job when adding a record to the database

05 Jun '14, 11:11 AM
10,809 Views
No Forum Badges

Hello,

 

I'm trying to schedule a Job when I add some item to my database using a form.

The idea is to schedule a job on a certain date that is set in the form.

I based my modelling on the getting-started-with-jobs tutorial, but it is not working.

Here you find what the job itself it looks like: http://oi60.tinypic.com/ih13ic.jpg

In the Job, I'm simply trying to change a string parameter of the just added item.

 

Can someone see what I'm doing wrong?

 
x 0
Follow
Answer Answer at this question and get points!
Forum Hero - Level 9

Hi Jonas,

Your job is correct, I suggest you put a "No Op" component after to the update component and join these with a ok flow to finish the operation.

Now, if you want schedule the "job" in a certain date since a form, you have to use a "schedule job" in the ifml, for example you have the form and with a normal flow you have to join with the "schedule job" component, select this component go to the properties and in the "Job" properties select your job, and in "Schedule Policy" select "Specific Date" option, and in the normal flow (since Form to Schedule job) you have to send the date field to the parameter timestamp (if you field is timestamp type), if you have a field date type, you should use a time component send the date value and get the day, month, year, .... and send this data to the "schedule job" component

 
x 1
No Forum Badges

Thank you for your reply.

 

I added the No Op and did exactly as you said: From the from I go with a navigation flow to the Schedule job component and from there on I go to the Create component (for the item of the form). I see that the item is created, but the job (that sits inbetween the form and the create component) was not scheduled (I tried scheduling on a minute later than the current time or even with the "Now" parameter).

 

Do you have any idea what I'm still doing wrong?

 
x 0
Forum Hero - Level 9

Hi Jonas,

could you review the log file, Window -> Show View -> Other in the WebRatio Folder you must select the Runtime Log and you can see a tab with the runtime Log, you can open this file selecting Open Runtime Log File and update selecting reload log file option and tell me what contain this file

 
x 0
No Forum Badges

 
x 0
No Forum Badges

 

It seems I don't have a runtime log file there. It cannot locate the log file. How can I set it?

 

 

 
x 0
No Forum Badges

I found the log file manually. It gives no error when I try to schedule the job. All that's in the logs are "java.lang.InterruptedException: sleep interrupted" errors from idle threads. But they only show up when I restart Tomcat.

 
x 0
No Forum Badges

I found the problem!

I passed the OID of the item object to the Schedule Job before it was actually generated by the Create item operation. Now I chained the scheduling after the creation and it works fine.

Thanks for your help Veronica!

 
x 0
Answer at this question and get points!