Project Description

POM is a Preactor library which provides easy access and manipulation of Preactor data.

The Preactor Object Model or "POM" for short, is a library that sits on top of the Preactor API www.preactor.com and is meant to facilitate the extraction and manipulation of Preactor data in customised projects.

Now hosted on NuGet and ready to include in your project:
Preactor.ObjectModel: https://nuget.org/packages/Preactor.ObjectModel
Preactor.ObjectModelExtensions: https://nuget.org/packages/Preactor.ObjectModelExtensions

NOTE: POM does not replace the base Preactor API. You can use both in the same project. You can switch from POM to the Preactor API very easily.

Project Links

How To Join This Project:

Everyone is encouraged to join this project and provide feedback and suggestions. Please use the "Discussions" forum if you have any questions.

If you have written some code based on POM and would like to include it in the library, please let us know so we can grant you commit privileges.

Things that you can contribute to:

  • Documentation
  • Design/Architecture
  • Code
  • Discussions by providing ideas and feedback

What Does POM Look Like?

Operation op = pom.GetOperation(3); // This will return an operation object corresponding to record number 3 in he Orders table

if(op.IsScheduled)
{
    Console.Writeline("Operation 3 is scheduled on resource {0}", op.ResourceName);
}

// It is simple to query the operation for data with:
var startTime  = op.StartTime;
var endTime = op.EndTime;
var productName = op.ProductName;

// Setting values is also simple
op.EarliestStartTime = new DateTime(...);
op.Priority = 100;

// You can also Schedule or Unschedule 
op.Unschedule(); 
op.Schedule("Resource1", new DateTime(...));

// Or you can also use the QuickSchedule() method and pom will look at the resource group
// and find the resource that will complete the operation the fastest
op.QuickSchedule(new DateTime(...));

// You can also use LINQ to object to get the data you need. For example:
// Find all the operations that are not scheduled but have a required resouce equal to ABC, and the sort them by priority, and then by due date
var ops = pom.GetAllOperations().Where(op => !op.IsScheduled)
                                .Where(op => op.RequiredResource == "ABC")
                                .OrderBy(op => op.Priority)
                                .ThenBy(op => op.DueDate);

// You can then schedule all these operations like this:
ops.Foreach(op => op.QuickSchedule(TerminatorTime));
// You can also do the same for Products, Resources, ResourceGroups, Secondary Constraints

Product prod = pom.GetProduct(5);
Resource res = pom.GetResource(12);
ResourceGroup resGroup = pom.GetResourceGroup(2);
SecondaryConstraint sc = pom.GetSecondaryConstraint(7);

// You can also get all the the resource names associated with a given resource group

var resourceNames = resGroup.ResourceNames;

// Or retrieve an IEnumerable of Resource objects

var resources = resGroup.Resources; // resources.ToList() will return a List<Resource>

Last edited Aug 27, 2013 at 1:18 PM by bvsms, version 45