void createTransitionInstances ( ProcessInstance processInstanceVO , List < Transition > transitions , Long fromActInstId ) throws ProcessException , DataAccessException { TransitionInstance transInst ; for ( Transition transition : transitions ) { try { if ( tooManyMaxTransitionInstances ( transition , processInstanceVO . getId ( ) ) ) { // Look for a error transition at this time // In case we find it, raise the error event // Otherwise do not do anything handleWorkTransitionError ( processInstanceVO , transition . getId ( ) , fromActInstId ) ; } else { transInst = createTransitionInstance ( transition , processInstanceVO . getId ( ) ) ; String tag = logtag ( processInstanceVO . getProcessId ( ) , processInstanceVO . getId ( ) , transInst ) ; logger . info ( tag , "Transition initiated from " + transition . getFromId ( ) + " to " + transition . getToId ( ) ) ; InternalEvent jmsmsg ; int delay = 0 ; jmsmsg = InternalEvent . createActivityStartMessage ( transition . getToId ( ) , processInstanceVO . getId ( ) , transInst . getTransitionInstanceID ( ) , processInstanceVO . getMasterRequestId ( ) , transition . getLabel ( ) ) ; delay = transition . getTransitionDelay ( ) ; String msgid = ScheduledEvent . INTERNAL_EVENT_PREFIX + processInstanceVO . getId ( ) + "start" + transition . getToId ( ) + "by" + transInst . getTransitionInstanceID ( ) ; if ( delay > 0 ) this . sendDelayedInternalEvent ( jmsmsg , delay , msgid , false ) ; else sendInternalEvent ( jmsmsg ) ; } } catch ( SQLException ex ) { throw new ProcessException ( - 1 , ex . getMessage ( ) , ex ) ; } catch ( MdwException ex ) { throw new ProcessException ( - 1 , ex . getMessage ( ) , ex ) ; } } }
Handles the work Transitions for the passed in collection of Items