List < String > determineWorkgroups ( Map < String , String > indexes ) throws ServiceException { TaskTemplate taskTemplate = getTemplate ( ) ; String routingStrategyAttr = taskTemplate . getAttribute ( TaskAttributeConstant . ROUTING_STRATEGY ) ; if ( StringHelper . isEmpty ( routingStrategyAttr ) ) { return taskTemplate . getWorkgroups ( ) ; } else { try { RoutingStrategy strategy = TaskInstanceStrategyFactory . getRoutingStrategy ( routingStrategyAttr , OwnerType . PROCESS_INSTANCE . equals ( taskInstance . getOwnerType ( ) ) ? taskInstance . getOwnerId ( ) : null ) ; if ( strategy instanceof ParameterizedStrategy ) { populateStrategyParams ( ( ParameterizedStrategy ) strategy , getTemplate ( ) , taskInstance . getOwnerId ( ) , indexes ) ; } return strategy . determineWorkgroups ( taskTemplate , taskInstance ) ; } catch ( Exception ex ) { throw new ServiceException ( ex . getMessage ( ) , ex ) ; } } }
Determines a task instance s workgroups based on the defined strategy . If no strategy exists default to the workgroups defined in the task template .