Repete to Connect- Feed Production

Introduction

Project Scope

Currently there is no process of connection to a Repete system and creating ERP work orders. This wiki will address the process of connection and mapping contents from a Repete system into a new AAI staging environment called Feed Production.

Features

  1. A new feature will be designed in our AAI application that will connect to a Repete system and query production data.
  2. A wizard will be created to set the parameters that will be sent to a Repete system,
  3. A process will be created that takes the parameters from a wizard, selects Repete production data and Maps to AAI staging Feed Production table.
  4. These records will reside in a staging table, where they can be edited and reviewed.   
  5.  Repete Data  Structure to AAI Feed Production Staging:

Process Flow:

Case 13333

Implementation Constraints

  1. This SRS covers the import of Repete Feed Production records ,but none of the code that calls the system should be hard-coded in the process. Factories will be created that return configurations from the database. These configurations determine which configuration you are using for your Repete system, which will determine which Data Access class you query results to and from.
  2. Sarbanes–Oxley: Every accounting record in AAI needs to be traceable back to its origin. Save the index or id of the record from the ERP or AIM system with every staged Repete Production record. No exceptions.

Assumptions & Dependencies

Aspects of This feature will need to be rewritten when we interface with any other AIM and ERP systems. We will address those changes in another SRS. 

System Features

Feature #1 - Repete System Production Overview 

Description
  1. We will create a system for importing Repete Production records into staging tables in AAI.
  2. Users will  review this data then mark as ready to be processed by ERP in AAI.
  3. All of the features for this system will be located at the Main Form>Feed Mill > Feed Production).
Sequences
  1. The button group "Feed Production to ERP Work Order" resides on the "Feed Mill page of the main form.
  2. The button group will have two buttons on it, in this order:
    • New Batch
      • Users will enter filter criteria and return records that will be saved with a batch number to a staging table.
    • View Batch
      • Users can save a staged batch without actually promoting the data, when they want to return to a batch that they have saved they will open this form, enter some criteria (batch date, batch code, batch number, etc) and that batch will open with its staged data.
Functional Requirements
  1. Labeling the the Feed Mill at runtime:
    1. In documentation, whenever you see a name or description in "<>" blocks that means it is being labeled at runtime, based off of a configuration.
    2. The System Configuration object used by the UI should have a property that tells it what accounting system we are interfaced with, and get the description to set the label. 
  2. From AgriSoft AIM

 

Feature #2 - Feed Production Wizard

Description
  1. When users wish to import a batch of Repete Feed Production records, they will open a wizard that allows them to select criteria for gathering data.
  2. The wizard will call the import process, get the records that match the criteria and then add them to the staging table(s).
  3. This wizard will associate imported records with a batch and a user, save the import parameters and open the staging form.
Sequences
  1. From the "Main Form>Feed Mill > Feed Production to ERP Work Order  group section.
  2. The user will click the "New Batch" button, opening the wizard:
  3. Depending on the Repete system the appropriate wizard will open.
Wizard Flow
  • Repete Wizard Controls
  • ControlControl Label ValuesComment
    Drop Down ListSelect CompanyList of Companies 
    Drop Down List Select DivisionList of Divisions 
    Calendar ControlStart DateCalendar 
    Calendar ControlEnd DateCalendar 
        
  1. Wizard Buttons:
    1. Back Button
      1. This is a "Windows Metro" style back button. Clicking this returns the user to the previous wizard page.
      2. Unless one page's values are dependent on the other a user's selections should be persisted when they navigate back and then forward.
    2. Next Button
      1. This button promotes the wizard to a next page. What else is there to say about that?
      2. Oh, I know! we may, in some situations, add validation that will prevent a user from paging forward until the wizard validation is satisfied.
    3. Finish Button
      1. Clicking the finish button:
        1. Formats the parameters as xml.
        2. Passes the parameters to the process.
        3. Opens the batch form, closes the wizard and passes control to the staging form. 
Functional Requirements
  1. Complex Validation:
    1. There are no complex validation considerations to document at this time.
    2. There are plenty of validation considerations that we can make, bu we'll refrain until customers report that invalid wizard entries cause problems.
  2. Closing the wizard:
    1. Closing the wizard does not save the parameters.
    2. Closing the wizard does not prompt
  3. Loading Saved Wizard Parameters:
    1. AAI has a very nifty strategy for saving and loading parameters.

    2. Whenever a batch is created from a wizard, we will turn all of its search parameters into XML and save them with the batch.

      1. The controls on the wizard should know how to read and write their own xml parameters.

      2. The xml parameters should be uncomplicated and easy to understand when viewing the xml.

    3. The next time a user wants to run a batch of this type, we will go get the last parameters from the last batch that they saved and load them into the new batch! This guarantees that:

      1. We have a mechanism for saving parameters

      2. We know what parameters the users entered to get their staged results

 

Feature #3 -Repete Feed Production Process and Mapping

               

Description
  1. When users complete their entry on an import wizard control will be passed to the process.
  2. The process will get records from the Repete data source, convert them into AAI entities, qualify them for the batch and then save the batch into staging.
Sequences
  1. Completing the wizard.
    1. The wizard will pass items to the web service / process.
    2. The user that ran the wizard.
    3. An xml string representation of the parameters.
  2. Getting the records.
    1. Query the Repete DataSource.
    2. Process file and map fields to AAI staging table.
  3. Qualifying the records.
    1. Compare the records RunID to the idReferenceIn fields in AAI.
    2. For each recorded in the queried result that is already in the FeedProduction_ Stage table we need to add a warning message that this record belongs to another batch!
    3. Add a message to a collection of messages for this batch that reads "A record was returned that belongs to an existing batch. [Batch ID], Batch Code: [Batch Code], User:[UserName],Formula [RUNID].
    4. Message Severity:Warning.
  4. Saving the batch.
    1. Once we have returned and qualified the records we need to save the batch:
    2. Save the batch information to FeedProduction_Batch:
      1. Batch Code: Empty String
      2. Batch Date: The Server DateTime
      3. UserID: The User that ran the batch.
      4. Batch Parameters: The xml string that the user sent the process.
      5. Total Records: Count of the records in the batch (after qualification).
      6. Total Messages: Count of the messages in the batch (after qualification).
      7. Total Promoted: 0.
      8. Return a Batch ID from the database.
    3. Save the batch messages to Formula_Message:
      1. Batch ID
      2. Severity
      3. Message
      4. Save the Formula Line Items to Formula_Stage.
Functional Requirements
Repte Batch Transaction DataSource Definition and Map

Repete Data Exchange Connector Spec.docx

 

I.     

Feature #4 - Feed Production Import Staging Form

 

Description
  1. When a wizard is finished running, or when user elect to view an existing batch, they will load on a staging form that users will use to edit data and prepare it for processing by ERP.
  2. The Staging records grid will consist of a master grid for 
Sequences
  1. The staging form consist of three parts. The top part consists of fields that detail the batch the records as associated with, the second half are two tab panels with developer express data grids on them. One tab is for "Batch Records" and the third is the "Batch Errors".
  2. The Fields on the staging form (master record) are:
    1. FieldTypeDefaultValidation
      Batch IDRead-Only String  
      Batch CodeText InputEmpty 
      Batch DateRead-Only Date / Time  
      User NameRead-Only String

Feed Production Table structures

            

Repete Data Structure

 

Run: A work order that creates one or more batches of a formula.

Batch One or more batches of a formula that make up a run.

Transaction: One or more ingredients that make up a batch.

TransactionalBag:  I don’t know what this table stores but it looks like one or more bar codes for each ingredient and lot associated with a transaction.

Feature #5 Repete DataSource to AAI Feed Production Staging:

   For each record in the Repete we will create an entry in the FeedProduction Stage Table.

    Mapping

    
FeedProduction Stage ColumnRepete Source Column Comment
IdFeedProductionStageNot Mapped 
fkFeedProductionBatchNot Mapped 
IdReferenceIDRun.ID 
SourceFormulaCodeRun.FormulaIDCode 
MappedFormulaCodeGeneric Map value 
ProductionDateRun.StartTime 
DivisionCodeTBDNeed to verify with ERP
FormulaBatchNot Mapped 
IncludeInBatchNot Mapped 
LocationCodeTransaction.LotNumber 
DestinationBinTBD 
   
FeedProductionIngredient ColumnRepete Source ColumnComment
idFeedProductionIngredientNot Mapped 
fkFeedProductionStageNot Mapped 
SourceIngredientCodeTransaction.IDCode 
ActualProductionPackTransaction.ActualAmount 
ActualProductionUnitsTransaction.ActualAmount 
PlannedProdictionPackTransaction.RequiredAmount 
PlannedProductionUnitsTransaction.RequiredAmount 
   

Non-Functional Requirements

Performance

None at this time.

Security

None at this time.

Quality

None at this time.