private ChildTaskContainer getParentTask ( Activity activity ) { // // Make a map of activity codes and their values for this activity // Map < UUID , UUID > map = getActivityCodes ( activity ) ; // // Work through the activity codes in sequence // ChildTaskContainer parent = m_projectFile ; StringBuilder uniqueIdentifier = new StringBuilder ( ) ; for ( UUID activityCode : m_codeSequence ) { UUID activityCodeValue = map . get ( activityCode ) ; String activityCodeText = m_activityCodeValues . get ( activityCodeValue ) ; if ( activityCodeText != null ) { if ( uniqueIdentifier . length ( ) != 0 ) { uniqueIdentifier . append ( ' ' ) ; } uniqueIdentifier . append ( activityCodeValue . toString ( ) ) ; UUID uuid = UUID . nameUUIDFromBytes ( uniqueIdentifier . toString ( ) . getBytes ( ) ) ; Task newParent = findChildTaskByUUID ( parent , uuid ) ; if ( newParent == null ) { newParent = parent . addTask ( ) ; newParent . setGUID ( uuid ) ; newParent . setName ( activityCodeText ) ; } parent = newParent ; } } return parent ; }
Retrieves the parent task for a Phoenix activity .