The 1000 steps program to MDriven Chapter 17
No edit summary
No edit summary
Line 1: Line 1:
This is Chapter 17. If you want to go back to the beginning, [[The 1000 steps program to MDriven Chapter 1|you can find it here: Chapter 1]]
This is '''Chapter 17'''. If you want to go back to the beginning, [[The 1000 steps program to MDriven Chapter 1|you can find it here: Chapter 1.]] Or go back to [[The_1000_steps_program_to_MDriven_Chapter_16|Chapter 16.]]
 
Go back to Chapter 16: [[The_1000_steps_program_to_MDriven_Chapter_16]]
 
Default names, dim default, plural suffix, what happens when the model is changed - is your data lost?
 
Modal window - pick a seller
 
Check valid action based on current state with oclIsInState
 
Make use of GetSystemURL Eco.ExternalLateBound function to make our report work on any server


Video for chapter 17: https://youtu.be/m1oer_jjQh4
Video for chapter 17: https://youtu.be/m1oer_jjQh4


531. Change the name of a Association that has data in it - what happens on evolve with exiting data
== Chapter 17: Default names, Dim Default, Plural Suffix; What Happens When the Model Is Changed - Is Your Data Lost? ==
 
* Modal window - pick a seller
532. Update the versions on MDrivenServer
* Check valid action based on current state with oclIsInState
 
* Make use of GetSystemURL Eco.ExternalLateBound function to make our report work on any server
533. Follow the discussion of where foreign keys are stored in the database
531. Change the name of an Association that has data in it - what happens on evolve with existing data?


534. Rename the CarFactory.BrandOfCar and check with changes what would happen
532. Update the versions on MDrivenServer.


535. Follow the discussion of Former-Names and understand benefit to move data  when things change in the db
533. Follow the discussion of where foreign keys are stored in the database.


536. Follow the discussion of the rename-function vs just changing the name
534. Rename the ''CarFactory.BrandOfCar'' and check with changes what would happen.


537. In the CarFactoryView - amend the action CreateAndAddCodumentForSales  according to the video
535. Follow the discussion of Former-Names and understand the benefit of moving data when things change in the db.


538. Follow the discussion what ViewModel column names that has underscore in  them
536. Follow the discussion of the rename-function vs just changing the name.


539. Follow the discussion on whay it is unnecessary to set both ends of an  association in MDriven
537. In the CarFactoryView, amend the action <code>CreateAndAddCodumentForSales</code> according to the video.


540. Amend the expression for CreateAndAddCodumentForSales to set the selected  Car
538. Follow the discussion on what ViewModel column names that have underscore in them.


541. Add the Cars registration and State to the DocumentForSales grid
539. Follow the discussion on why it is unnecessary to set both ends of an association in MDriven.


542. Discover that The we actually use the state machine to create the paperwork for a sale
540. Amend the expression for CreateAndAddCodumentForSales to set the selected Car.


543. Clean up the model according to the video
541. Add the Cars registration and State to the DocumentForSales grid.


544. Set up the rule to stop deletion of the PaperWork as long as a is not in  InOwnershipTransaction
542. Discover that we actually use the Statemachine to create the paperwork for a sale.


545. Create a new Viewmodel named CarDealerPicker - by using UIHints  CopyValueStore autoForm
543. Clean up the model according to the video.


546. Move the global action into the Views manuGroup
544. Set up the rule to stop deletion of the PaperWork as long as it is not in ''InOwnershipTransaction''.


547. Clean up un needed columns from the DocumentForSales grid
545. Create a new ViewModel named CarDealerPicker - by using UIHints. CopyValueStore autoForm.


548. Add an action in DocumentForSales grid - call it PickBuyer
546. Move the global action into the Views MenuGroup.


549. Create a new ViewModelAction that bring up our the new CarDealerPicker  viewModel - call that also PickBuyer
547. Clean up unneeded columns from the DocumentForSales grid.


550. Set the PickBuyer viewmodel action as "Is modal"
548. Add an action in DocumentForSales grid - call it PickBuyer.


551. When you show a dialog as modal you must give an expression to decide  when the "Ok" button in the modal should show - set it to  vCurrent_CarDealer->notempty
549. Create a new ViewModelAction that brings up the new CarDealerPicker ViewModel - call that also PickBuyer.


552. When you have a dialig as model - you can also perfom something specific  upon the user pressing OK - This is called the Expression after modal ok. In  our case we want to  vCurrent_DocumentForSales.Buyer:=vModalResult_vCurrent_CarDealer
550. Set the PickBuyer ViewModel action as <code>"Is modal"</code>.


553. Save model - and upload it to MDrivenServer
551. When you show a dialog as modal, you must give an expression to decide  when the "Ok" button in the modal should show - set it to <code>vCurrent_CarDealer->notempty</code>


554. Test to assign a buyer - see that the CarDealer-picker shows - but it is  empty
552. When you have a dialog as modal, you can also perform something specific upon the user pressing OK. This is called the Expression after modal ok. In our case, we want to <code>vCurrent_DocumentForSales.Buyer:=vModalResult_vCurrent_CarDealer</code>


555. Go to Views/CarDealerPicker - and use the left side actions to create 3  dealers - give them names - save
553. Save the model and upload it to MDrivenServer.


556. Navigate back to the CarFactoryView and test the Pick buyer button again
554. Test to assign a buyer. See that the CarDealer-picker shows - but it is empty.


557. Verify that the DeleteDocumentForSales readonly rule works as designed - not allowing delete of paperwork in a Ownership transaction
555. Go to Views/CarDealerPicker and use the left side actions to create 3  dealers - give them names. Save.


558. Initiate sale of a new car. Verify that you cannot do Initiate sale on a  car that already is in a Ownership transaction
556. Navigate back to the CarFactoryView and test the Pick Buyer button again.


559. Follow the discussion in the video on why the report does not work any  longer.
557. Verify that the DeleteDocumentForSales read-only rule works as designed -  not allowing deletion of paperwork in an Ownership transaction.


560. Follow the discussion on how to get a access to the servers own adress  from within our model
558. Initiate the sale of a new car. Verify that you cannot do Initiate Sale on a car that already is in an Ownership transaction.


561. Follow the discussion on methods tagged with Eco.ExternalLateBound tag  value
559. Follow the discussion in the video on why the report does not work any longer.


562. In the report template viewmodel  TheTemplateForCarTransferOwnersdhipDocumentReport change the TemplateUrl  expression to NOT return a hard coded server address but rather ask the system for the correct server address just in time.
560. Follow the discussion on how to get access to the server's own address from within our model.


563. Upload the model and test to produce the document.
561. Follow the discussion on methods tagged with the ''Eco.ExternalLateBound'' tag value.


562. In the report template ViewModel, ''TheTemplateForCarTransferOwnersdhipDocumentReport,'' change the TemplateUrl expression to NOT return a hard-coded server address but rather ask the system for the correct server address just in time.


[[File:AfterChapter17.zip|none|thumb]]
563. Upload the model and test to produce the document.[[File:AfterChapter17.zip|none|thumb]]


'''Next Chapter:''' [[The_1000_steps_program_to_MDriven_Chapter_18]]
'''Next Chapter:''' [[The_1000_steps_program_to_MDriven_Chapter_18]]
[[Category:1000 Steps Program]]
[[Category:1000 Steps Program]]

Revision as of 06:57, 28 July 2023

This is Chapter 17. If you want to go back to the beginning, you can find it here: Chapter 1. Or go back to Chapter 16.

Video for chapter 17: https://youtu.be/m1oer_jjQh4

Chapter 17: Default names, Dim Default, Plural Suffix; What Happens When the Model Is Changed - Is Your Data Lost?

  • Modal window - pick a seller
  • Check valid action based on current state with oclIsInState
  • Make use of GetSystemURL Eco.ExternalLateBound function to make our report work on any server

531. Change the name of an Association that has data in it - what happens on evolve with existing data?

532. Update the versions on MDrivenServer.

533. Follow the discussion of where foreign keys are stored in the database.

534. Rename the CarFactory.BrandOfCar and check with changes what would happen.

535. Follow the discussion of Former-Names and understand the benefit of moving data when things change in the db.

536. Follow the discussion of the rename-function vs just changing the name.

537. In the CarFactoryView, amend the action CreateAndAddCodumentForSales according to the video.

538. Follow the discussion on what ViewModel column names that have underscore in them.

539. Follow the discussion on why it is unnecessary to set both ends of an association in MDriven.

540. Amend the expression for CreateAndAddCodumentForSales to set the selected Car.

541. Add the Cars registration and State to the DocumentForSales grid.

542. Discover that we actually use the Statemachine to create the paperwork for a sale.

543. Clean up the model according to the video.

544. Set up the rule to stop deletion of the PaperWork as long as it is not in InOwnershipTransaction.

545. Create a new ViewModel named CarDealerPicker - by using UIHints. CopyValueStore autoForm.

546. Move the global action into the Views MenuGroup.

547. Clean up unneeded columns from the DocumentForSales grid.

548. Add an action in DocumentForSales grid - call it PickBuyer.

549. Create a new ViewModelAction that brings up the new CarDealerPicker ViewModel - call that also PickBuyer.

550. Set the PickBuyer ViewModel action as "Is modal".

551. When you show a dialog as modal, you must give an expression to decide when the "Ok" button in the modal should show - set it to vCurrent_CarDealer->notempty

552. When you have a dialog as modal, you can also perform something specific upon the user pressing OK. This is called the Expression after modal ok. In our case, we want to vCurrent_DocumentForSales.Buyer:=vModalResult_vCurrent_CarDealer

553. Save the model and upload it to MDrivenServer.

554. Test to assign a buyer. See that the CarDealer-picker shows - but it is empty.

555. Go to Views/CarDealerPicker and use the left side actions to create 3 dealers - give them names. Save.

556. Navigate back to the CarFactoryView and test the Pick Buyer button again.

557. Verify that the DeleteDocumentForSales read-only rule works as designed - not allowing deletion of paperwork in an Ownership transaction.

558. Initiate the sale of a new car. Verify that you cannot do Initiate Sale on a car that already is in an Ownership transaction.

559. Follow the discussion in the video on why the report does not work any longer.

560. Follow the discussion on how to get access to the server's own address from within our model.

561. Follow the discussion on methods tagged with the Eco.ExternalLateBound tag value.

562. In the report template ViewModel, TheTemplateForCarTransferOwnersdhipDocumentReport, change the TemplateUrl expression to NOT return a hard-coded server address but rather ask the system for the correct server address just in time.

563. Upload the model and test to produce the document.File:AfterChapter17.zip

Next Chapter: The_1000_steps_program_to_MDriven_Chapter_18

This page was edited 23 days ago on 04/26/2024. What links here