source: trunk/grails-app/domain/Task.groovy @ 901

Last change on this file since 901 was 821, checked in by gav, 14 years ago

Domain change, add ConditionSeverity.

File size: 2.1 KB
RevLine 
[66]1class Task {
[121]2
[66]3    TaskGroup taskGroup
4    TaskStatus taskStatus
[69]5    TaskPriority taskPriority
[252]6    TaskBudgetStatus taskBudgetStatus
[69]7    TaskType taskType
[168]8    Task parentTask
[66]9    Person leadPerson
[472]10    Site site
11    Section section
[116]12    Asset primaryAsset
[472]13    AssetSubItem assetSubItem
[131]14    TaskRecurringSchedule taskRecurringSchedule
[809]15    TaskProcedureRevision taskProcedureRevision
[821]16    ConditionSeverity highestSeverity
[121]17
[66]18    String description
19    String comment = ""
20    Date targetStartDate = new Date()
21    Date targetCompletionDate = new Date()
[181]22    boolean approved = false
23    boolean trash = false
[418]24    boolean attentionFlag = false
[592]25    boolean safetyRequirement = false
[728]26    boolean regulatoryRequirement = false
27    boolean mandatoryRequirement = false
[592]28    boolean positiveFault = false
[66]29
[418]30    static hasMany = [entries: Entry,
[147]31                        taskModifications: TaskModification,
[242]32                        assignedGroups: AssignedGroup,
[241]33                        assignedPersons: AssignedPerson,
[116]34                        subTasks: Task,
35                        associatedAssets: Asset,
36                        inventoryMovements: InventoryMovement]
[66]37
[131]38    static mappedBy = [taskRecurringSchedule:"task"]
39
[807]40    static mapping = {
41        primaryAsset lazy:false
42    }
43
[69]44    static belongsTo = [TaskGroup, TaskStatus, Task, Person]
[66]45
46    static constraints = {
[131]47        description(blank:false,maxSize:75)
[446]48        comment(maxSize:1000)
[66]49        targetStartDate()
[446]50        targetCompletionDate(validator: {val, obj ->
51            if(val.before(obj.targetStartDate))
52                return 'before.targetStartDate'
53        })
[66]54        leadPerson()
[69]55        taskPriority()
[252]56        taskBudgetStatus()
[66]57        taskStatus()
[146]58        parentTask(nullable:true)
[472]59        site(nullable:true)
60        section(nullable:true)
[146]61        primaryAsset(nullable:true)
[472]62        assetSubItem(nullable:true)
[146]63        taskRecurringSchedule(nullable:true)
[809]64        taskProcedureRevision(nullable:true)
[821]65        highestSeverity(nullable:true)
[66]66    }
67
[799]68    String toString() {
69        def s = "#${this.id} - "
70        if(this.primaryAsset)
71            s += "${primaryAsset.name}: "
72        s += "${this.description}"
73    }
74
[66]75}
Note: See TracBrowser for help on using the repository browser.