Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • V vf-apps
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Value Flows
  • VF App Specs
  • vf-apps
  • Issues
  • #4

Closed
Open
Created Sep 18, 2019 by Lynn Foster@lynnfosterOwner

EconomicEvent and EconomicResource create and update

Experimenting with some pseudo-code, please improve as needed. @pospi @ivanminutillo @bhaugen

EconomicEvent which creates an EconomicResource:

If action.resourceEffect is "+" or "-"
    If create-resource flag is set
        Create the resource with zero quantity fields
    Else
        If it exists
            Get the resource based on resourceInventoriedAs
    If there is a resource from the above
        If action.resourceEffect is "+"
            Add event resourceQuantity to both accountingQuantity and onhandQuantity
        Else if action.resourceEffect is "-"
            Subtract event resourceQuantity from both accountingQuantity and onhandQuantity
Else if action.resourceEffect is "-+" or action.onhandEffect is "-+" (two resources can be affected)
    If create-resource flag is set
        Create the to-resource with zero quantity fields
    Else
        Get the to-resource based on toResourceInventoriedAs  
    If it exists in the event
        Get the from-resource based on the resourceInventoriedAs  
    If action is "transfer-custody" or "transfer" or "move"
        If the from-resource exists
            Subtract event resourceQuantity from from-resource.onhandQuantity
        If the to-resource exists
            Add event resourceQuantity to to-resource.onhandQuantity
    If action is "transfer-all-rights" or "transfer" or "move"
        If the from-resource exists
            Subtract event resourceQuantity from from-resource.accountingQuantity
        If the to-resource exists
            Add event resourceQuantity to to-resource.accountingQuantity
If a new resource is created by the economic event 
 or if ((action is "transfer-all-rights" or "transfer") 
 and resourceInventoriedAs is the same as toResourceInventoriedAs)
    Set the  primaryAccountable to the receiver agent
Edited Nov 03, 2020 by Lynn Foster
Assignee
Assign to
Time tracking