The Canadian subsidiary of PCL Construction recently reached out to Microsoft to help digitally transform their manual tradesperson on-boarding process that has been in use since the start of the organization. The current paper-based on-boarding process uses triplicate impact forms, creating high costs in both form printing and manual input hours by the PCL Human Resources team. We proposed to develop a proof of concept (PoC) Xamarin application to replace their current process, and at the same time educate the PCL development team on Xamarin development best practices.

Key technologies used

Core team

Customer profile

PCL Construction is a group of independent construction companies owned by employee shareholders across the United States, Canada, and Australia. As a diversified general contractor, PCL celebrates the past and builds for the future. From their Canadian headquarters in Edmonton, Alberta, PCL’s Canadian construction companies focus on large commercial, institutional, industrial, and civil construction projects. As Canada’s largest construction contractor, the organization also offers construction services for smaller, unique special projects.

Problem statement

PCL Construction’s on-boarding processes for new tradespeople were completed manually on triplicate impact forms. Employees were required to complete up to 60 pages of information regardless of previous employment. This exercise had to be completed each time a tradesperson entered a new construction project. After the form was completed, the document was submitted to a team of three or four PCL Human Resources employees who manually entered the information into the Craft Services Stream application. This whole process was very time-consuming, costly, and prone to errors; hence the request for help.

The current workflow is depicted in the following diagram.

Current workflow


Solution, steps, and delivery

The proposed solution was to build a proof of concept Xamarin application that would automate the capture of new employee data, which would then automatically populate the Craft Services Stream Application database.

PCL Construction’s goals for this solution were the following:

  • Create simplified digital new hire forms.
  • Provide the forms to new hires via an iOS app on iPad devices.
  • Connect with the already existing Craft Services Stream Application database.
  • Use existing authentication database for user management.
  • Provide secure data storage and communication practices per PCL requirements for sensitive data.

The Craft Services Stream Application database is a proprietary, internally developed solution that PCL Construction built on top of Azure SQL Database to post and track jobs across the entire organization. Authentication to the database is enabled via an existing Azure Active Directory (Azure AD) implementation that was introduced to ensure that only authorized personnel would be able to review the trade-person’s submission prior to it being committed to the database.

The PCL development team included seven members. To facilitate a quick and productive development environment, the developers were broken off into four groups: three teams of two for the client side, and a team of one to handle the Craft Services API integration. The teams focusing on the Xamarin client employed the pair programming method, which proved to work very well.

DevOps practices put in place during the project

During the solution development process, several DevOps best practices were introduced to ensure successful processing of updates and/or changes when required.

Source code repository

The PCL team was already leveraging the use of a private Git server; therefore, it made sense to continue using it to keep the code for the backend processing private while they worked. Considering that the way PCL manages the onboarding of thousands of tradespeople is a competitive advantage, keeping this advantage secret made sense. However, the code for the mobile app being developed during the hackathon was stored in a public repo on GitHub.

Continuous integration and continuous deployment

The backend environment utilized Visual Studio Team Services to create and manage the build process that automatically compiled and tested the PCL application as part of an automated continuous integration strategy. The team also utilized Team Services to manage the release process by using continuous deployment templates and tasks.

Technical details

Following is the application flow:

  1. Administrator signs in to application.
  2. Application logs on to the Craft Services Stream Application database and loads available jobs.
  3. Administrator selects desired job.
  4. Application loads forms that correspond to selected job.
  5. Device is handed to job applicant.
  6. Applicant fills in form information and submits.
  7. Forms are scanned by application completion (all required sections have been filled out).
  8. If approved, applicant receives notification; if denied, applicant is informed of what needs to be completed.
  9. Application is “locked” until handed to an administrator for security.


Whiteboard value stream map 1


Whiteboard value stream map 2


Xamarin client

The client was created using a Xamarin.Forms Portable application. This type of Xamarin solution was chosen to meet the overall goals of the project to be easily modifiable and potentially cross-platform. The team did look at Xamarin.Android and Xamarin.iOS as options, but felt that even with a shared library or Portable class handling the business logic, the UI code overlap was still too high to justify the platform-specific design approach.

The application is primarily oriented around data entry, which means it requires a lot of strings and other data to be fed into data controls in each page or view. After some quick research, the team decided that the data binding feature in XAML would work very well for this project. One of the challenges that the PCL development team faced was the first time use of XAML. Even though the team was somewhat knowledgeable in both C# and .NET, the complexity of data binding in XAML was going to be a challenge. Fortunately Microsoft MVP Mark Arteaga agreed to participate in this workshop providing his real world experience in working with XAML and its data binding features. Mark was able to bring the team up to speed quickly and lead the team to tackle the challenge of connecting the newly created Xamarin application to the existing data stream.

Xamarin Application Screenshot


Xamarin Architecture Diagram


Various options were considered for connecting the Xamarin application to the current PCL data stream, including creating a stand-alone service. Ultimately it was decided to use the Mobile Apps feature of Azure App Service (formerly Azure Mobile Services) for the connection piece. The major factor in this decision was the time to implement and ease of use for the developers to address future updates. Xamarin’s support of Azure App Service is well-documented, and the team felt comfortable with tackling any issues that might occur given this support. Mark Arteaga’s support also proved valuable as he and Mickey MacDonald were able to guide the team through the creation of a DataServices class. The DataServices class connected the application to the Forms data via Azure App Service. The class provided the application with three public methods: one to retrieve all jobs available, one to retrieve workers by a job, and one to retrieve all forms belonging to a worker. These requests are all asynchronous tasks that return a JSON object. This JSON object can then be consumed and displayed in the application.

An example of one of these tasks follows.

public async Task<List<CraftWorker>> GetCraftWorkers(string jobId)
{
    var data = await MakeRequest($"tables/craftworker/{jobId}");
    var ret = new List<CraftWorker>();
    if (data != null)
        ret = JsonConvert.DeserializeObject<List<CraftWorker>>(data);
    return ret;
}


After the team had solved the issues of data binding and connecting to Azure App Service, they moved on to the next technical challenge, securing the application during use. The idea was that the application needed to be locked after the form had been submitted. The purpose was to block the modification of any data that the user shouldn’t have access to. The proposed solution was to pause the application on a prompt and use Azure Multi-Factor Authentication to allow a valid administrator account to unlock the application and return to the available jobs screen. While the idea sounded complex, the implementation was very straightforward; all that was needed to allow this to occur was to implement Multi-Factor Authentication for the Administrator’s account in the Azure AD instance. A simple request was then made to the Multi-Factor Authentication service; in this case, the administrator’s cell phone number would be called for verification.

A simplified version looks something like the following.

private async Task<string> MakeRequest(string path)
{
    HttpClient httpClient = new HttpClient();
    Uri _uri = new Uri($"{_settings.MobileService}/{path}");
    httpClient.DefaultRequestHeaders.Add("ZUMO-API-VERSION", "2.0.0");
    //httpClient.DefaultRequestHeaders.Add("Content-Type", "application/json");

    var response = httpClient.GetAsync(_uri);
    var responseBody = await response.Result.Content.ReadAsStringAsync();

    if (response.Result.StatusCode == System.Net.HttpStatusCode.OK)
        return responseBody;
    else
        return null;
}


Backend

A simple solution was created to allow the client a secure way to connect, authenticate, and retrieve the data stored in PCL’s existing Craft Services Stream Application database. The team was interested in leveraging the existing Azure infrastructure to connect to the existing Craft Services APIs, hence the reason that the utilization of Mobile Apps in Azure App Service was a perfect fit. Mobile Apps handles authentication by connecting to PCL’s existing Azure AD implementation and provides the client with data access to the Craft Services Stream Application database. The Azure App Service backend also utilized Multi-Factor Authentication APIs providing a “locking” mechanism for the app made available by PCL’s Azure AD Premium subscription.

To satisfy the need for continuous integration of the backend solution, the project was stored and deployed by using Visual Studio Team Services.

Conclusion

Implementing the created proof of concept into production will allow PCL Construction to remove the manual process of having tradespeople complete triplicate forms and having said forms entered manually by HR. Conducting this PoC in digitizing the processes provided a great opportunity for the PCL Construction development team to upskill on cross-platform Xamarin.Forms application development as opposed to their initial desire to build a native iOS app. Cross-platform development also allowed them to capitalize on their earlier spend of Surface Pro 2 hardware, which could now be utilized at some job sites to on-board tradespeople.

“We have made great strides to deliver anything, anytime, on any platform.” —Blaine Stearns, Head Solutions Architect, PCL Construction

Using Mobile Apps provided a sound implementation of security practices in line with PCL Construction’s standards and leveraged an existing Azure AD investment with very little build time.

General lessons

  • Xamarin team live (Skype) training was beneficial because it was tailored around what PCL wanted to accomplish.
  • Inclusion of MVP Mark Arteaga was crucial to support TE Mickey MacDonald from a “real world” Xamarin development perspective (authentication tools, data storage, and encryption utilization).
  • Utilization of the pair programming development method is a great way to accelerate learning and the development process. This is something we will be striving to implement in all future engagements.
  • Mobile Apps in Azure App Service provided an easy link to the existing Craft Services APIs.
  • Using Mobile Apps made it easier for PCL Construction to adhere to security protocols by leveraging the existing Azure AD and Multi-Factor Authentication.


Project End


Opportunities going forward

The PCL Construction developer team found the Xamarin.Forms upskilling process to be quick enough to begin work on digitizing other manual forms. With help from Mark Arteaga, a now approved vendor for PCL Construction, the team is moving forward on developing dynamic forms to better serve the on-boarding process while still adhering to security requirements made available via their Azure AD investment.

Additional resources

GitHub PCLConstruct repo