10.2.3. Creating the data model for the employee rostering project
Use this section to create the data objects required to run the employee rostering sample project in Business Central.
Prerequisites
- You have completed the project setup described in 「Setting up the employee rostering project」.
Procedure
-
With your new project, either click Data Object in the project perspective, or click Add Asset
Data Object to create a new data object. Name the first data object
Timeslot
, and selectemployeerostering.employeerostering
as the Package.Click Ok.
-
In the Data Objects perspective, click +add field to add fields to the
Timeslot
data object. -
In the id field, type
endTime
. -
Click the drop-down menu next to Type and select
LocalDateTime
. - Click Create and continue to add another field.
-
Add another field with the id
startTime
and TypeLocalDateTime
. - Click Create.
-
Click Save in the upper-right corner to save the
Timeslot
data object. - Click the x in the upper-right corner to close the Data Objects perspective and return to the Assets menu.
Using the previous steps, create the following data objects and their attributes:
Expand 表10.1 Skill id Type name
String
Expand 表10.2 Employee id Type name
String
skills
employeerostering.employeerostering.Skill[List]
Expand 表10.3 Shift id Type requiredSkill
employeerostering.employeerostering.Skill
timeslot
employeerostering.employeerostering.Timeslot
Expand 表10.4 DayOffRequest id Type date
LocalDate
employee
employeerostering.employeerostering.Employee
Expand 表10.5 ShiftAssignment id Type employee
employeerostering.employeerostering.Employee
shift
employeerostering.employeerostering.Shift
For more examples of creating data objects, see Getting started with decision services.
10.2.3.1. Creating the employee roster planning entity リンクのコピーリンクがクリップボードにコピーされました!
In order to solve the employee rostering planning problem, you must create a planning entity and a solver. The planning entity is defined in the domain designer using the attributes available in the Red Hat Business Optimizer dock.
Use the following procedure to define the ShiftAssignment
data object as the planning entity for the employee rostering example.
Prerequisites
- You have created the relevant data objects and planning entity required to run the employee rostering example by completing the procedures in 「Creating the data model for the employee rostering project」.
Procedure
-
From the project Assets menu, open the
ShiftAssignment
data object. -
In the Data Objects perspective, open the Red Hat Business Optimizer dock by clicking the
on the right.
- Select Planning Entity.
-
Select
employee
from the list of fields under theShiftAssignment
data object. In the Red Hat Business Optimizer dock, select Planning Variable.
In the Value Range Id input field, type
employeeRange
. This adds the@ValueRangeProvider
annotation to the planning entity, which you can view by clicking theSource
tab in the designer.The value range of a planning variable is defined with the
@ValueRangeProvider
annotation. A@ValueRangeProvider
annotation always has a propertyid
, which is referenced by the@PlanningVariable
propertyvalueRangeProviderRefs
.- Close the dock and click Save to save the data object.