Workflows are not triggering during gliderecord insert or update


Description


STEPS TO REPRODUCE:

  1. create sys property "glide.db.max.aggregates" type integer, set value to 1
  2. try to trigger a workflow on any table you have workflow configured to run on

UNEXPECTED BEHAVIOR: the workflow is not trigger

EXPECTED BEHAVIOR: workflow should be trigger on [sc_request], [change_request]


Also if you run the following, and you have a lot of workflows configured to run on many tables, this will only return a few tables:

var ga = new GlideAggregate("wf_workflow_version");
ga.groupBy("table");
ga.queryNoDomain();
while(ga.next()){
    gs.info(ga.getValue('table'));
}

Cause

GlideAggregates is being limited to a few results. In the backend there is a GlideAggreates being done on [wf_workfow_version], and group by "table" column, this builds a cache on the node for tables where workflows are configured to trigger on insert or update

Resolution

  1. set sys property "glide.db.max.aggregates" value to 100000
  2. /cache.do
  3. delete property