how to create the blank form without having the first screen related to it?

how to create the blank form without having the first screen related to it?

  


Hi 

Anyone please tell me how  to create the BLANK  reservation form without having the first screen(like reservation list screen) related to it(reserve form screen).  I`ve put the requester entity and the patient entity  in the preparation of the reserve form(web screen). It has the filled input in the form in the 3rd pic.

Also without putting it,i have to assign the variable and source entity ! 


Department -------->Department Details(by departmentId)------------>MakeReservation(problem here!) 


Thanks ahead!

Hi EiMon,

In the "Make Reservation" link(in your 2nd screenshot), just pass the input parameter as "NullIdentifier()".

Hi EiMon WinAung, 

You could be using the same pattern you've used for the DepartmentDetail screen (assuming later you may want to show (and maybe even modify) the details of a Reservation):

  • Add a ReservationId as input parameter, pass it the value NullIdentifier() if you want to create a new Reservation.
  • Open the Preparation and drag the ReservationId to the action flow. This should create an Aggregate with source Reservation, and a filter to only return the Reservation with Id equal to ReservationId.
  • Bind your form to the Aggregate's List.Current record
  • Create a Save action that creates (or updates) the details of your Reservation.

The easiest way to do this would be to scaffold Reservation twice, the same way you did with Department, it will generate all this for you automatically.

In your case, since I believe you may need the DepartmentId in order to create new Reservations, my suggestion would be to:

  • Make the ReservationId optional, the Default Value of an identifier data type is NullIdentifier()
  • Add an optional input parameter to your screen called DepartmentId.
  • Optionally, if you want to force a reservation to have an associated Department, then on the preparation you may want to do some extra validation as a failsafe:
    • If both ReservationId and DepartmentId are NullIdentifier() you will somehow need to navigate to another screen (likely the previous screen) and display a message stating the problem (tried to make a reservation without stating the department). 
  • Open the Save action and add an If condition before the CreateOrUpdateReservation entity action, that checks whether the screen received a valid ReservationId or NullIdentifier(). If it received NullIdentifier() you need to assign to your Aggregate's List.Current.Reservation.DepartmentId the value of the DepartmentId input parameter before continuing to the CreateOrUpdateReservation.

Hope this helps!

Pravi Gupta wrote:

Hi EiMon,

In the "Make Reservation" link(in your 2nd screenshot), just pass the input parameter as "NullIdentifier()".

Thanks Pravi Gupta...I am working on that.


Jorge Martins wrote:

Hi EiMon WinAung, 

You could be using the same pattern you've used for the DepartmentDetail screen (assuming later you may want to show (and maybe even modify) the details of a Reservation):

  • Add a ReservationId as input parameter, pass it the value NullIdentifier() if you want to create a new Reservation.
  • Open the Preparation and drag the ReservationId to the action flow. This should create an Aggregate with source Reservation, and a filter to only return the Reservation with Id equal to ReservationId.
  • Bind your form to the Aggregate's List.Current record
  • Create a Save action that creates (or updates) the details of your Reservation.

The easiest way to do this would be to scaffold Reservation twice, the same way you did with Department, it will generate all this for you automatically.

In your case, since I believe you may need the DepartmentId in order to create new Reservations, my suggestion would be to:

  • Make the ReservationId optional, the Default Value of an identifier data type is NullIdentifier()
  • Add an optional input parameter to your screen called DepartmentId.
  • Optionally, if you want to force a reservation to have an associated Department, then on the preparation you may want to do some extra validation as a failsafe:
    • If both ReservationId and DepartmentId are NullIdentifier() you will somehow need to navigate to another screen (likely the previous screen) and display a message stating the problem (tried to make a reservation without stating the department). 
  • Open the Save action and add an If condition before the CreateOrUpdateReservation entity action, that checks whether the screen received a valid ReservationId or NullIdentifier(). If it received NullIdentifier() you need to assign to your Aggregate's List.Current.Reservation.DepartmentId the value of the DepartmentId input parameter before continuing to the CreateOrUpdateReservation.

Hope this helps!

Hello Jorge Martins

Thank u so much  for the full explanation .I think it will work but  I didnt create the reservation entity and i split the Patient entity and Requester entity for the reservation form.is it require to create the reservation entity ?? To put the reservationId in the main flow is in the reservation screen or departmentdetail screen? i think department detail screen :) 

Thanks ahead Jorge!


Solution

I don't know your business, but if you want to "Make Reservation" it seems to make sense you have an entity representing that concept, no?...

Is there any way of relating a Requestor, to a Patient to a Department (or Doctor?)? If the answer is no, then you need the Reservation entity to bind it all together (a Reservation would be for a specific Department or Doctor, requested by a specific Requestor, for a specific Patient).

Whether the Requestor and the Patient are independent concepts or their attributes should be merged into this Reservation concept... that's up to you to decide, depending on your applications other requirements.

In any case, if you end up with Requestor, Patient and Reservation, nothing stops you from opening the GetReservationById aggregate on the Preparation and just dragging the Requestor and Patient entities into it, if your data model is correctly defined it should create joins for those two entities and return all the information you need to fill out your form. But don't forget that when you save the Reservation, you should also save the Requestor and Patient info that the user may have changed.

Solution

Jorge Martins wrote:

I don't know your business, but if you want to "Make Reservation" it seems to make sense you have an entity representing that concept, no?...

Is there any way of relating a Requestor, to a Patient to a Department (or Doctor?)? If the answer is no, then you need the Reservation entity to bind it all together (a Reservation would be for a specific Department or Doctor, requested by a specific Requestor, for a specific Patient).

Whether the Requestor and the Patient are independent concepts or their attributes should be merged into this Reservation concept... that's up to you to decide, depending on your applications other requirements.

In any case, if you end up with Requestor, Patient and Reservation, nothing stops you from opening the GetReservationById aggregate on the Preparation and just dragging the Requestor and Patient entities into it, if your data model is correctly defined it should create joins for those two entities and return all the information you need to fill out your form. But don't forget that when you save the Reservation, you should also save the Requestor and Patient info that the user may have changed.


Thank you so much and sorry for your time.

Jorge Martins , for not only telling me the answer , you also taught me how to think . 

Thanks indeed! 

eimon