Manually revert job/task to previous state

Post any question regarding setting up, running or configuring Verj.io Workflow

Moderators: Jon, Steve, Ian, Dave

ericb
Ebase User
Posts: 82
Joined: Fri Jan 15, 2016 2:34 pm

Manually revert job/task to previous state

#1

Postby ericb » Wed May 29, 2019 2:18 pm

The subject above doesn't quite describe what I think I'm trying to do, but it's the closest I could think of.

One of our workflow processes includes a job that creates multiple sub-jobs, then uses a pause node to wait for the sub-jobs to be completed before carrying on. Recently I've had a group of forms create the wrong number of sub-jobs for some reason. Rather than have them cancelled and recreated, only to possibly have the same issue again, I'd like to revert one of the forms back to its first node (a system task that determines how many sub-jobs to create) to see if the issue will repeat itself, and try to troubleshoot from there.

To try to accomplish this, I tried the following in the workflow database:

- In WORKFLOW_NODEENACTMENT, I found the instance of the job I need, and removed all but the first of its enactments. I then changed the E_STATE column of the first enactment to 1 (Waiting).
- Also in WORKFLOW_NODEENACTMENT, I removed all nodes for the sub-jobs that had been created by the main job.
- In WORKFLOW_JOB, I removed the sub-jobs that had been created by the main job.
- Finally, I went to WORKFLOW_WORKITEM and created a new entry for the job, with NODE_ENACTMENT_SEQUENCE=1

My expectation was that the workflow system would see this new row in WORKITEM and re-run the first node of the job as if it was its first time running, however when it reaches this row, it doesn't act on it and just stays stuck there. So it seems I'm missing one piece of the puzzle to make this work, but I don't know what it is.

I'm hoping an Ebase staff member could point out the change I'm still missing in the workflow database to have the WF system re-run the job from the start.

Thanks
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

Re: Manually revert job/task to previous state

#2

Postby Jon » Wed May 29, 2019 4:40 pm

Wow, that's quite a bold thing to be attempting. But in principle it should work.

Your work-item record should have:
interactive = N
processing = N
stepping = N
due = null (I think)

and the following columns to uniquely identify the node enactment (these must match the enactment):
process_name
process_version
job_sequence
node_enactment_sequence

That should be enough for the workflow background task to find the record. It will then load the enactment so the enactment key fields need to match. I think the node enactment state should be Active but I can't see this makes much difference. It also at this point loads the workstream so you should check this exists - probably it will.

Then the job will be loaded and the script executed. If anything goes wrong you would hope to see an exception printed to the log.

Finally the work-item record should be removed.

Some elements are cached in memory so it might be a good idea to stop the server, make the database changes, then restart the server.
0 x

ericb
Ebase User
Posts: 82
Joined: Fri Jan 15, 2016 2:34 pm

Re: Manually revert job/task to previous state

#3

Postby ericb » Wed May 29, 2019 5:15 pm

Thanks Jon. My workitem entry already matches what you said, so I'll try the 'active' status rather than 'waiting' for the node enactment, and failing that I'll try a restart.
0 x

ericb
Ebase User
Posts: 82
Joined: Fri Jan 15, 2016 2:34 pm

Re: Manually revert job/task to previous state

#4

Postby ericb » Wed May 29, 2019 5:21 pm

Looks like you were right Jon, all I needed to do was change the enactment status to 'active' instead of 'waiting', and after that the background task picked up my workitem right away.

Thanks!
0 x


Who is online

Users browsing this forum: No registered users and 2 guests