You are viewing limited content. For full access, please sign in.

Question

Question

Forms Instance Monitoring

asked on July 27, 2016

I would like to set up within our monitoring software (Solarwinds) an automated alert notification if any of our LF forms go into a Suspended or Terminated state.   Currently we just peek at the Processes -> Instance Monitoring web page on the forms server.   I am looking for a simple sql query against the forms database that would return 3 numeric values;  In Progress with no errors,  With Suspended Tasks and Terminated.

Before I go diving into the Forms tables to craft a query I was wondering if anyone else has already done something similar or someone that is familiar with the tables could point me in the right direction ( which table(s) ).

Thanks,
Andrew

0 0

Replies

replied on August 10, 2016

Hi there, 

 

First of all, there is no such single place in database to retrieve instance status. Status of an instance is actually calculated by combining main instance and worker instance ( cf_bp_main_instances and cf_bp_worker_instances).

For example, if you have main instance saying "running", while one of the worker instances is "suspended", then that instance would be considered as "running with suspended tasks".

 

Status code for main instance:

        running 1

        Complete 2

        Canceled 3

        Terminated by error 4

        Terminated by End Event 5

Status code for routing instance status (you can consider this as worker instance status)

        Ready 1
        Wait for trigger 2
        Running 3
        Step executed 4
        Sleep = 5
        Split = 6
        Merged 7
        Complete 8
        Terminate 9
        Interrupted 10
        Suspended due to error (resume-able) 11
        Suspended due to task error (not resume-able) 13

 

Hope this can help.

 

Best,

Lifei 

4 0
replied on August 3, 2021

How would you find instances in the Forms database for all locked instances?

0 0
replied on August 11, 2016

Thanks Lifei,  knowing all the error codes really helps.   I had been able to figure out a few of them.

I came up with the query below for a simple count of suspended tasks and it seems to be working.  With your info I should be able to tweak it a bit more.


select count(MAIN.bp_instance_id)
--MAIN.[bp_instance_id],
--ERROR.[message]
from 
[LFForms].[dbo].[cf_bp_worker_instances] MAIN, 
[LFForms].[dbo].[bp_instance_errors] ERROR
where MAIN.[status] = 13
AND MAIN.bp_instance_id = ERROR.bp_instance_id

 

1 0
replied on November 5, 2018

Are the statuses found in the [cf_bp_worker_instnc_to_resume] table the same as the statuses you have listed above for the [cf_bp_worker_instances] table?

I have a user task in the [cf_bp_worker_instnc_to_resume] table that took 7 days 4 hours and 36 minutes to complete and it has a status of "2" in this table while all other normal-looking pending user tasks have a status of "5".

Thanks for your time!

1 0
replied on June 19

Do the cf_bp_worker_instnc_to_resume.status numbers follow the same meanings as mentioned above for cf_bp_worker_instances?

0 0
replied on June 24

Hi Blake,

No, they are completely different meanings on each table, never mix them up or it will break the instance data. This post is many years ago, do you have a specific question on the status and share your use case?

0 0
replied on June 25

Hi Zhiyong, I am creating various reports and would like to know what the current status numbers mean for the cf_bp_worker_instances, cf_bp_main_instances, and cf_bp_worker_instnc_to_resume tables since there isn't another table that holds what these mean.

0 0
replied on June 25

cf_bp_main_instances.status

ii. Running = 1, // instance still in progress
iii. Complete = 2, // Instance is done
iv. Canceled = 3, // Instance was canceled
v.  TerminatedByError = 4, // instance was terminated due to a non-recoverable error
vi. TerminatedByEndEvent = 5, // when instance ends from terminate end event
vii. RunningWithSuspendedTask = 6, // Note: This does not actually exist in the DB
viii. Archived = 99 // deleted instances

 

cf_bp_worker_instances.status

i.  Ready =1: step is ready to start
ii. WaitForTrigger = 2: requires an event to happen before moving on (User Task usually, but also intermediate timer event)
iii. Running = 3: step is currently running, e.g. running workflow
iv. StepExecuted = 4: Usually you should not see it, they are marked when a task or timer is executed and will be overridden by the next step quickly
v.  Sleep = 5: basically the worker instance goes to sleep and another one started in the sub-process
vi. Split = 6: gateway splitting to multiple paths
vii. Merged = 7: gateway merged from multiple branches
viii. Complete = 8: step full executed
ix. Terminate = 9: step was terminated before completion
x.  Interrupted = 10, task was stopped due to an interrupt
xi. SuspendedDueToError = 11: service tasks that couldn’t complete
xii. Free = 12: task is assigned to multiple users (not use)
xiii. SuspendedDueToTaskError = 13: user task is suspended

 

cf_bp_worker_instnc_to_resume.status

ii. New=1(Task is available to be claimed)
iii. Locked=2(task is about to be processed, running wf)
iv. Canceled=3(process/instance was canceled)
v.  Deleted=4
vi. Ready=5(Task is owned)
vii. Suspended=6(task was unable to be assigned to a user/team)

 

I added brief explanation for you to read, some status are just for Routing service to process, but don't try to update them anytime without our help.

1 0
replied on June 26 • Show version history

Thank you for those details. Does the same hold true for their corresponding archive/history tables?

cf_bp_main_instances_archive.status, cf_bp_worker_instance_history, cf_bp_worker_instnc_to_resume_archive.status

0 0
replied on June 28

cf_bp_main_instances_archive.status is not used in query results yet

cf_bp_worker_instnc_to_resume_archive.status is same as cf_bp_worker_instnc_to_resume

cf_bp_worker_instance_history.status is string, you can infer its usage by its value, a complete reference could be:

i.  complete = 1: step is complete
ii. terminate = 2: step was terminated
iii. assigned = 3: task was assigned to users
iv. waiting = 4: step is in waiting state
v.  reassigned = 5: task was reassigned
vi. running = 6: step is running
vii. interrupted = 7: step was interrupted(by signal or timer)
viii. suspended = 8: service task was suspended
ix. claimed = 9: user task was claimed by user
x.  released = 10, user task was released by user
xi. taskSuspended = 11: user task was suspend
xii. AssignmentError = 12: user task assignment failed(no valid approvers)
xiii. Unused = 13, current unused
xiv. AssignedByRoundRobin = 14, user task owner assigned automatically by RoundRobin
xv. DueDateEdited = 15, due date modified
xvi. PriorityEdited = 16, priority modified

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.