Changeset 124 for trunk/grails-app/conf
- Timestamp:
- May 4, 2009, 1:59:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r122 r124 282 282 leadPerson:Person.get(3), 283 283 description:"Check specific level sensor", 284 comment:"Has been noted as problematic, try recal librating")284 comment:"Has been noted as problematic, try recalibrating.") 285 285 BootStrapSaveAndTest(taskInstance) 286 286 … … 418 418 BootStrapSaveAndTest(recurringScheduleInstance) 419 419 420 //RecurringSchedule #2 421 recurringScheduleInstance = new RecurringSchedule(recurEvery: 1, 422 period: Period.get(2), 423 task: Task.get(2)) 424 BootStrapSaveAndTest(recurringScheduleInstance) 425 420 426 /************************* 421 427 START OF INVENTORY … … 423 429 424 430 //InventoryStore 425 def inventoryStoreInstance 431 def inventoryStoreInstance 426 432 427 433 inventoryStoreInstance = new InventoryStore(site: Site.get(1), name: "Store #1") … … 561 567 562 568 //MaintenancePolicy 563 def maintenancePolicyInstance 569 def maintenancePolicyInstance 564 570 565 571 //MaintenancePolicy #1 566 572 maintenancePolicyInstance = new MaintenancePolicy(name: "Fixed Time") 573 BootStrapSaveAndTest(maintenancePolicyInstance) 574 575 //MaintenancePolicy #2 576 maintenancePolicyInstance = new MaintenancePolicy(name: "Condition Based Online") 577 BootStrapSaveAndTest(maintenancePolicyInstance) 578 579 //MaintenancePolicy #3 580 maintenancePolicyInstance = new MaintenancePolicy(name: "Condition Based Offline") 581 BootStrapSaveAndTest(maintenancePolicyInstance) 582 583 //MaintenancePolicy #4 584 maintenancePolicyInstance = new MaintenancePolicy(name: "Design Out") 585 BootStrapSaveAndTest(maintenancePolicyInstance) 586 587 //MaintenancePolicy #5 588 maintenancePolicyInstance = new MaintenancePolicy(name: "Operate To Failure") 567 589 BootStrapSaveAndTest(maintenancePolicyInstance) 568 590 … … 575 597 BootStrapSaveAndTest(plannedMaintenanceInstance) 576 598 599 //PM #2 600 plannedMaintenanceInstance = new PlannedMaintenance(name: "PM2", 601 recurringSchedule: RecurringSchedule.get(1)) 602 BootStrapSaveAndTest(plannedMaintenanceInstance) 603 577 604 //MaintenanceAction 578 605 def maintenanceActionInstance 579 606 580 maintenanceActionInstance = new MaintenanceAction(description: "Do this", 607 //MaintenanceAction #1 608 maintenanceActionInstance = new MaintenanceAction(maintenanceAction: "Check all E-stops, active E-stop S1-S12 and ensure machine cannot run", 609 pmStepNumber: 1, 610 maintenancePolicy: MaintenancePolicy.get(1), 611 plannedMaintenance: PlannedMaintenance.get(1)) 612 BootStrapSaveAndTest(maintenanceActionInstance) 613 614 //MaintenanceAction #2 615 maintenanceActionInstance = new MaintenanceAction(maintenanceAction: "Do more pushups", 616 pmStepNumber: 2, 617 maintenancePolicy: MaintenancePolicy.get(1), 618 plannedMaintenance: PlannedMaintenance.get(1)) 619 BootStrapSaveAndTest(maintenanceActionInstance) 620 621 //MaintenanceAction #3 622 maintenanceActionInstance = new MaintenanceAction(maintenanceAction: "Ok just one more pushup", 623 pmStepNumber: 3, 581 624 maintenancePolicy: MaintenancePolicy.get(1), 582 625 plannedMaintenance: PlannedMaintenance.get(1)) … … 584 627 585 628 //SystemSection 586 def systemSectionInstance 587 629 def systemSectionInstance 630 631 //SystemSection #1 588 632 systemSectionInstance = new SystemSection(name: "Press Section", 589 633 site: Site.get(1)) 590 634 BootStrapSaveAndTest(systemSectionInstance) 591 635 636 //SystemSection #2 637 systemSectionInstance = new SystemSection(name: "RO System", 638 site: Site.get(2)) 639 BootStrapSaveAndTest(systemSectionInstance) 640 641 //SystemSection #3 642 systemSectionInstance = new SystemSection(name: "Auxilliray Section", 643 site: Site.get(1)) 644 BootStrapSaveAndTest(systemSectionInstance) 645 592 646 //AssetType 593 647 def assetTypeInstance 594 648 595 649 //AssetType #1 596 assetTypeInstance = new AssetType(name: "Folder")597 BootStrapSaveAndTest(assetTypeInstance)598 599 //AssetType #2600 650 assetTypeInstance = new AssetType(name: "Print Unit") 601 651 BootStrapSaveAndTest(assetTypeInstance) 602 652 603 //AssetExtendedAttributeType 604 def assetExtendedAttributeInstanceType 605 606 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Model Number") 607 BootStrapSaveAndTest(assetExtendedAttributeInstanceType) 608 609 //AssetExtendedAttribute 610 def assetExtendedAttributeInstance 611 612 //AssetExtendedAttribute #1 613 assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "mark 2", 614 assetType: AssetType.get(1), 615 assetExtendedAttributeType: AssetExtendedAttributeType.get(1)) 616 BootStrapSaveAndTest(assetExtendedAttributeInstance) 653 //AssetType #2 654 assetTypeInstance = new AssetType(name: "Reactor Tower") 655 BootStrapSaveAndTest(assetTypeInstance) 617 656 618 657 //Assembly … … 620 659 621 660 //Assembly #1 622 assemblyInstance = new Assembly(name: " Delivery Belts")661 assemblyInstance = new Assembly(name: "Print Couple") 623 662 BootStrapSaveAndTest(assemblyInstance) 624 663 // assemblyInstance.addToMaintenanceActions(MaintenanceAction.get(1)) 625 664 626 665 //Assembly #2 627 assemblyInstance = new Assembly(name: " Print Couple",666 assemblyInstance = new Assembly(name: "Agitator", 628 667 lifeplan: LifePlan.get(1)) 629 668 BootStrapSaveAndTest(assemblyInstance) … … 633 672 634 673 //SubAssembly #1 635 subAssemblyInstance = new SubAssembly(name: "C entre Belt")674 subAssemblyInstance = new SubAssembly(name: "Cylinder") 636 675 BootStrapSaveAndTest(subAssemblyInstance) 637 676 638 677 //SubAssembly #2 639 subAssemblyInstance = new SubAssembly(name: " Form Roller")678 subAssemblyInstance = new SubAssembly(name: "Gearmotor") 640 679 BootStrapSaveAndTest(subAssemblyInstance) 641 680 … … 651 690 BootStrapSaveAndTest(componentItemInstance) 652 691 653 654 692 //Asset 655 693 def assetInstance 656 694 657 695 //Asset #1 696 assetInstance = new Asset(name: "Print Unit 22", 697 assetType: AssetType.get(1), 698 systemSection: SystemSection.get(1)) 699 BootStrapSaveAndTest(assetInstance) 700 // assetInstance.addToMaintenanceActions(MaintenanceAction.get(1)) 701 702 //Asset #2 703 assetInstance = new Asset(name: "Print Unit 21", 704 assetType: AssetType.get(1), 705 systemSection: SystemSection.get(1)) 706 BootStrapSaveAndTest(assetInstance) 707 708 //Asset #3 658 709 assetInstance = new Asset(name: "Print Unit 23", 659 710 assetType: AssetType.get(1), … … 661 712 BootStrapSaveAndTest(assetInstance) 662 713 663 //Finally did it all work. 714 //Asset #4 715 assetInstance = new Asset(name: "RO 1", 716 assetType: AssetType.get(2), 717 systemSection: SystemSection.get(2)) 718 BootStrapSaveAndTest(assetInstance) 719 720 //AssetExtendedAttributeType 721 def assetExtendedAttributeInstanceType 722 723 //AssetExtendedAttributeType #1 724 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Model Number") 725 BootStrapSaveAndTest(assetExtendedAttributeInstanceType) 726 727 //AssetExtendedAttributeType #2 728 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Purchase Cost") 729 BootStrapSaveAndTest(assetExtendedAttributeInstanceType) 730 731 //AssetExtendedAttributeType #3 732 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Serial Number") 733 BootStrapSaveAndTest(assetExtendedAttributeInstanceType) 734 735 //AssetExtendedAttributeType #4 736 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Manufactured Date") 737 BootStrapSaveAndTest(assetExtendedAttributeInstanceType) 738 739 //AssetExtendedAttributeType #5 740 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Location Description") 741 BootStrapSaveAndTest(assetExtendedAttributeInstanceType) 742 743 //AssetExtendedAttribute 744 def assetExtendedAttributeInstance 745 746 //AssetExtendedAttribute #1 747 assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "PU Mark 2", 748 asset: Asset.get(1), 749 assetExtendedAttributeType: AssetExtendedAttributeType.get(1)) 750 BootStrapSaveAndTest(assetExtendedAttributeInstance) 751 752 //AssetExtendedAttribute #2 753 assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "On the far side of Tank 5", 754 asset: Asset.get(1), 755 assetExtendedAttributeType: AssetExtendedAttributeType.get(5)) 756 BootStrapSaveAndTest(assetExtendedAttributeInstance) 757 758 /************************* 759 Finally did it all work. 760 **************************/ 664 761 if(BootStrapDemoDataSuccessful) { 665 762 println "BootStrapping demo data...successful." … … 668 765 } 669 766 670 //Call this function instead of .save() 767 /**************************************** 768 Call this function instead of .save() 769 *****************************************/ 671 770 void BootStrapSaveAndTest(object) { 672 771 if(!object.save()) {
Note: See TracChangeset
for help on using the changeset viewer.