> ## Documentation Index
> Fetch the complete documentation index at: https://docs.serial.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Process Entries

> Create a process entry and add data to it

## Create

Use `ProcessEntries.create()` to instantiate a new process entry. Must have a `process_id` and one of either `component_instance_identifier`, `component_instance`, or `component_instance_id`.

<CodeGroup>
  ```python create by identifier theme={null}
  my_process_entry = serial.ProcessEntries.create(
      process_id="686ac22c-4ff3-4ced-911f-88c1997ee9f8", 
      component_instance_identifier="ABC-1234"
  )
  ```

  ```python override station ID theme={null}
  my_process_entry = serial.ProcessEntries.create(
      station_id="eab997b6-0951-41a8-ad61-8f813704237a", 
      process_id="686ac22c-4ff3-4ced-911f-88c1997ee9f8", 
      component_instance_identifier="ABC-1234"
  )
  ```

  ```python create by instance theme={null}
  my_process_entry = serial.ProcessEntries.create(
      station_id="eab997b6-0951-41a8-ad61-8f813704237a", 
      process_id="686ac22c-4ff3-4ced-911f-88c1997ee9f8", 
      component_instance=my_component_instance
  )
  ```

  ```python create by id theme={null}
  my_process_entry = serial.ProcessEntries.create(
      station_id="eab997b6-0951-41a8-ad61-8f813704237a", 
      process_id="686ac22c-4ff3-4ced-911f-88c1997ee9f8", 
      component_instance_id=my_component_instance.data["id"]
  ) 
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField body="process_id" type="string" required>
    ID of the process being run. Use the process builder on the component page to get or create a process
  </ParamField>

  <ParamField body="station_id" type="string" optional>
    ID of the station running the process. Use the station page to get or create a station
  </ParamField>

  <ParamField body="component_instance_identifier" type="string" optional>
    The serial number or lot code of the component instance
  </ParamField>

  <ParamField body="component_instance" type="object" optional>
    Component instance object returned by `serial.ComponentInstances` methods
  </ParamField>

  <ParamField body="component_instance_id" type="object" optional>
    Component instance ID. Can by obtained by `serial.ComponentInstances.data["ID"]`
  </ParamField>
</Accordion>

## Add Data

### Add Number

Add numerical data with units, usls and lsls to a process entry

<CodeGroup>
  ```python default theme={null}
  my_process_entry.add_number(
      dataset_name="Power", 
      value="102"
  )
  ```

  ```python with units theme={null}
  my_process_entry.add_number(
      dataset_name="Power", 
      value="102", 
      units="W"
  )
  ```

  ```python with units & specs theme={null}
  my_process_entry.add_number(
      dataset_name="Power", 
      value="102",
      units="W", 
      usl="110", 
      lsl="90"
  )
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField query="dataset_name" type="string" required>
    The name of the data you are adding
  </ParamField>

  <ParamField query="value" type="number" required>
    The unique number data for the identifier
  </ParamField>

  <ParamField query="units" type="string" optional>
    The units of the data you are adding
  </ParamField>

  <ParamField query="usl" type="string" optional>
    The upper spec limit of the data you are adding
  </ParamField>

  <ParamField query="lsl" type="string" optional>
    The lower spec limit of the data you are adding
  </ParamField>
</Accordion>

### Add Boolean

Add pass/fail boolean data to a process entry

<CodeGroup>
  ```python default theme={null}
  my_process_entry.add_boolean(
      dataset_name="Functional Test Result", 
      value=True
  )
  ```

  ```python with expected_value theme={null}
  my_process_entry.add_boolean(
      dataset_name="Functional Test Result", 
      value=True, 
      expected_value=True
  )
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField query="dataset_name" type="string" required>
    The name of the data you are adding
  </ParamField>

  <ParamField query="value" type="boolean" required>
    The unique boolean data for the identifier
  </ParamField>

  <ParamField query="expected_value" type="boolean" optional>
    The expected value
  </ParamField>
</Accordion>

### Add File

Add files to a process entry

<CodeGroup>
  ```python default theme={null}
  my_process_entry.add_file(
      dataset_name="Test Logs", 
      path="/Users/me/Documents/02375017391243.csv"
  )
  ```

  ```python with file_name theme={null}
  my_process_entry.add_file(
      dataset_name="Test Logs", 
      path="/Users/me/Documents/02375017391243.csv", 
      file_name="test_logs.csv"
  )
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField query="dataset_name" type="string" required>
    The name of the data you are adding
  </ParamField>

  <ParamField query="path" type="string" required>
    file path to the file in local storage
  </ParamField>

  <ParamField query="file_name" type="boolean" optional>
    Used to override the file\_name of at the path. This file name will be preserved on download from Serial
  </ParamField>
</Accordion>

### Add Image

Add images to a process entry

<CodeGroup>
  ```python default theme={null}
  my_process_entry.add_image(
      dataset_name="Functional Test Graph", 
      path="/Users/me/Documents/chart.jpg"
  )
  ```

  ```python with file_name theme={null}
  my_process_entry.add_image(
      dataset_name="Functional Test Graph", 
      path="/Users/me/Documents/chart.jpg", 
      file_name="functionalTestGraph.jpg"
  )
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField query="dataset_name" type="string" required>
    The name of the data you are adding
  </ParamField>

  <ParamField query="path" type="string" required>
    file path to the file in local storage
  </ParamField>

  <ParamField query="file_name" type="boolean" optional>
    Used to override the file\_name of at the path. This file name will be preserved on download from Serial
  </ParamField>
</Accordion>

### Add Link

Add images to a process entry

<CodeGroup>
  ```python default theme={null}
  my_process_entry.add_link(
      dataset_name="PCBA", 
      child_identifier="FBM0202312"
  )
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField query="dataset_name" type="string" required>
    The name of the data you are adding
  </ParamField>

  <ParamField query="child_identifier" type="string" required>
    The identifier of the part being assembled into the parent identifier
  </ParamField>
</Accordion>

## Submit

Uploads all the data that has been added to the process entry. Optionally add a cycle time and/or override the pass fail result

<CodeGroup>
  ```python cycle time theme={null}
  my_process_entry.submit(
      cycle_time=42
  )
  ```

  ```python cycle_time & is_pass theme={null}
  my_process_entry.submit(
      cycle_time=42, 
      is_pass=True
  )
  ```
</CodeGroup>

<br />

<Accordion title="Parameters">
  <ParamField query="cycle_time" type="number" optional>
    Cycle time in seconds
  </ParamField>

  <ParamField query="is_pass" type="boolean" optional>
    Override the overall process result to pass or fail and ignore all parametric data
  </ParamField>
</Accordion>
