This repository includes a set of CampusNexus workflow samples to help get started extending CampusNexus using Windows Workflow Foundation.
CustomActivites is a Visual Studio solution containing custom workflow activities that can be used within CampusNexus Workflow. This solution is composed of a standard Visual Studio Activity Library project that contains two activities:
- CodeConvertToJson - a simple .NET System.Activities.CodeActivity that serializes an object to JSON
- XamlConvertToJson - a simple .NET System.Activities.Activity designed using the Visual Studio Activity designer
Creating custom activities for use by CampusNexus is identical to creating activities using the Microsoft and Community authored tutorials and samples. If you want the activities to show up in the toolbox of CampusNexus Workflow by default, you can add the ExtensionAssembly attribute to your AssemblyInfo.cs file as shown below.
[assembly: ExtensionAssembly]Note: If you have a third party library, or you dont wan't to take a dependency on Cmc.Core, you can always add the custom activity library from within CampusNexus Workflow using the Add Reference... ribbon button.
To deploy this solution, copy the CustomActivities.dll to the Workflow Composer (alongside WorkflowComposer.exe). For runtime use, copy CustomActivities.dll to the bin folder (bin\Extensions for CampusNexus Student 21.0 or greater)
- Open CampusNexus Workflow Composer
- Within the File ribbon section, click Open...
- Browse to the .xaml file you wish to import (e.g. Cmc.Nexus.Crm.Entities.TaskEntity_SavingEvent_Sample - Task Saving.xaml) and click Open
- Apply any needed modifications to the Workflow
- Within the Server ribbon section, click Publish...
- Check the Enable this Workflow Version? check box
- Click the Publish button
This workflow demonstrates how to create a validation for a Saving event handler.
This workflow demonstrates how to on-ramp messages to the Azure Service Bus. The properties ServiceBusNamespace, SharedAccessKey, and SharedAccessKeyName are not required; however, if they are not provided the activity will pull these settings from the web.config appSettings section. This is to allow workflows to be reused from environment to environment without modification.
Below is an example of the web.config app settings:
<add key="azureServiceBus:serviceNamespace" value="nexus-student-integration-bus" />
<add key="azureServiceBus:sharedAccessKeyName" value="SendSharedAccessKey" />
<add key="azureServiceBus:sharedAccessKey" value="ZRXqcCfXQaGMi0FXTp6iNtFjMXKG+adnZTO3CcNAqDA=" />
This workflow demonstrates how to invoke an Azure Logic App from within a CampusNexus Workflow.
- Follow the steps above to open the sample Workflow
- Modify the Uri property of the Invoke Azure Logic App activity to match the URI of your HTTP-triggered Azure Logic App
This workflow demonstrates how to invoke an Azure Function from within a CampusNexus Workflow.
- Follow the steps above to open the sample Workflow
- Modify the Uri property of the Invoke Azure Function activity to match the URI of your HTTP-triggered Azure Function