The 1000 steps program to MDriven Chapter 17

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 17: Default names, Dim Default, and More

To make your experience smooth, we set the main tags mentioned in the video to the right bar menu of this mini-player. Choose an interesting subtitle on the list and immediately get to the exact theme navigation item place in the video. Now you can pick any topic to be instructed on without watching the whole video.

Dealing with Model Changes Introduction Discussion on Renaming Check changes Amend an action & an expression CarDealerPicker ViewModel PickBuyer ViewModel action Test the PickBuyer button Discussions on model changes

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

In this chapter, we:

  • Create a 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 the 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 ViewModel column names that have an 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 CreateAndAddDocumentForSales to set the selected Car.

541. Add the Car's 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 UI Hints. Copy the ValueStore Auto Form.

546. Move the global action into the Views MenuGroup.

547. Clean up unneeded columns from the DocumentForSales grid.

548. Add an action in the 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 model 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 use 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 PickBuyer 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 is already in an Ownership transaction.

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

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

This page was edited 25 days ago on 03/04/2024. What links here