3 Commits

Author SHA1 Message Date
Jedd Morgan b6e9dd9b5d Update main.yml 2024-02-15 15:41:41 +00:00
Claire Kuang fc5a7c680e Update AutomateFunction.cs
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
2024-02-07 14:26:55 +00:00
Claire Kuang 5569c0d4fd Update AutomateFunction.cs
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
2024-02-07 14:20:32 +00:00
2 changed files with 32 additions and 15 deletions
+1
View File
@@ -34,3 +34,4 @@ jobs:
speckle_token: ${{ secrets.SPECKLE_FUNCTION_TOKEN }} speckle_token: ${{ secrets.SPECKLE_FUNCTION_TOKEN }}
speckle_function_id: ${{ secrets.SPECKLE_FUNCTION_ID }} speckle_function_id: ${{ secrets.SPECKLE_FUNCTION_ID }}
speckle_function_input_schema_file_path: ${{ env.FUNCTION_SCHEMA_FILE_NAME }} speckle_function_input_schema_file_path: ${{ env.FUNCTION_SCHEMA_FILE_NAME }}
speckle_function_recommended_memory_mi: 8000
@@ -247,11 +247,14 @@ public static class AutomateFunction
); );
} }
if (addedAppIdObjects.Count > 0)
{
automationContext.AttachErrorToObjects( automationContext.AttachErrorToObjects(
"ADDED", "ADDED",
addedAppIdObjects.Select(o => o.Item1), addedAppIdObjects.Select(o => o.Item1),
"added objects with an application Id" "added objects with an application Id"
); );
}
foreach (var deleted in deletedAppIdObjects) foreach (var deleted in deletedAppIdObjects)
{ {
@@ -260,17 +263,29 @@ public static class AutomateFunction
); );
} }
foreach (var modified in modifiedAppIdObjects)
{
Console.WriteLine(
$"{MODIFIED} {modified.Item3} object: id( {modified.Item1} ), appId: {modified.Item2}, category: {modified.Item4}"
);
}
if (modifiedAppIdObjects.Count > 0)
{
automationContext.AttachErrorToObjects( automationContext.AttachErrorToObjects(
"MODIFIED", "MODIFIED",
modifiedAppIdObjects.Select(o => o.Item1), modifiedAppIdObjects.Select(o => o.Item1),
"modified objects with an application Id" "modified objects with an application Id"
); );
}
foreach (var changed in changedSpeckleIdObjects) foreach (var changed in changedSpeckleIdObjects)
{ {
Console.WriteLine($"CHANGED {changed.Item2} object: id( {changed.Item1} )"); Console.WriteLine($"CHANGED {changed.Item2} object: id( {changed.Item1} )");
} }
if (changedSpeckleIdObjects.Count > 0)
{
automationContext.AttachErrorToObjects( automationContext.AttachErrorToObjects(
"CHANGED", "CHANGED",
changedSpeckleIdObjects.Select(o => o.Item1), changedSpeckleIdObjects.Select(o => o.Item1),
@@ -278,4 +293,5 @@ public static class AutomateFunction
); );
} }
} }
}
} }