public List < ActivityInstance > getActivityInstances ( String masterRequestId , String processName , String activityLogicalId ) throws ProcessException , DataAccessException { TransactionWrapper transaction = null ; EngineDataAccessDB edao = new EngineDataAccessDB ( ) ; try { Process procdef = ProcessCache . getProcess ( processName , 0 ) ; if ( procdef == null ) return null ; Activity actdef = procdef . getActivityByLogicalId ( activityLogicalId ) ; if ( actdef == null ) return null ; transaction = edao . startTransaction ( ) ; List < ActivityInstance > actInstList = new ArrayList < ActivityInstance > ( ) ; List < ProcessInstance > procInstList = edao . getProcessInstancesByMasterRequestId ( masterRequestId , procdef . getId ( ) ) ; if ( procInstList . size ( ) == 0 ) return actInstList ; for ( ProcessInstance pi : procInstList ) { List < ActivityInstance > actInsts = edao . getActivityInstances ( actdef . getId ( ) , pi . getId ( ) , false , false ) ; for ( ActivityInstance ai : actInsts ) { actInstList . add ( ai ) ; } } return actInstList ; } catch ( SQLException e ) { throw new ProcessException ( 0 , "Failed to remove event waits" , e ) ; } finally { edao . stopTransaction ( transaction ) ; } }
Returns the activity instances by process name activity logical ID and master request ID .