libraries/HighThroughputHelper.rb
# Generate source & destination associations for part provenenance reactor DARPA SD2
Generate source & destination associations for part provenenance reactor DARPA SD2
Generate source & destination associations for part provenenance reactor DARPA SD2
def part_provenance_transfer(from_collection:, to_collection:, process_name:)
    to_collection_part_matrix = to_collection.part_matrix
    from_collection.part_matrix.each_with_index do |row, r_i|
      row.each_with_index do |from_part, c_i|
        if from_part
          to_part = to_collection_part_matrix[r_i][c_i]
          source_id = from_part.id; source = [{id: source_id }]
          destination_id = to_part.id; destination = [{id: destination_id }]
          destination.first.merge!({additional_relation_data: { process: process_name }}) unless process_name.nil?
          to_part.associate(key=:source, value=source)
          from_part.associate(key=:destination, value=destination)
        end
      end
    end
  end
def part_provenance_transfer ( from_collection : , to_collection : , process_name : ) to_collection_part_matrix = to_collection . part_matrix from_collection . part_matrix . each_with_index do | row , r_i | row . each_with_index do | from_part , c_i | if from_part to_part = to_collection_part_matrix [ r_i ] [ c_i ] source_id = from_part . id ; source = [ { id : source_id } ] destination_id = to_part . id ; destination = [ { id : destination_id } ] destination . first . merge! ( { additional_relation_data : { process : process_name } } ) unless process_name . nil? to_part . associate ( key = :source , value = source ) from_part . associate ( key = :destination , value = destination ) end end end end
Generate source & destination associations for part provenenance reactor DARPA SD2
Generate source & destination associations for part provenenance reactor DARPA SD2
# Create source and destination objs # raise process_name.inspect unless process_name.nil? # Association source and destination
from_collection
to_collection
process_name