The BOSS tracer will contains --
Take the following process definition as a example,
pdef = Ruote.process_definition do
sequence do
concurrence do
alpha :time => 7
alpha :time => 5
alpha :time => 3
end
charly :time => 11
end
end
If it runs successfully, it will generates 4 records for Participants table,
alpha 20101228-boguderoba 0_0_0_2 2010-12-28 05:42:53 2010-12-28 05:42:56 3 receive alpha 20101228-boguderoba 0_0_0_1 2010-12-28 05:42:53 2010-12-28 05:42:58 5 receive alpha 20101228-boguderoba 0_0_0_0 2010-12-28 05:42:53 2010-12-28 05:43:00 7 receive charlay 20101228-boguderoba 0_0_1 2010-12-28 05:43:00 2010-12-28 05:43:11 11 receive
and 1 record for Processes table.
20101228-boguderoba | ["define",{},[["sequence",{},
[["concurrence",{},[["alpha",{"time":7},[]],["alpha",{"time":5},[]],
["alpha",{"time":3},[]]]],["charlay",{"time":11},[]]]]]] | 2010-12-28 05:42:53 | 2010-12-28 05:43:11 | 18 | terminated
If it fails, it will generates 3 records for Participants table,
alpha 20101228-bezuponusa 0_0_0_1 2010-12-28 06:28:32 2010-12-28 06:28:35 3 error_intercepted alpha 20101228-bezuponusa 0_0_0_2 2010-12-28 06:28:32 2010-12-28 06:28:35 3 error_intercepted alpha 20101228-bezuponusa 0_0_0_0 2010-12-28 06:28:32 2010-12-28 06:28:35 3 error_intercepted
and 1 record for Processes table.
20101228-bezuponusa | ["define",{},[["sequence",{},[["concurrence",{},[["alpha",{"time":7},[]],
["alpha",{"time":5},[]],["alpha",{"time":3},[]]]],
["charlay",{"time":11},[]]]]]] | 2010-12-28 06:28:32 | 2010-12-28 06:28:35 | 3 | error_intercepted
| field | description | example |
|---|---|---|
| wfid | string to identify this process(workflow) | 20101223-bemuboyawo |
| tree | string to describe this process(process definition) | ["define",{},[["sequence",{},[["concurrence",{},[["alpha",{"time":7},[]],["alpha",{"time":5},[]],["alpha",{"time":3},[]]]],["charly",{},[]]]]]] |
| launched | time when to launch this process | 2010-12-23 05:51:13.441734 UTC |
| last active | time when this process last get handled | 2010-12-23 05:51:16.472734 UTC |
| duration | how much seconds this process takes to finish | 21 |
| last action | string to describe what state this process finally gets, terminated means the process is successfully finished, error_intercepted means the process fails | terminated | error_intercepted |
| launched_workitem | the work item fed to this process | {"fields":{},"fei":{"sub_wfid":null,"wfid":"20110310-bizugugebi","engine_id":"engine","expid":"0"}} |
| terminated_workitem | the work item this process produced | {"participant_name":"charlay","fields":{"__result__":11},"fei":{"sub_wfid":null,"wfid":"20110310-bizugugebi","engine_id":"engine","expid":"0_0"}} |
| field | description | example |
|---|---|---|
| name | string | alpha |
| wfid | string to identify which process(workflow) this participant instance gets involved | 20101223-bemuboyawo |
| expid | string to distinguish participants with same name | 0_0_0_2 |
| dispatched | time when this participant gets start to work | 2010-12-23 05:51:24.801734 UTC |
| last active | time when this participant gets stop to work | 2010-12-23 05:51:27.816734 UTC |
| duration | how much seconds this participant takes to finish | 11 |
| last action | string to describe what state this participant finally gets, terminated means the participant is successfully finished, error_intercepted means the participant fails | terminated | error_intercepted |
| dispatched_workitem | the work item fed to this participant | {"participant_name":"charlay","fields":{"dispatched_at":"2011-03-10 03:08:55.769842 UTC","__result__":3,"params":{"time":11,"ref":"charlay"}},"fei":{"sub_wfid":null,"wfid":"20110310-bizugugebi","engine_id":"engine","expid":"0_0_1"}} |
| received_workitem | the work item this participant produced | {"participant_name":"charlay","fields":{"__result__":11},"fei":{"sub_wfid":null,"wfid":"20110310-bizugugebi","engine_id":"engine","expid":"0_0_1"}} |
Some use cases:
select * from participants left join processes on participants.wfid = processes.wfid where participants.duration = (select max(duration) from participants);
select * from participants where participants.wfid in (select wfid from processes where processes.duration = (select max(duration) from processes));
select avg(duration) from participants where name='alpha' and last_action='receive';
select (select count(*) from participants where name='alpha' and last_action='receive')/(select count(*) from participants where name='alpha');
select avg(duration) from processes where tree='["define",{},[["sequence",{},[["concurrence",{},[["alpha",{"time":7},[]],["alpha",{"time":5},[]],["alpha",{"time":3},[]]]],["charlay",{"time":11},[]]]]]]'
and last_action='terminated' and TIMESTAMPDIFF(day,launched,now())<8;