| 1149 | const std::string prefix = id + "."; |
| 1150 | for (const auto & [key, value] : context.values) { |
| 1151 | if (key.rfind(prefix, 0) == 0) { |
| 1152 | output_item[key.substr(prefix.size())] = value; |
| 1153 | } |
| 1154 | } |
| 1155 | output_items.push_back(std::move(output_item)); |
| 1156 | } |
| 1157 | |
| 1158 | context.values = base_values; |
| 1159 | context.values[id + ".count"] = std::to_string(output_items.size()); |
| 1160 | context.batches[id] = std::move(output_items); |
| 1161 | std::cout << "workflow_step=" << id << "\n"; |
| 1162 | std::cout << "batch_items=" << context.values[id + ".count"] << "\n"; |
| 1163 | } |
| 1164 | |
| 1165 | void write_workflow_manifest(const WorkflowContext & context) { |
| 1166 | const auto path = context.output_dir / "workflow_manifest.json"; |
| 1167 | std::filesystem::create_directories(context.output_dir); |
| 1168 | std::ofstream out(path); |
| 1169 | out << "{"; |
| 1170 | bool first = true; |
no test coverage detected