|
| 1 | +# WorkflowGen and Microsoft Graph integration samples |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +You can use [Microsoft Graph API](https://developer.microsoft.com/en-us/graph/docs/concepts/v1-overview) to create some integration points between WorkflowGen and Office 365 applications such Outlook, Excel, Teams, OneDrive, SharePoint and Azure. |
| 6 | + |
| 7 | +This repository includes the `Advantys.Workflow.Applications.MicrosoftGraph.dll` assembly and the associated Visual Studio project. |
| 8 | +This assembly exposes multiples methods that can be used as WorkflowGen applications for each integration feature. |
| 9 | + |
| 10 | +## Content |
| 11 | + |
| 12 | +`docs`: Workflow applications documentation. |
| 13 | + |
| 14 | +`processes`: Process definition file examples. |
| 15 | + |
| 16 | +`src`: Visual Studio solution. |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +- Office 365 licences (one license for each user that will be accessing Office applications) |
| 21 | + |
| 22 | +- Access to an Azure portal: https://portal.azure.com/ |
| 23 | + |
| 24 | +- Service account with an Office 365 licence (such as `workflowgen@YOUR_DOMAIN.com`) |
| 25 | + |
| 26 | +- Workflowgen.My.dll 4.2.0 (WorkflowGen 7.10 or later) |
| 27 | + |
| 28 | + |
| 29 | +## Installation |
| 30 | + |
| 31 | +### Application registration |
| 32 | + |
| 33 | +1. Create an application on the https://apps.dev.microsoft.com/ site, such as `WorkflowGen`. |
| 34 | + |
| 35 | +2. In **Application Secret** section, generate a new password and save the secret. |
| 36 | + |
| 37 | +3. In **Platforms** section, click **Add platform** and choose **Web**. |
| 38 | + |
| 39 | +4. Check **Allow implicit Flow** and add `https://login.microsoftonline.com` to the **Redirect URLs**. |
| 40 | + |
| 41 | +5. Each [workflow application](#Workflow-applications-installation) requires specific permissions, so select these in **Application Permissions**, then save the application. |
| 42 | + |
| 43 | +6. To activate permissions, go to the `https://login.microsoftonline.com/YOUR_TENANT_ID/adminconsent?client_id=YOUR_CLIENT_ID&redirect_uri=https://login.microsoftonline.com` URL (replacing `YOUR_TENANT_ID` and `YOUR_CLIENT_ID` with your tenant and client IDs, respectively), and connect using an Administrator account. |
| 44 | + |
| 45 | +### Librairies installation on the WorkflowGen Server |
| 46 | + |
| 47 | +The following components will be installed in the WorkflowGen `/bin` folders (`/wfgen/bin`, `/wfgen/ws/bin`, `../Program Files/Advantys/WorkflowGen/Service/bin`): |
| 48 | +- `Advantys.Workflow.Applications.MicrosoftGraph.dll` |
| 49 | +- `Microsoft.Graph.dll` |
| 50 | +- `Microsoft.Graph.Core.dll` |
| 51 | +- `Microsoft.Identity.Client.dll` |
| 52 | + |
| 53 | +#### Quick Start |
| 54 | + |
| 55 | +1. Download the last release pack on your WorkflowGen server. |
| 56 | + |
| 57 | +2. Edit the `config.json`, replacing `WebAppPath` and `ServiceAppPath` with your own path (the default values are already specified). |
| 58 | + |
| 59 | +3. Execute the `Install.ps1` script in PowerShell. |
| 60 | + |
| 61 | +#### Custom installation |
| 62 | + |
| 63 | +1. Clone the repository. |
| 64 | + |
| 65 | +2. Open the Visual Studio Solution : `WorkflowGenMicrosoftGraph.sln`. |
| 66 | + |
| 67 | +3. Compile the Solution and copy the `Advantys.Workflow.Applications.MicrosoftGraph.dll` generated to the `src/Install` folder. |
| 68 | + |
| 69 | +4. Edit the `config.json`, replacing `WebAppPath` and `ServiceAppPath` with your own path (the default values are already specified). |
| 70 | + |
| 71 | +5. Execute the `Install.ps1` script in PowerShell. |
| 72 | + |
| 73 | +### WorkflowGen configuration |
| 74 | + |
| 75 | +Add the following settings to the WorkflowGen `/wfgen/web.config` with your own values: |
| 76 | + |
| 77 | +```xml |
| 78 | +<add key="MicrosoftGraphTenant" value="TENANT_ID" /> |
| 79 | +<add key="MicrosoftGraphClientId" value="CLIENT_ID" /> |
| 80 | +<add key="MicrosoftGraphClientSecret" value="CLIENT_SECRET" /> |
| 81 | +<add key="MicrosoftGraphServiceAccountId" value="SERVICE_ACCOUNT_ID" /> |
| 82 | +<add key="MicrosoftGraphServiceLogPath" value="LOG_PATH" /> |
| 83 | +``` |
| 84 | + |
| 85 | +Where: |
| 86 | +* **TENANT_ID**: Your tenant ID, which you can can find in the Azure AD (Directory ID) |
| 87 | + |
| 88 | +* **CLIENT_ID**: The application ID you created earlier |
| 89 | + |
| 90 | +* **CLIENT_SECRET** : The secret password you generated earlier |
| 91 | + |
| 92 | +* **SERVICE_ACCOUNT_ID** : Your service account ID, which you can find in the Azure AD account profile (`object id`) |
| 93 | + |
| 94 | +* **LOG_PATH** : The path where the logs will be saved |
| 95 | + |
| 96 | +## Workflow applications installation |
| 97 | + |
| 98 | +All required components are installed, you can now deploy WorkflowGen applications for each desired integration. |
| 99 | + |
| 100 | +### [Outlook](https://github.com/advantys/workflowgen-microsoft-graph/tree/master/docs/Outlook) |
| 101 | + |
| 102 | +- Send mail |
| 103 | +- Schedule meetings |
| 104 | + |
| 105 | +### [Azure AD](https://github.com/advantys/workflowgen-microsoft-graph/tree/master/docs/Azure%20AD) |
| 106 | + |
| 107 | +- Add user |
| 108 | + |
| 109 | +### [OneDrive](https://github.com/advantys/workflowgen-microsoft-graph/tree/master/docs/OneDrive) |
| 110 | + |
| 111 | +- Upload a file |
0 commit comments