Instant Estimate +44(0)1908738254
YOUR EXPERT RPA PARTNER

Team up with our RPA strategy and tech specialists for maximum automation impact

Find out more
Harness the power of UiPath in your business.
WATCH NOW

Save money and spend more time on priority work.

Book consultation
READY, SET, AUTOMATE

Let's choose, design and deploy a process automation solution for your business.

Find out more
TRANSFORM YOUR BUSINESS

Let's analyse your business to discover opportunities for innovation and automation.

Find out more

Begin your business transformation journey

Book consultation
AUTOMATE EVERY FUNCTION

Automate where it matters most. Scale to solve challenges in every area

Find out more
GIVE EVERY TEAM THE TOOLS FOR SUCCESS

Equip people with user-friendly solutions that save time and make work easier

Find out more

Which business problem
can we solve first?

Book consultation
09 April 2015

Using the K2 Workflow Event Wizards: Smart Object Event

The SmartObject Event is used to execute methods on the desired SmartObject.

In order to find this component, open up the Toolbox and navigate to the “Event Wizards” section. Find the component labelled “SmartObject Event”, and drag and drop the component onto the designer.

Figure 1 - SmartObject in the Toolbox

Figure 1 – SmartObject in the Toolbox

K2 Automated Testing Software

BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.

 

Free K2 Five Upgrade Review

As soon as the component is dropped onto the Designer, the SmartObject Event Wizard will automatically appear.

Figure 2 – SmartObject Event Wizard

Figure 2 – SmartObject Event Wizard

Use the “Back” and “Next” buttons to navigate through the steps in the Wizard. On the first page of the Wizard, click the “Next” button.

Specify a name for your event by entering one in the “Event Name” textbox. This is the name that will appear in the Default Activity so provide it with an appropriate name for easy identification later on.

Figure 3 - Event Name

Figure 3 – Event Name

At this point we also need to specify which Method we’d like to execute. Using the Context Browser we will browse through the available Smart Objects and select the appropriate method. Click on the “Browse” button next to the Smart Object Method field.

Figure 4 - Select the SmartObject Method to Execute

Figure 4 – Select the SmartObject Method to Execute

Click on the “Add” button at the bottom of the Context Browser to add the selected Method to the “SmartObject Method” field:

Figure 5 - Smart Object Method

Figure 5 – Smart Object Method

Click on the “Next” button to navigate to the “Input Mapping” window. Depending on the Smart Object you have selected, it might be necessary to fill in the input fields in order to perform the selected method. In this example I have selected the “Create” method on the “User” smart object. In order for me to create a new user, the method requires many fields to be entered.

Figure 6 - Input Mappings

Figure 6 – Input Mappings

Sometimes however even when an input field is presented, it is not necessarily required to enter the field. Focus on the “Required” column to see when a field must be entered.

In order to enter a specific value for a field, select the field and click on the “Assign” button.

Figure 7 - Assign Mapping

Figure 7 – Assign Mapping

The Value of an input field could come from many different places. Using the “Browse” button, will open the “Context Browser” in which case your value could from any data source associated with K2 whether it be Share Point, a CRM or even executing another method on a different Smart Object and using the return value. It could also be as simple as entering a plain text value.

Once you’ve selected or entered a value for the selected field click on the “OK” button.

Figure 8 - Entering a value for an input field

Figure 8 – Entering a value for an input field

Once you are happy with the values and you’ve entered values for all the fields you need to. Click on the “Next” button.

Often the method you are executing not only requires values in order to execute, but also returns values. The next screen takes care of that aptly named “Return Mapping”.

Figure 9 - Return Mapping

Figure 9 – Return Mapping

A Return value can be extremely useful. One way of dealing with a return value is to assign the value to a data field. This data field will then automatically receive the return value when the Smart Object event is executed in the Workflow. Once the data field is populated with the return value, it can be used again either as an input value for another Smart Object event, or anywhere else for that matter. In order to assign a return value, select the return field you want to edit, and click o the “Assign” button.

K2 Workflow Event - Figure 10 - Assign Mapping

Figure 10 – Assign Mapping

Once again this value can be retrieved from the “Context Browser” using the browse button. If you’d like to assign this value to a data field, open the “Context Browser”, navigate to the “Data Fields” tab, and select the appropriate data field. Click on the “OK” button to assign the Data Field to the Value, and click “OK”. Remember it is not necessary to assign values to return fields if you have no use for them. So skipping this step is perfectly fine.

Once all the return values have been taken care of (or skipped). Click on the “Next” button to finalize the “Smart Object Event”.

Figure 11 - Finalizing the Smart Object Event

Figure 11 – Finalizing the Smart Object Event

Click on the “Finish” button to complete the “Smart Object Event” wizard. Notice that a new default activity has been created on the Workflow that contains the “Smart Object Event” we have just created.

Figure 12 - New Default Activity

Figure 12 – New Default Activity

Need further technical advice or support?