Andrew Barnes

4 minute read

Walk-up Experience

Walk-up Experience

Why are we featuring Walk-up Experience in a technical blog you might ask yourself. Reasonable question. The answer is because two new technical capabilities are enabled in London, which is utilized in the new Walk-up Experience plugin available in London. Let’s dive into these new capabilities. This week we will explore Extension Points. In two weeks we will explore Interactions.

Extension Points

The first new feature we will explore is Extension Points. This feature will enable application developers to set up and define hooks to interact and enhance an application, without impacting the upgrade and future improvements to that application. This is done by pre-defining the outputs and inputs available at that point for enhancements. This defined enhancement point allows for the application creator to build the application with easy interaction points. For the client developer, it allows them to enhance the software without touching the base application code. This ensures that the application can be upgraded.

So, how does it work? The first step is defining an Extension Point. We will be looking at the Walk-up Experience plugin extension points as examples.

var InteractionFacade = Class.create();
InteractionFacade.prototype = {

    initialize: function() {
    },

    createEmpInteraction: function(userId, queueId, reason, reason_description,is_online_checkin) {
        //Wrapper function used to create employee interactions.
    },

    validateLocation: function(queueId) {
        //Add logic to verify the queueId is valid.
    },

    createInteraction: function (userId, queueId, reason, reason_description, is_guest, guest_name, guest_email, is_online_checkin) {
        //Add logic to create wu_context record followed by interaction record.
    },
    type: 'InteractionFacade'
};

We see the InteractionFacade function in the example above. This is used by the Walk-up widget to create the record for the interaction. We will dive into interactions in a follow-up post in two weeks. In the definition above, we can see the defined functions and their inputs. We can also define the outputs, but they have not been defined in our example.

Once this definition has been set, we can move on with the creation of things like our widget which depend on these functions, without actually having written the function. This allows for the widget developer and the script include developer to be independent. In our widget, we can use these functions as you will see below.

//InteractionFacade created as part of the script include will be used to create interactions as well as creating wu_context.
    var facade = new sn_walkup.ExtPointUtil().loadExtension("InteractionFacade");
//Later we use this facade to create an interaction
facade.createEmpInteraction(userId, queueId, issueId, otherIssue, is_online_checkin);

You can see we build our widget with the extension point and know what to send it, and what to expect as that is pre-defined. At this point, that function may not even exist, but we know how to interact with it when it does. Additionally, we may have more than one implementation of that function. This allows us the freedom to develop our widget independently but in a coordinated manner.

Time to go check out how to implementation for an extension point. From the Definition page, you visit the related links area at the bottom.

Implementation

This will take you to the correct script type for the extension point. In this case, it is a script include. It also populates the related list linking the extension definition to our implementation. Of particular note here is the order field. A single Extension Point Definition can have multiple implementations and they are all evaluated at runtime from the calling point and the highest order implementation that is applicable is applied.

Order

Now that I have a 2nd implementation for my new application I can use different logic for my application than the Walk-up plugin does while taking advantage of shared objects like the widget. Our script include could use different logic for determining valid locations. Another use case would be if we need to adjust our walk-up experience. The process would be the same, create an implementation and provide a new validLocation function with a lower order than the one provides out of the box, and the lower order function will be used.

This is a brief overview of Extension Points. They will be increasingly used by software provided by ServiceNow and partners so that customers can enhance those applications without fear of upgrade issues. We will continue our look at the Walk-up Experience plugin in two weeks when we look into Interactions


Comments