system.mes.batch.queue.getBatchBOM(batchID)

Sepasoft MES Module Suite

system.mes.batch.queue.getBatchBOM(batchID)

Retrieves details in a python dictionary of a BOM (Bill of Materials) of a Control Recipe.

Warning

Scripting function queue.getBatchBOM(batchID) is available in versions:

3.81.8 RC1 Release Candidate and later

getBatchBOM(batchID) → Python dictionary

Syntax

system.mes.batch.queue.getBatchBOM(batchID)

Parameters

string batchID - The target batch ID to retrieve. This is the Batch ID entered in the Batch header information in the Batch List component.

Returns

 A Python dictionary containing the details of a bill of materials (BOM). For parameters, see Material_In Data Type

Scope

All

system.mes.batch.queue.getBatchBOM

Warning

MES 3.81.7 RC 1 and later

getBatchBom scripting function added

Warning

MES 3.81.8 RC 2 and later

Added logic to return min/max values.

system.mes.batch.recipe.getRecipeBOM(masterRecipeLink)

Python
masterRecipeLink = system.mes.batch.recipe.getRecipeLink('Product 1111')
batchName = ‘Test Prod 1111
batchID = ‘WO-53985
priority = 1
scale = 1.0
quantity = 1
batchQueueEntry = createEntry(masterRecipeLink, batchName, batchID, priority, scale, quantity)
print( system.util.jsonEncode(system.mes.batch.queue.getBatchBOM(batchQueueEntry)))

Returns

JSON
 {
    "LogicType": "Procedure",
    "Name": "Equipment Phase Manual",
    "Recipe_Name": "Equipment Phase Manual",
    "Recipe_Quantity": 1.0,
    "Recipe_Scale": 0.0,
    "Recipe_Version": 3,
    "Steps": [
		{
            "Step": "Mix",
            "Phase": "Unit Procedure",
            "Sublogic": {
                "Steps": [
	 	    {
                        "Phase": "Mix_Meat",
                        "Step": "Mix_Meat",
                        "Parameters": [
                            {
                                "DataType": "INTEGER",
                                "Name": "Mix_Time",
                                "Value": 600,
			      "UOM": "Minutes"
                            },
                        ],
                    },
                    {
                        "Phase": "Add Ingredient A",
                        "Step": "Add Protein",
                        "Parameters": [
                            {
                                "DataType": "MATERIAL_LOT_NUM",
                                "Name": "Protein.Lot_No",
                                "Value": ArrayOfLotNumbers[]
                            },
			  {
                                "DataType": "MATERIAL_NAME",
                                "Name": "Protein.Material_Name",
                                "Value": "Chicken"
                            },
			  {
                                "DataType": "MATERIAL_LOT_STATUS",
                                "Name": "Protein.Lot_Status",
                                "Value": "Uncooked"
                            },
                            {
                                "DataType": "MATERIAL_TARGET_QUANTITY",
                                "Name": "Protein.Target_Quantity",
                                "Value": 1000,
			      "UOM": "Lbs"
                            },
			  {
                                "DataType": "MATERIAL_ALTERNATE_GROUP",
                                "Name": "Protein.Alternate_Group",
                                "Value": "Alt 1"
                            },
			  {
                                "DataType": "MATERIAL_ALTERNATE_PRIORITY",
                                "Name": "Protein.Alternate_Priority",
                                "Value": 1
                            },
			  //Other Material_In sub-parameters may be included
			  {
                                "DataType": "MATERIAL_LOT_NUM",
                                "Name": "Alt_Protein.Lot_No",
                                "Value": "Meat7890"
                            },
			  {
                                "DataType": "MATERIAL_NAME",
                                "Name": "Alt_Protein.Material_Name",
                                "Value": "Chicken (Grade 2)"
                            },
			  {
                                "DataType": "MATERIAL_LOT_STATUS",
                                "Name": "Alt_Protein.Lot_Status",
                                "Value": "Uncooked"
                            },
                            {
                                "DataType": "MATERIAL_TARGET_QUANTITY",
                                "Name": "Alt_Protein.Target_Quantity",
                                "Value": 1000,
			      "UOM": "Lbs"
                            },
			  {
                                "DataType": "MATERIAL_ALTERNATE_GROUP",
                                "Name": "Alt_Protein.Alternate_Group",
                                "Value": "Alt 1"
                            },
			  {
                                "DataType": "MATERIAL_ALTERNATE_PRIORITY",
                                "Name": "Alt_Protein.Alternate_Priority",
                                "Value": 2
                            },
			  //Other Material_In sub-parameters may be included
                        ],
                    },
                    {
		       "Phase": "Add Ingredient B",
                        "Step": "Add Flavor",
                        "Parameters": [
			  {
                                "DataType": "MATERIAL_LOT_NUM",
                                "Name": "Flavor.Lot_No",
                                "Value": "Seasoning1234"
                            },
			  {
                                "DataType": "MATERIAL_NAME",
                                "Name": "Flavor.Material_Name",
                                "Value": "Mix Spices"
                            },
			  {
                                "DataType": "MATERIAL_LOT_STATUS",
                                "Name": "Flavor.Lot_Status",
                                "Value": "Good"
                            },
                            {
                                "DataType": "MATERIAL_TARGET_QUANTITY",
                                "Name": "Flavor.Target_Quantity",
                                "Value": 10
			      "UOM": "Lbs"
                            },
			  //Other Material_Out sub-parameters may be included
                        ],
                    },
                ]
            },
        },
        {
            "Step": "Cook",
            "Phase": "Unit Procedure",
            "Sublogic": {
                "Steps": [
                    {
                        "Phase": "Full Cook",
                        "Step": "Cook",
                        "Parameters": [
                            {
                                "DataType": "DOUBLE",
                                "Name": "Cook_Temperature",
                                "Value": 220.0,
			      "UOM": 
                            },
                            {
                                "DataType": "INTEGER",
                                "Name": "Cook_Time",
                                "Value": 120,
			      "UOM": "Minutes"
                            },
                            {
                                "DataType": "MATERIAL_LOT_NUM",
                                "Name": "Raw_In.Lot_No",
                                "Value": "Raw1234"
                            },
			  {
                                "DataType": "MATERIAL_NAME",
                                "Name": "Raw_In.Material_Name",
                                "Value": "Uncooked Chicken"
                            },
			  {
                                "DataType": "MATERIAL_LOT_STATUS",
                                "Name": "Raw_In.Lot_Status",
                                "Value": "Uncooked"
                            },
                            {
                                "DataType": "MATERIAL_TARGET_QUANTITY",
                                "Name": "Raw_In.Target_Quantity",
                                "Value": 1000,
			      "UOM": "Lbs"
                            },
			  //Other Material_In sub-parameters may be included
			  {
                                "DataType": "MATERIAL_LOT_NUM",
                                "Name": "Cooked_Out.Lot_No",
                                "Value": "Cooked1234"
                            },
			  {
                                "DataType": "MATERIAL_NAME",
                                "Name": "Cooked_Out.Material_Name",
                                "Value": "Cooked Chicken"
                            },
			  {
                                "DataType": "MATERIAL_LOT_STATUS",
                                "Name": "Cooked_Out.Lot_Status",
                                "Value": "Cooked"
                            },
                            {
                                "DataType": "MATERIAL_TARGET_QUANTITY",
                                "Name": "Cooked_Out.Target_Quantity",
                                "Value": 975,
			      "UOM": "Lbs"
                            },
			  //Other Material_Out sub-parameters may be included
                        ],
                    },
                ]
            },
        },
    ]
} 


Sepasoft MES Module Suite