public void CalculateStoreOmittedOrPartlyCompletedShotPoints(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if this was previously done
     // Store the data
     // TODO - SHOULD THIS BE VISUALISED
     // Issue OmittedOrPartlyCompletedShotPointsStored event
 }
Exemple #2
0
        public void Execute(ConsoleEnvironment env, string[] args)
        {
            if (args.Length > 0)
            {
                var myId = 1;
                int.TryParse(args[0], out myId);
            }

            var id = new DrillingDepartmentId(1);

            var story = new List<Command>
                {
                    // create some Command messages that are defined in Messages.cs
                    // and were auto-generated by lokad-codedsl from the text in Messages.ddd
            //                    new OpenDrillingDepartment(id),
                    new ImportPlannedDepartmentStructureFromBid(id, new RequestId()),
                };

            // we have a story as a list of Commands, now send each one of the Commands to
            // the Application Service that is hosting the DrillingDepartment Aggregate
            // the Events generated by the DrillingDepartment Aggregate's that process the Commands will be
            // output to the console in a human-readable way and can be read like a "story about a day in this department"
            foreach (var command in story)
            {
                env.DrillingDepartmentAppService.Execute(command);
            }
        }
        public void AddPlannedWorkgroup(DrillingDepartmentId id, RequestId requestId, WorkgroupEntity we, ITimeProvider provider)
        {
            // Create the Planned Workgroup
            DoWork("Create a Planned Workgroup and add to the Drilling Department Structure");

            RecordAndRealizeThat(new PlannedWorkgroupAddedToDepartment(id, requestId, we, provider.GetUtcNow()));
        }
 public void AssignPlannedMetricsToDrillWorkunits(DrillingDepartmentId id, ITimeProvider provider, string testtext)
 {
     // Check if Drilling Department has already been opened
     // Check if Planned Structure has already been imported
     // TODO - Check if Planned Resources have already been imported into Drilling Department
     // Check if Planned Metrics have already been imported
     // Add the Metrics to the Drilling Department
     // Issue PlannedMetricsAssignedToDrillWorkunits event
     RecordAndRealizeThat(new PlannedMetricsAssignedToDrillWorkunits(id, new RequestId(), provider.GetUtcNow()));
 }
 public void AssignTargetMetricsToDrillWorkunits(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if Drilling Department has already been opened
     // Check if Planned Structure has already been imported
     // TODO - Check if Planned Resources have already been imported into Drilling Department
     // Check if Actual Resources have already been issued
     // Check if Target Metrics have already been assigned to the Drill Workunits
     // Assign the Target Metrics to the Drilling Workunits
     // Issue TargetMetricsAssignedToDrillWorkunits event
 }
 public void IssueMapsLineTracesGpsCordinatesToDrillWorkunits(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if the Maps Line Traces & GPS Coordinates were previously issued to the Drill Workunits
     // Issue the Maps Line Traces & GPS Coordinates
     // Issue MapsLineTracesGpsCordinatesReceivedByEachDrillWorkunit event
 }
 public void SendSurveyedPointsToChiefDriller(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if Surveyed Points were not previously received
     // Send the Surveyed Points To the Chief Driller
     // Issue SurveyedPointsReceivedByChiefDriller event
 }
 public void SendMapsLineTracesGpsCordinatesToTheChiefDriller(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if Maps Line Traces & GPS Coordinates were not previously received
     // Issue Maps Line Traces & GPS Cordinates to the Chief Driller
     // Issue MapsLineTracesGpsCordinatesReceivedByTheChiefDriller event
 }
        // Aggregate's method below modify internal "state" variables by doing their work and generating Events
        public void OpenDrillingDepartment(DrillingDepartmentId id)
        {
            // Check if Drilling Department has already been opened. If the thing that tracks
            // an aggregate's state already has an Id, the agg with that Id already exists!
            if (_aggregateState.Id != null)
                throw DomainError.Named("Domain Error", "Drilling Department has already been created");

            // Open the Drilling Department
            DoWork("Open the Drilling Department");

            // Issue DrillingDepartmentOpened event
            RecordAndRealizeThat(new DrillingDepartmentCreated(id));
        }
Exemple #10
0
 public DrillWorkunitMetricsModified(DrillingDepartmentId id, RequestId requestId, DateTime timeUtc)
 {
     Id = id;
     RequestId = requestId;
     TimeUtc = timeUtc;
 }
 public void DepartmentIdAdded(DrillingDepartmentId deptid)
 {
     Id = deptid;
 }
Exemple #12
0
 public DrillWorkunitsProgressReportsSubmitted(DrillingDepartmentId id, RequestId requestId, DateTime timeUtc)
 {
     Id = id;
     RequestId = requestId;
     TimeUtc = timeUtc;
 }
 public void AmendActualDrillWorkunitResources(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if the Resources were previously issued to the Drill Workunits
     // Amend the Resources
     // Issue DrillWorkunitResourcesAmended event
 }
 public void DrillWorkunitsSubmitProgressReports(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if the Shotpoints were drilled previously
     // Drill Workunits submit their Daily Reports
     // Issue DrillWorkunitsDailyReportsSubmitted event
 }
        public void ImportPlannedDepartmentStructureFromBid(DrillingDepartmentId id, RequestId requestId)
        {
            // Check if Drilling Department has already been opened
            if (_aggregateState.Id == null)
                throw DomainError.Named("Domain Error", "Planned Structure not imported into the Drilling Department");

            // Check if Planned Structure has already been imported for this Drilling Department
            if (_aggregateState.DeptStructure.RootWorkgroup != null)
                throw DomainError.Named("drilling department-structure-already-imported", "Drilling Department Structure already imported");

            // Issue PlannedStructureImportedToTheDrillingDepartment event
            RecordAndRealizeThat(new PlannedDepartmentStructureImportedToTheDrillingDepartment(id, requestId, new DateTime().ToUniversalTime()));
        }
 public void DrillShotPoints(DrillingDepartmentId id, ITimeProvider provider)
 {
     // THIS IS A FIELD ACTIVITY
     // Issue ShotPointsDrilled event
 }
 public void CreateDrillingDepartmentPlan(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if the Drilling Plan was previously created
     // Create the Drilling Plan
     // Issue DrillingDepartmentPlanCreated event
 }
Exemple #18
0
 public InstanceStarted(DrillingDepartmentId id, string codeVersion, string role, string instance)
 {
     Id = id;
     CodeVersion = codeVersion;
     Role = role;
     Instance = instance;
 }
Exemple #19
0
 public ImportPlannedDepartmentStructureFromBid(DrillingDepartmentId id, RequestId requestId)
 {
     Id = id;
     RequestId = requestId;
 }
Exemple #20
0
 public DrillWorkunitsSubmitProgressReports(DrillingDepartmentId id, RequestId requestId)
 {
     Id = id;
     RequestId = requestId;
 }
 public void ChangeWorkgroupName(DrillingDepartmentId id, RequestId requestId, string newName, ITimeProvider provider)
 {
     RecordAndRealizeThat(new WorkgroupNameChanged(id, requestId, newName, provider.GetUtcNow()));
 }
 public void CompileAndIssueDailyReport(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if the Daily Report was previously issued
     // Compile then issue the Daily Report
     // Issue DailyReportCompiledAndIssued event
 }
 public void IssuePlannedResourcesToDrillWorkunits(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if Drilling Department has already been opened
     // Check if Planned Structure has already been imported
     // TODO - Check if Planned Resources have already been imported into Drilling Department
     // Issue the Planned Resources to the Drill Workunits (Workgroups)
     // Issue the PlannedResourcesIssuedToDrillWorkunits event
 }
Exemple #24
0
 public DrillWorkunitResourcesAmended(DrillingDepartmentId id, RequestId requestId, DateTime timeUtc)
 {
     Id = id;
     RequestId = requestId;
     TimeUtc = timeUtc;
 }
 public void CheckDailyReports(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if the Daily Reports were checked previously
     // Check the Daily Reports
     // Issue DailyReportsChecked event
 }
 public void IssuePlanOfShotPointsToDrillWorkunits(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if the Drilling Plan was previously issued to the Drill Workunits
     // Issue the Drilling Plan
     // Issue PlanOfShotPointsIssuedToDrillWorkunits event
 }
 private void Update(DrillingDepartmentId id, Action<DrillingDepartment> update)
 {
     update(ViewInstance.Systems[id]);
 }
 public void ModifyDrillingDepartmentPlan(DrillingDepartmentId id, ITimeProvider provider)
 {
     // Check if the Drilling Department Plan was previously issued to the Drill Workunits
     // Amend the Drilling Department Plan
     // Issue DrillingDepartmentPlanModified event
 }
Exemple #29
0
 public ConsoleSession(ConsoleView view)
 {
     View = view;
     SystemId = new DrillingDepartmentId(1);
     //            CurrentFilter = new AvailableFilter();
 }
 public void ModifyDrillWorkunitMetrics(DrillingDepartmentId id, int metrics, ITimeProvider provider)
 {
     // Check if the Metrics were previously issued to the Drill Workunits
     // Amend the Metrics
     // Issue DrillWorkunitMetricsModified event
 }