In the Geocortex Workflow .NET SDK, activities are represented as simple classes with an
Use a unique prefix on the
Action property to avoid it conflicting with someone else's custom activities.
Every Geocortex Mobile application that implements custom workflow activities needs to implement an
IActivityHandlerFactory is responsible for registering the custom activities with Geocortex Mobile so they can be created by Geocortex Workflow at runtime.
ActivityLoader registers custom activities in its constructor. Only one instance of the loader is required per Geocortex Mobile Application, as it can register multiple activities.
Two key components of this snippet are the
[assembly: Export(...)] tag and the class extension
ActivityLoader : IActivityHandlerFactory. These two pieces register the
ActivityLoader with Geocortex Mobile and cause it to be initialized on startup.
Access Geocortex Mobile Functionality
You can access Geocortex Mobile functionality in custom workflow activities by using the built-in dependency injection pattern to inject shared Geocortex Mobile services such as the
First, add the class you want to inject to the constructor of the custom activity.
Next, inject the activity into the
IActivityHandlerFactory for the application.
DisplayGeocortexMobileAlert activity is injected into the
IActivityHandlerFactory with Autofac, its dependency on the
UIOperations class will be be resolved by Autofac.
Finally, you can implement your activity using the referenced Geocortex Mobile class.
- Custom Activity
Access the Application Map
For a complete example, check out the Show Callout on Map custom activity tutorial.