Using Octoblu to Enable the Storefront Workflow Approval Process
If you’ve been following along with Richard Hayton’s recent posts on the release of Storefront 3.0, you’ve probably noticed that we are enabling Storefront with a lot of APIs to let you configure and use it in the way that best fit your environment.
The blog post series is great, and I recommend checking them out, as this article builds on them. You can read Richard’s posts here, but be sure to check out X1 DIY Approvals and Citrix Recipe Box: StoreFront Approvals, as they build on what we’re talking about here today.
Since this post contains multiple sub-parts, we are going to make this a series of posts, so we can break down–in detail–each of the steps. With that said, let get onto enabling Octoblu to handle your users request for application access, via the Storefront API.
Overview and setup:
This is going to be more of a general overview of the process and a high level How-To technical article so we can show you how to get up and running with the Storefront/Octoblu integration.
The scenario is that we have a set of applications, that we would like to display to all users but, only grant access when the user requests the application. A typical approval workflow that workflow engines handle.
There are a few steps we need to perform to enable Storefront to understand that an application needs to ask for approval. I’ve outlined those below.
- Enable storefront to put applications in pending state.
- Setup the published application to enable the approval process
- Build a subscription database monitoring application to look for “pending” application.
- Build a Octoblu workflow that handles the process flow for requesting, approving or denying a request for application access.
- Build/Deploy intermediate page that allows a manager to approve the request.
Step One: Enable Storefront for workflows
There is a customization DLL that we are making available that you need to drop into your Storefront 3.0 directory. Richard’s blog (X1 DIY Approvals) gives the instructions, but I have copied them here, as well.
- Find the directory to the store you want to enable workflow for. For example C:\inetpub\wwwroot\Purple
- Edit web.config in this directory and add the following to the end of the <components> section
<component id=”SimpleWorkflowHandler” type=”Citrix.DeveloperNetwork.StoreFront.SimpleWorkflowHandler, SimpleWorkflowHandler” service=”Citrix.DeliveryServices.DazzleResources.Workflow.IWorkflowAdaptor, Citrix.DeliveryServices.DazzleResources.Workflow” />
- Download the DLL from here and save it in the bin directory (e.g. C:\inetpub\wwroot\Purple\bin)
Step Two: Setup published application(s) to enable workflows
Now that we have Storefront configured, we need to modify the published application(s) so that Storefront knows that it is an workflow enabled application. This is achieved by adding “KEYWORDS:WFS” into the description of any desired published application that you wish to have the user ask for access. Below is an example of the properties screen of a published application that has the description field filled in with the appropriate keywords.
Step Three: Setup Storefront monitoring application to watch for application requests.
Now that we have our Storefront and the XenApp/XenDesktop application configured, the next step is to create an application that will monitor the storefront database and look for applications that are in a “Pending” state and then trigger the Octoblu workflow and wait for a response. The basic flow is below.
- Monitor Storefront Subscription database for any subscriptions of the “Pending” state.
- Register with the Octoblu service to receive messages.
- For each “Pending” application, call the defined Octoblu workflow.
- Process received messages from Octoblu and based on the response, either change the pending state of the application to subscribed or remove the subscription.
Since breaking this application down is an entire blog on it’s own, we are building a follow-up blog on the drill down of this application. In the mean time we have made the application open source and available on our GitHub account. You can download it here https://github.com/citrix/Citrix-Storefront-ApprovalMonitoring
*Once you download it you can run it on your StoreFront server to start monitoring for pending applications.
Below is a quick screen capture of the monitoring application and after you download it you will have to modify a few pieces. You can check out the code for the specifics on where to add the following items.
- Add the workflow endpoint into the code.
- Add your Device UUID/Token into the code. (Check out our Visual Studio Extension to help you enable an application as a device in Octoblu)
- Add the email you wish to get the approval emails. We built it this way to enable you to quickly check out the process.