This is a multi-API sample, which makes it super-interesting. And, if you remember right, it was presented at Forge DevCon 2018 Las Vegas keynote! The feature goal is to perform some basic check on BIM 360 files, if it finds anything, create an Issue.
First, let the user/admin sign in using his/her Autodesk Account. As the data belongs to the user, let's store the access and refresh token on a database (e.g. MongoDB hosted on mlab), later we'll need this token to access the file. The user can select a BIM 360 folder and start monitoring using Webhooks API, in this case, we're interested in version added event. This part of the sample was previously discussed at this blog post. That's the setup part of the sample and only need to be done once (for each folder).
Later the user can upload a file on BIM 360. That will trigger the webhook callback and the sample app will capture the event, enqueue a job and return 200 to Forge Webhook. This is important! If we don't return 200, the webhook engine will try again, and after that disable the hook. So always return 200 immediately. To enqueue the job the sample uses Hangfire (open-source queueing package). This job will do the following:
- Check if the AppBundle is defined
- Check if the Activity is defined
- Prepare the BIM 360 download URL
- Prepare the destination to send the results of the design check, in our sample an AWS S3 Bucket
- Submit the Workitem
Once the workitem completes, Design Automation will callback our app. At this point, the app check the results file, it should contain a list of Revit columns that are in intercepting walls. This is based on the Revit SDK Find Columns sample.
BIM 360 Issues doesn't understand that kind of information... so the Issue actually contains a link that points back to the sample app to open a custom Viewer with a custom button to show the problems it found.
In general, the end-user experience is restricted to BIM 360 interface, except when he/she opens the Issue link.
The following video shows it side-by-side, left the queueing of jobs (background) and on the left the end-user experience with the sample. Note that you don't need to leave the queueing page open, this is just so we can understand what's going on.
Check the source code on Github/Autodesk-Forge