def METHOD_NAME(db, modelId, sequenceId, task): # sequenceId is expected to uuid.UUID
  activitiesCollName = modelId + ".activities"
  activity = None
  if db[activitiesCollName]:
    activity = db[activitiesCollName].find_one({"_id": task["_id"]})
  if activity == None:
    if "data" in task and "Planned Start" in task["data"] and "Planned Finish" in task["data"] :
      activity = {"_id": task["_id"], "name": task["name"], "sequenceId": sequenceId}
      activity["startDate"] = strToTimestamp(task["data"]["Planned Start"])
      activity["endDate"] = strToTimestamp(task["data"]["Planned Finish"])
      activity["data"] = migrateData(task["data"])
      if "parents" in task and len(task["parents"]) > 0:
        activity["parent"] = task["parents"][0]
      db[activitiesCollName].insert_one(activity)