Hi,
you can execute the actor filter on a service task prior to the lane tasks but it means that:
The actor filter do not depend on execution context
The actor filter input is the same between all tasks
The actor filter implementation will be coupled with the definition
Then you can use a groovy connector on a service task like this:
import org.bonitasoft.actorfilter.identity.UserManagerActorFilter
import org.bonitasoft.engine.connector.EngineExecutionContext
// Instantiate the actor filter
def filter = new UserManagerActorFilter()
// Configure the execution context
filter.setAPIAccessor(apiAccessor)
def context = new EngineExecutionContext()
context.activityInstanceId = activityInstanceId
context.processDefinitionId = processDefinitionId
context.processInstanceId = processInstanceId
context.rootProcessInstanceId = rootProcessInstanceId
filter.setExecutionContext(context)
def processInitiatorId = apiAccessor.processAPI.getProcessInstance(processInstanceId).getStartedBy()
// WARNING: Input parameter must match the one used later in the process
filter.setInputParameters([userId:processInitiatorId])
// Execute it
filter.filter(“Employee”)
Obviously you should replace the UserManagerActorFilter with the implementation you want to use anf the Employee actor name with your Lane actor.
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.