programmatically advance to next step in absense of user in (Dynamic Participant Step)
For Below Workflow, if there is no user at L3 Level(Dynamic Participant Step), then in that case wokflow should autoAdvance from L2 Level((Dynamic Participant Step)) to Marketing Team Approval Level((Dynamic Participant Step)).

Below is the code I am using to programmatically to move to next workflow step in absense of user in the group i.e. auto handler advance programmatically, but it's not working.
if (!users.isEmpty()) {
} else {
WorkItem newWorkItem = workflowSession.getActiveWorkItems()[0];
workflowSession.complete(newWorkItem, workflowSession.getRoutes(newWorkItem,false).get(0));
}
alse tried below one:
if (!users.isEmpty()) {
} else {
List<Route> routes = workflowSession.getRoutes(workItem, false);
workflowSession.complete(workItem, routes.get(0));
}
I tried with true condition also.