How do I copy and edit a delivered autocomplete rule?

Hello, my name is Steve. In this video, I’ll demonstrate how to duplicate one of the delivered autocomplete rules. Then I’ll edit it so that it validates a business object based on slightly different requirements than the original delivered rule.

Sign in using the username and password assigned to you and enter your sandbox. As you can see, I am already in a sandbox logged in as hcm_impl20. The yellow toolbar at the top of the page indicates that you are in a sandbox. To navigate to the Autocomplete Rules Editor, click the Tools menu on the yellow tool bar and select HCM Experience Design Studio. On the HCM Experience Design Studio page, make sure that the Autocomplete Rules tab is selected.

From the Home page, click the Navigator icon.

Expand the Configuration section.

Click Sandboxes.

Enter your sandbox you set up to use for autocomplete rule changes.

Click Tools menu.

Select HCM Experience Design Studio.

Click the Autocomplete Rules tab.

We’re going to copy one of the delivered rules, and then edit it for a new use case. The delivered rule validates that a promotion or transfer has an effective date on the 1st or 16th of a future month. The effective date is a field in the When and Why section of the action flows. So we know this will be a rule based on the When and Why business object. We’re going to duplicate this rule and edit it so that it applies to the new hire process. And we want to validate that the action takes place on just the first day of a future month, and that it is for a specific action reason.

In the Business Object drop-down list, select When and Why.

In Delivered Rules section, for the Validate Effective Date on 1st or 16th of the Month rule, click the Duplicate icon.

When we duplicate a rule, we want to change the name of the rule so that it accurately describes the purpose of the rule. We also want to be sure to set the new rule to Active, so that we can test the rule.

In the Name field, change the name to Effective Date must be on 1st of a future Month for a specific action reason.

Click the Active check box.

The delivered rule is set up to trigger during a transfer or promotion flow. But we also want our rule to apply to the new hire flow, so we’re going to add that to the condition that verifies the action type.

In the row for the When and Why.Action Type Code, to the right of In, select Hire an Employee.

Click Save and Close.

Now we’re going to test this rule by entering the new hire flow. We’re going to make sure that the effective date is not on the 1st or 16th, because we want to trigger the error message.

Click the Home icon.

Click My Client Groups.

In the Quick Actions section, click Hire an Employee.

We’ll enter a value for Legal Employer as this is a required field. Now when we click Continue to exit out of the When and Why regions, we get an error message. Even though we did edit the rule to include the Hire an Employee action. It also would have triggered in the Promote or Transfer flows, as the rule was delivered. This shows that this delivered rule is a statutory type rule. It works as delivered, with no editing.

In the When and Why section, for the When is the employee hire date? field, enter a date that is not on the 1st or 16th.

In the Legal Employer list, select US1 Legal Entity.

Click Continue.

Review the error message.

Click OK.

Now we’ll return to our rule so that we can edit it to meet our unique business requirements.

On the Sandbox toolbar, click Tools menu.

Select HCM Experience Design Studio.

Click the Autocomplete Rules tab.

In the Business Object drop-down list, select When and Why.

Click on your copy of the rule.

We don’t have a requirement that an effective date can be on the 16th of the month. We only want that date to be on the 1st of the month. So we don’t need the variable for the 16th.

In the Rule Logic section, for the row of the variable value containing AllowedDay = 16, click the down arrow at the beginning of this row.

Select Delete.

Review the Information message.

Click OK.

Notice that the editor does not allow us to delete the variable. This is because the variable is used farther down in the logic of the rule. We’ll have to delete the lines that reference the variable, before we can delete the variable itself. Now we’ll start deleting some of the other variables we don’t need for our rule. First we’ll delete the user role variable. Oracle includes this variable in case you want to use it in the business logic to control which users are affected by the rule. We won’t need to do that so we’ll delete it.

For the row of the variable value containing User Role = Line Manager, click the down arrow at the beginning of this row.

Select Delete.

Next we’ll delete the variable that tests if we are on a responsive UI page. This is included in the delivered rule in case some users are still using classic pages, and they want to prevent this rule from triggering on those page.

That doesn’t apply in our case so we’ll delete this variable.

For the row of the variable value containing EMP_UX = EMP_UX, click the down arrow at the beginning of this row.

Select Delete.

We can also delete the variable that holds the current legislation code. Again, this variable is included for those users who may want to specify that this rule applies only to certain legislations.

For the row of the variable value containing EMP_Groovy_LegislationCode = EMP_Groovy_LegislationCode, click the down arrow at the beginning of this row.

Select Delete.

Next we’ll delete the first IF clause of the rule. In some cases you may want this rule to trigger only when there is an existing assignment for the employee. But we don’t need that for our rule.

In the row with the first IF clause, click the down arrow at the beginning of this row.

Select Delete.

Now that we’ve deleted that IF clause, we can delete the variable that was referenced in the clause.

For the row of the variable value containing Valid Existing = False, click the down arrow at the beginning of this row.

Select Delete.

You can make additional changes to the condition for the When and Why Action Type Code, but we already added the Hire an Employee action, so we can leave this list as is.

Unlike the delivered rule, we only want this rule to trigger for a specific action reason. So we need to add another condition statement to test for that. When we add the new condition, it is by default the action date. We’ll change it so that it is for the action reason ID.

For the row with the When and Why.Action Type Code condition, click the down arrow next to the condition.

Select Add condition.

In the second condition, click When and Why.Action Date.

Select When and Why.

Select Action Reason ID.

For the action reason, we want to set it to Hire to fill a vacant position. So this rule will only trigger when that action reason is selected in the When and Why section.

In the When and Why.Action Reason ID list of values, select Hire to fill a vacant position NEWHIRE.

Next, we’ll delete the condition that checks to see if the action date is the 16th of the month. The delivered rule allows the actions on that day, but we don’t want our rule to do that.

Scroll down.

For the row containing Action Date Equal to IntegerVar+AllowedDay_16, click the down arrow in front of this statement.

Select Delete condition group.

Now that we’ve deleted that condition, we can delete the variable that was referenced in the condition.

Scroll up.

For the row of the variable value containing AllowedDay = 16, click the down arrow at the beginning of this row.

Select Delete.

So now lets take a look at the other logic in or rule. This condition compares the action date to the current date, to see if the action date is in the future.

Hover over the When and Why.Action Date Greater than or equal to Today's date.

And these conditions determine if an error message will be thrown. If the action date is not the first of the month, or if it is not in the future, then the rule will display an error message. The user will have to fix the action date to proceed with the flow.

Hover over the condition groups that have the Boolean values for allowed day and future day.

The delivered error message is not quite accurate for our version of this rule. So we’ll edit the message text.

In the row containing Show an error message, enter You can do this transaction on the first of the month for this action reason to change the message.

Click Save and Close.

Now we can test the rule. We’ll do this by going into New Hire flow again. We’ll intentionally have the action date so it is not the first of the month. And we’ll be sure to select the action reason. Because the date is not an allowed hire date, we get the error message.

Click the Home icon.

Click My Client Groups.

In the Quick Actions section, click Hire an Employee.

In the When and Why section, for the When is the employee hire date? field, enter a date that is not on the 1st of the month.

In the Legal Employer list, select US1 Legal Entity.

In the Why are you hiring an employee? list, select Hire to fill a vacant position.

Click Continue.

Review the error message.

Click OK.

We’ll test the rule again by removing the action reason. Because our rule only applies to the specific action reason, the error message will not appear and we can continue with the hire flow.

In the Why are hiring an employee? field, remove Hire to fill a vacant position.

Click Continue.

You can now continue with the hiring flow.

This concludes the demonstration of how to copy and edit one of the delivered rules.

Thanks for watching.