Skip to main content

system.kanoa.lot.executeLotOperation

This function is part of the kanoaOPS module

Description

Creates or updates a lot operation event with input and output lot events

Syntax

executeLotOperation(lotOperationEventInfo, inputLotEvents, outputLotEvents, userId)
  • Parameters
      lotOperationEventInfo (dict)
      - lotOperationEventId (int)
      - lotOperationId (int)
      - assetId (int)
      - tStamp (datetime)
      - enabled (bool)
      inputLotEvents list[dict]: list of lotEventInfo dictionaries that are consumed by this operation
      - lotEventId (int)
      - lotId (int)
      - lotName (string)
      - itemId (int)
      - lotEventQty (float)
      - itemUnitId (int)
      - workOrderId (int)
      - assetId (int)
      - lotStateId (int)
      - lotStateReasonId (int)
      - shiftId (int)
      - tStamp (datetime)
      - comment (string)
      outputLotEvents list[dict]: list of lotEventInfo dictionaries that are created by this operation
      - lotEventId (int)
      - lotId (int)
      - lotName (string)
      - itemId (int)
      - lotEventQty (float)
      - itemUnitId (int)
      - workOrderId (int)
      - assetId (int)
      - lotStateId (int)
      - lotStateReasonId (int)
      - shiftId (int)
      - tStamp (datetime)
      - comment (string)
      userId (int)
  • Returns
      Number of records modified (int)
      message (string): None if success
  • Code Examples

    # Example usage
    >lotOperationEventInfo = {'lotOperationEventId': None, lotOperationId': 1, 'assetId': 5, 'tStamp': system.date.now(), 'enabled': True}
    >inputLotEvents = []
    >outputLotEvents = [{lotEventId': None, 'lotId': 1, 'lotEventQty': 100, 'workOrderId': 56, 'assetId':1, 'itemSourceId': 2, 'lotStateId': 7, 'lotStateReasonId': 78, 'shiftId': 4, 'tStamp': system.date.now, 'comment':None, 'lotOperationEventId': None}]
    >recordsModified, msg = system.kanoa.lot.executeLotOperation(lotOperationEventInfo, inputLotEvents, outputLotEvents, userId)
    print(recordsModified) # Print the number of records modified