1/2/2024 HR Hiring System Name: ABDULLAH / Toheed Fayyaz Reg No: BCS213123 / BCS213116 Subject Name: Theory of Automata Subject Code: CS3613 Department Name: BSCS 1 Contents Chapter 1:- Introduction ........................................................................................................................ 4 1.1 Introduction ................................................................................................................................. 4 1.2 Motivation.................................................................................................................................... 4 1.3 Advantages of the HR Hiring Process ....................................................................................... 4 1.3.1 Efficiency: ............................................................................................................................. 4 1.3.2 Accuracy: .............................................................................................................................. 4 1.3.3 Cooperation: ......................................................................................................................... 4 1.3.4 Enhanced Candidate Experience: ...................................................................................... 4 1.4 Objectives..................................................................................................................................... 4 1.5 Conclusion ................................................................................................................................... 5 Chapter 2:- Literature Review ................................................................................................................. 5 2.1 Introduction ................................................................................................................................. 6 2.2 Power plateform: ........................................................................................................................ 6 2.3 Benefits: ....................................................................................................................................... 6 2.3.1 Streamlined Operations: ..................................................................................................... 6 2.3.2 Improved Customer Engagement: .............................................................................. 6 2.3.3 Scalability: ..................................................................................................................... 6 2.3.4 Data-Driven Decision Making: .................................................................................... 6 2.3.5 Adaptable Deployment Options: ................................................................................. 6 2.4 Conclusion ................................................................................................................................... 7 Chapter 3:- Method ............................................................................................................................... 8 3.1 Mathematical defination ............................................................................................................ 8 3.2 NFA of Hr Hiring System........................................................................................................... 8 3.3 Mealy Mechine of Hr Hiring System......................................................................................... 8 3.5 ER Diagram ................................................................................................................................. 9 ............................................................................................................................................................ 9 3.6 Flow Chart .................................................................................................................................. 9 3.7 Pseudocode................................................................................................................................. 10 3.7.1 Entities: ............................................................................................................................... 10 3.7.2 Candidate To Employee: ................................................................................................... 10 3.8 Table For mathod Learnt ........................................................................................................ 10 3.8.1 Create Dynamic 365 Trial ................................................................................................. 11 3.8.2 Create Solution ................................................................................................................... 15 3.8.3 Create Table (Entity) ......................................................................................................... 16 3.8.4 Create Column(Field) ........................................................................................................ 17 2 3.8.4 Create App .......................................................................................................................... 20 3.8.5 Set Form .............................................................................................................................. 23 3.9 Plugin ......................................................................................................................................... 24 3.9.1 ConvertCandidateToEmployee ........................................................................................ 24 3.9.2 Candidate ............................................................................................................................ 25 3.9.3 Employee ............................................................................................................................. 26 3.9.4 sendEmail............................................................................................................................ 27 3.10 Javascript ................................................................................................................................. 29 3.10.1 Candidate .......................................................................................................................... 29 3.10.2 Employee ........................................................................................................................... 31 Chapter 4:- Result ................................................................................................................................. 32 4.1 Conclusion ................................................................................................................................. 33 4.2 Reference ................................................................................................................................... 34 3 List of Image:Figure 1 Trial 3.8.1.1 ............................................................................................................................ 11 Figure 2 Trial 3.8.1.2 ........................................................................................................................... 12 Figure 3 Trial 3.8.1.3 ........................................................................................................................... 12 Figure 4 Trial 3.8.1.4 ........................................................................................................................... 13 Figure 5 Trial 3.8.1.5 ........................................................................................................................... 13 Figure 6 Trial 3.8.1.6 ........................................................................................................................... 14 Figure 7 Trial 3.8.1.7 ........................................................................................................................... 14 Figure 8 Trial 3.8.1.8 ........................................................................................................................... 15 Figure 9 Solution 3.8.2.1...................................................................................................................... 16 Figure 10 Solution 3.8.2.2................................................................................................................... 16 Figure 11 Table 3.8.3.1 ...................................................................................................................... 17 Figure 12 Table 3.8.3.2 ........................................................................................................................ 17 Figure 13 Column 3.8.4.1 ..................................................................................................................... 18 Figure 14 Column 3.8.4.2 ..................................................................................................................... 18 Figure 15 Column 3.8.4.3 ..................................................................................................................... 19 Figure 16 App 3.8.4.1 ........................................................................................................................... 20 Figure 17 App 3.8.4.2 .......................................................................................................................... 20 Figure 18 App 3.8.4.3 .......................................................................................................................... 21 Figure 19 App 3.8.4.4 .......................................................................................................................... 21 Figure 20 App 3.8.4.5 .......................................................................................................................... 22 Figure 21 App 3.8.4.6 .......................................................................................................................... 22 Figure 22 Form 3.8.5.1 ......................................................................................................................... 23 Figure 23 Email 3.9.4.1......................................................................................................................... 27 Figure 24 Email 3.9.4.2......................................................................................................................... 28 Figure 25 Email 3.9.4.3......................................................................................................................... 28 Figure 26 Result 4.1 .............................................................................................................................. 32 Figure 27 Result 4.2 .............................................................................................................................. 32 Figure 28 Result 4.3 ............................................................................................................................. 33 4 Chapter 1:- Introduction 1.1 Introduction The capacity of an organization to attract, select, and retain top talent is essential to its success in the current fast-paced business environment.Technology has completely changed how businesses handle their hiring processes, and human resources (HR) departments are essential to this process. Streamlining the entire recruitment lifecycle, from job posting to candidate onboarding, is the aim of the comprehensive and integrated HR Hiring System 1.2 Motivation Considering the highly competitive contemporary market,Organizations must have an State of the art HR hiring system to be able to automate the whole process. The system should be purely objective treating all candidates fairly by implementing certain constraints within a system which allocates resources effectively and optimizes all other aspects as well ,Ultimately resulting in the organizations credibilty and success. 1.3 Advantages of the HR Hiring Process 1.3.1 Efficiency: HR proffesionals can focus more on their primary tasks such as training,screening and managing the employee life cycle. Instead of getting too worried about the tasks which are already automated, therefore increasing efficiency. 1.3.2 Accuracy: As the Human intervention in Candidates screening/Selecting resumes is minimized by incorporating objectivity.The expected output(selected candidates) are more likely to acting In the best interest of the organization. 1.3.3 Cooperation: A personalised account is given to every employee ,Which connects them to their relevant departments,teams Making it easy to share information and Stay up to date. 1.3.4 Enhanced Candidate Experience: Candidates can make themselves available for selection ,without any extra hastle or effort by Using the simplicity of The Systems User Interface,Therefore High number of probables are expected to apply considering the user friendliness of the system.. 1.4 Objectives Efficiency Improvement: Streamline process & automate tools. Talent Acquisition: Attract top talent with targeted strategies. Candidate Experience: Transparent, user-friendly interactions. Diversity & Inclusion: Bias-free practices for equal opportunities. Data-Driven Decisions: Analytics for informed strategy enhancements. 5 1.5 Conclusion In essence, the introduction dissects the crucial role of a brand-new HR bringing in system in the benefit of organizations inside the advanced and rapidly changing business environment. The motivation behind such a structure originates from the need for efficiency, impartiality, and believeableness in the face of severe advertise competition. The benefits of achieving an integrated HR leasing process include raised skill levels, enhanced truthfulness, upgraded cooperation through embodying accounts, and a superior contestant participating. The outlined goals emphasize the focus on adeptness improvement, ability purchase, candidate knowledge augmentation, fostering variety and inclusion, and the approval of dossier-driven accountable. Eventually, the comprehensive HR enlisting system aims to help the employee lifecycle, contributing considerably to an arranging's success and maintained development in the dynamic landscape. Chapter 2:- Literature Review 6 2.1 Introduction Microsoft Dynamics 365 is an enterprise resource planning (ERP) and customer relationship management (CRM) suite of cloud-based business apps. It was developed by Microsoft. It is meant to help businesses make data-driven decisions, improve customer engagement, and streamline operations. Because Dynamics 365 is modular, companies can choose the applications they need and grow with them as their needs change. 2.2 Power plateform: Organizations can analyze data, automate procedures, and develop custom applications with the Power Platform, an integrated suite of applications, connectors, and a data platform. It consists of Power Apps for creating applications, Power BI for analytics, and Power Automate for automating workflows. 2.3 Benefits: 2.3.1 Streamlined Operations: Dynamics 365 helps businesses increase productivity and efficiency by streamlining their business processes. 2.3.2 Improved Customer Engagement: Enhanced customer satisfaction and relationships are the result of businesses using CRM applications to better understand and interact with their customers. 2.3.3 Scalability: As an organization's needs evolve and its business expands, its Dynamics 365 deployment can be expanded. 2.3.4 Data-Driven Decision Making: Organizations can make well-informed decisions that help them remain competitive by having access to real-time data and analytics 2.3.5 Adaptable Deployment Options: Depending on the needs of the organization, Dynamics 365 provides both cloud and onpremises deployment options. 7 2.4 Conclusion Finally, the literature review focuses on Microsoft Action 365 as a versatile solution for Adventure Competency Planning (ERP) and Customer Relationship Management (CRM). Developed by Microsoft, this service offers a modular approach that allows businesses to choose and customize applications as needed and scale them as needed. The key component, Power Policy, allows institutions to analyze documents, mechanize processes, and create ceremonial applications through Power Apps, Capacity BI, and Capacity Automate. Movement 365's clear benefits include modernized movement, enhanced customer data, scalability to adapt to evolving trading needs, data-driven accountability capabilities, and flexibility including two cloud and on-premise options. Contains configuration options. This comprehensive suite is designed to accelerate record-based accountability, improve customer interactions, and increase an organization's overall functional efficiency. As financial institutions adapt to the critical environment of modern commerce, Movement 365 has proven to be a valuable format for businesses seeking a flexible and collaborative response to meet their evolving needs. 8 Chapter 3:- Method 3.1 Mathematical defination N = Total Number of applicants Select N = Number of Applicants Selected For Further Stages. Hired N = Number of Applicants Finally Hired. 3.2 NFA of Hr Hiring System 1 for accept 0 For Reject 0 Candidate Employee Offers 1 1 3.3 Mealy Mechine of Hr Hiring System Reject Candidate Status/Reject Hire Status/Employee 9 3.5 ER Diagram HR 1..* Candidate 1..1 Employee 3.6 Flow Chart Candidate Candidate Form 10 HR Accepted End Rejected End 3.7 Pseudocode 3.7.1 Entities: Candidate Employee 3.7.2 Candidate To Employee: Through Javascript function converteCandidateToEmployee we call XMLHttpRequest that call Action. In Action with the name of Hirecandidate we have Four parameters Ownerid, Gmail, Employee Guid,CandidateGuid for plugin. Plugin with the name of AutomataProject takes the parameter then, retrive candidate data and map into employee entity then create record in dynamic 365. 3.8 Table For mathod Learnt Create Dynamic 365 Trial Create Solution Create App Create Table(Entity) Create Column(Field) Set Form Javascript Action Plugin 11 3.8.1 Create Dynamic 365 Trial Username: AbdullahQureshi@BCS213123Cust.onmicrosoft.com Password: cust@1234 Figure 1 Trial 3.8.1.1 12 Figure 2 Trial 3.8.1.2 Figure 3 Trial 3.8.1.3 13 Figure 4 Trial 3.8.1.4 Figure 5 Trial 3.8.1.5 14 Figure 6 Trial 3.8.1.6 Figure 7 Trial 3.8.1.7 15 Figure 8 Trial 3.8.1.8 3.8.2 Create Solution 16 Figure 9 Solution 3.8.2.1 Figure 10 Solution 3.8.2.2 3.8.3 Create Table (Entity) 17 Figure 11 Table 3.8.3.1 Figure 12 Table 3.8.3.2 3.8.4 Create Column(Field) 18 Figure 13 Column 3.8.4.1 Figure 14 Column 3.8.4.2 19 Figure 15 Column 3.8.4.3 20 3.8.4 Create App Figure 16 App 3.8.4.1 Figure 17 App 3.8.4.2 21 Figure 18 App 3.8.4.3 Figure 19 App 3.8.4.4 22 Figure 20 App 3.8.4.5 Figure 21 App 3.8.4.6 23 3.8.5 Set Form Figure 22 Form 3.8.5.1 24 3.9 Plugin 3.9.1 ConvertCandidateToEmployee using Microsoft.Xrm.Sdk; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AutomataProject { public class ConvertCandidateToEmployee : IPlugin { public void Execute(IServiceProvider serviceProvider) { StringBuilder strError = new StringBuilder(); try { ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService)); IPluginExecutionContext context = (IPluginExecutionContext) serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = factory.CreateOrganizationService(context.UserId); tracingService.Trace("In Try"); string candidateId = (string)context.InputParameters["CandidateGuid"]; tracingService.Trace("Inside IF"); Candidate candidate = Candidate.retrieveCandidate(service, candidateId, tracingService); if (candidate != null) { Guid empid= Employee.createEmployeeFromCandidate(service, candidate, tracingService); context.OutputParameters["EmployeeGuid"] = empid.ToString(); SendEmail.sendEmail(service, gmail, new Guid(ownerid),tracingService); } } catch (Exception ex) { throw ex; } } } } 25 3.9.2 Candidate using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Query; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AutomataProject { class Candidate { public string guid { get; set; } public string Name { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Passport { get; set; } public int Age { get; set; } public Money CandidateExpectedSalary { get; set; } public string NationalId { get; set; } public OptionSetValue Country { get; set; } public string PhoneNumber { get; set; } public string OtherNumber { get; set; } public string Email { get; set; } public string Address { get; set; } public string Salary { get; set; } public OptionSetValue Gender { get; set; } public OptionSetValue Type { get; set; } public OptionSetValue Designation { get; set; } public DateTime dateTime { get; set; } public static Candidate retrieveCandidate(IOrganizationService service, string candidateId, ITracingService tracingService) { // throw new InvalidPluginExecutionException("test"); tracingService.Trace("Inside Candidate"); Candidate candidate = null; Entity retrievedCandidate = service.Retrieve("auto_candidate", new Guid(candidateId), new ColumnSet(true)); tracingService.Trace("Inside candidate"); if (retrievedCandidate!=null) { candidate = new Candidate(); candidate.Name = retrievedCandidate.GetAttributeValue<string>("auto_name"); candidate.FirstName = retrievedCandidate.GetAttributeValue<string>("auto_firstname"); candidate.LastName = retrievedCandidate.GetAttributeValue<string>("auto_lastname"); candidate.Gender = retrievedCandidate.GetAttributeValue<OptionSetValue>("auto_gender"); candidate.Email = retrievedCandidate.GetAttributeValue<string>("auto_email"); candidate.NationalId = retrievedCandidate.GetAttributeValue<string>("auto_nationalid"); candidate.PhoneNumber = retrievedCandidate.GetAttributeValue<string>("auto_phonenumber"); candidate.Passport = retrievedCandidate.GetAttributeValue<string>("auto_passwordnumber"); candidate.Address = retrievedCandidate.GetAttributeValue<string>("auto_address"); candidate.Country = retrievedCandidate.GetAttributeValue<OptionSetValue>("auto_country"); candidate.Designation = retrievedCandidate.GetAttributeValue<OptionSetValue>("auto_designation"); candidate.Type = retrievedCandidate.GetAttributeValue<OptionSetValue>("auto_type"); candidate.Salary = retrievedCandidate.GetAttributeValue<string>("auto_expectedsalary"); candidate.dateTime = retrievedCandidate.GetAttributeValue<DateTime>("auto_expectedjoiningdate"); } tracingService.Trace("1 candidate"); return candidate; } } } 26 3.9.3 Employee using Microsoft.Xrm.Sdk; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AutomataProject { class Employee { public static Guid createEmployeeFromCandidate(IOrganizationService service, Candidate candidate, ITracingService tracingService) { tracingService.Trace("Inside Candidate"); Entity newEmployee = new Entity("auto_employee"); newEmployee["auto_name"] = candidate.Name; newEmployee["auto_firstname"] = candidate.FirstName; newEmployee["auto_lastname"] = candidate.LastName; newEmployee["auto_gender"] = new OptionSetValue(candidate.Gender.Value); newEmployee["auto_email"] = candidate.Email; newEmployee["auto_nationalid"] = candidate.NationalId; newEmployee["auto_passportnumber"] = candidate.Passport; newEmployee["auto_address"] = candidate.Address; newEmployee["auto_country"] = new OptionSetValue(candidate.Country.Value); newEmployee["auto_designation"] = new OptionSetValue(candidate.Designation.Value); newEmployee["auto_type"] = new OptionSetValue(candidate.Type.Value); newEmployee["auto_salary"] = candidate.Salary; newEmployee["auto_joiningdate"] = candidate.dateTime; Guid empid = service.Create(newEmployee); return empid; } } } 27 3.9.4 sendEmail using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk; using System; using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab; using System.Net.Mail; using System.Net; namespace AutomataProject { internal class SendEmail { public static void sendEmail(IOrganizationService service, string recipientEmail, Guid userId, ITracingService tracing) { Entity email = new Entity("email"); email["subject"] = "This is Subject"; email["description"] = "This is description"; // Sender (From) Entity fromActivityParty = new Entity("activityparty"); fromActivityParty["partyid"] = new EntityReference("systemuser", userId); // Recipient (To) Entity toActivityParty = new Entity("activityparty"); toActivityParty["addressused"] = recipientEmail; // Set the recipient's email address email["to"] = new Entity[] { toActivityParty }; // Use an array for multiple recipients email["from"] = new Entity[] { fromActivityParty }; // Use an array for multiple senders email["directioncode"] = true; Guid emailId = service.Create(email); tracing.Trace( emailId.ToString() + "EmailID"); tracing.Trace("Before send email"); SendEmailRequest sendEmailRequest = new SendEmailRequest { EmailId = emailId, TrackingToken = "", IssueSend = true }; // Send the email SendEmailResponse emailResponse = (SendEmailResponse)service.Execute(sendEmailRequest); tracing.Trace("After send email"); } } } Figure 23 Email 3.9.4.1 28 Figure 24 Email 3.9.4.2 Figure 25 Email 3.9.4.3 29 3.10 Javascript 3.10.1 Candidate function ConcateFirstNameAndLastNameOnName(executionContext) { debugger; var formContext = executionContext.getFormContext(); var firstName = formContext.getAttribute("auto_firstname").getValue(); var lastName = formContext.getAttribute("auto_lastname").getValue(); if (firstName != null && lastName != null) { var fullName = firstName + " " + lastName; formContext.getAttribute("auto_name").setValue(fullName); } if (firstName == null && lastName == null) { formContext.getAttribute("auto_name").setValue(null); } } function validatePhoneNumber(executionContext) { var formContext = executionContext.getFormContext(); var phoneNumber = formContext.getAttribute("auto_phonenumber").getValue(); if (phoneNumber && /^\d{11}$/.test(phoneNumber)) { formContext.getControl("auto_phonenumber").clearNotification(); } else { formContext.getControl("auto_phonenumber").setNotification("Please enter a valid 11-digit phone number."); } } function validateEmail(executionContext) { var formContext = executionContext.getFormContext(); var email = formContext.getAttribute("auto_email").getValue(); if (email && email.includes("@")) { formContext.getControl("auto_email").clearNotification(); } else { formContext.getControl("auto_email").setNotification("Please enter a valid email address."); } } function enablerule(primaryControl) { debugger; var statuss = primaryControl.getAttribute("auto_status").getValue(); if(statuss!=817530002) { return false; } } 30 function converteCandidateToEmployee(primaryControl) { debugger; var recordGuid = primaryControl.data.entity.getId(); primaryControl.getAttribute("auto_status").setValue(817530000); var Candidate = recordGuid.replace("{", "").replace("}", ""); var parameters = {}; parameters.CandidateGuid = Candidate; // Edm.String var req = new XMLHttpRequest(); req.open("POST", Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.2/auto_HireCandidate", false); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Content-Type", "application/json; charset=utf-8"); req.setRequestHeader("Accept", "application/json"); req.onreadystatechange = function () { if (this.readyState === 4) { req.onreadystatechange = null; if (this.status === 200 || this.status === 204) { var empid = JSON.parse(this.response).EmployeeGuid; window.open("https://org42d10d0a.crm4.dynamics.com/main.aspx?appid=6b670a1c-4f94-ee11-be36000d3a277217&pagetype=entityrecord&etn=auto_employee&id=" + empid, "_blank"); } else { console.log(this.responseText); } } }; req.send(JSON.stringify(parameters)); primaryControl.data.entity.save(); } function lockFormOnChangeOfStatus(executionContext) { debugger; var formContext = executionContext.getFormContext(); var statuss = formContext.getAttribute("auto_status").getValue(); if (statuss==817530000 || statuss==817530001) { var attributes = formContext.data.entity.attributes.get(); for (var i = 0; i < attributes.length; i++) { var attribute = attributes[i]; attribute.controls.forEach(function (control) { control.setDisabled(true); // Set field as read-only }); } } } 31 3.10.2 Employee function lockAllEmployeeField(executionContext) { debugger; var formContext = executionContext.getFormContext(); var attributes = formContext.data.entity.attributes.get(); for (var i in attributes) { var attribute = attributes[i]; attribute.controls.forEach(function (control) { control.setDisabled(true); }); } } function ConcateFirstNameAndLastNameOnName(executionContext) { debugger; var formContext = executionContext.getFormContext(); var firstName = formContext.getAttribute("auto_firstname").getValue(); var lastName = formContext.getAttribute("auto_lastname").getValue(); if (firstName != null && lastName != null) { var fullName = firstName + " " + lastName; formContext.getAttribute("auto_name").setValue(fullName); } if (firstName == null && lastName == null) { formContext.getAttribute("auto_name").setValue(null); } } 32 Chapter 4:- Result Figure 26 Result 4.1 Figure 27 Result 4.2 33 Figure 28 Result 4.3 4.1 Conclusion Finally, you can significantly increase your talent acquisition efforts by focusing on making it appealing by removing redundant or unnecessary processes and increasing efficiency through electronic forms. Using targeted strategies to achieve top-notch skills, as well as transparent and authentic interactions for participants, creates a positive candidate experience leading to maximized output in the form of performance. Incorporating non-judgmental practices promotes diversity and provides coherency, ensuring that all candidates enjoy get equal oppportunities based on the work they put in. Additionally, the paper-based conclusions that accompany the analysis allow for planned strategy expansion. Ultimately, the combination of these efforts not only streamlines the hiring process, but also builds the foundation for a more thorough, efficient, and document-focused talent sourcing ecosystem. 34 4.2 Reference https://www.stertak.com/article/post/1 https://www.tech-quantum.com/d365-how-to-create-a-publisher-and-solution/ https://www.aegisinfoways.com/articles/dynamics-365-apps-designer-sitemap-editor.html https://www.crmjetty.com/blog/create-custom-entities-dynamics/ https://centricconsulting.com/blog/how-to-create-a-file-field-in-dynamics-365-model-driven-apps/ https://fredrikengseth.medium.com/how-to-add-javascript-to-form-on-load-in-dynamics-365ed66843bbc0e https://www.cloudfronts.com/blog/d365-enterprise/adding-a-button-on-ribbon-and-on-click-opensquick-create-form-using-ribbon-workbench-in-xrm-toolbox/ https://d365demystified.com/2020/09/22/pass-execution-context-to-js-script-function-as-a-parameterfrom-a-ribbon-button-in-dynamics-365-ribbon-workbench/ https://d365demystified.com/tag/custom-rule-in-ribbon-workbench/ https://www.appseconnect.com/connecting-xrmtoolbox-with-microsoft-dynamics-365-crm-theultimate-guide/ 35