+44(0)1908 545 770
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
30 July 2014

Start K2 blackpearl process On Object Update

A typical K2 blackpearl workflow process design pattern is to associate a business object (for example a leave request) with a K2 process, and this process is typically a long running process that moves the object to its finite state. An example final state might be approved.

Updates made to data, or more specifically business objects, during this long running process sometimes require a K2 workflow processes to be started to react to this update. It could be that a change in one of the data objects’ properties requires an approval process to be initiated if its value is above a certain threshold.  While the business logic in the approval process might have been called as part of the sequential long running K2 process, it is required to be executed again to evaluate and to ensure the appropriate K2 workflow actions are taken.

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

The easiest approach to sole this using K2 blackpearl is to ensure the long running K2 business process makes a K2 IPC call at the particular stage when the initial business object’s value is evaluated.  The sub-process will so whatever it needs to do. This typically happens when the K2 process is initiated, but can also happen at any stage of the sequential K2 process.

Start K2 blackpearl process On Object Update

K2 blackpearl Process Start from Long Running Sequential K2 process

k2 blackpearl sub-process executes k2 business rule and takes no action

K2 blackpearl sub-process executes k2 business rule and takes no action

If the business object is updated outside the context of the long running K2 blackpearl process, all K2 workflow processes as required by the business rules should be re-executed.  This business object update might have been as a result of an update made to data from a ASP.NET or K2 SmartForm.  The best practice is to keep any business logic as far as possible away from the interface that does the update, and to simply trigger a mechanism that starts all the K2 processes that are affected by the change in data.  If you are using purely SmartForms, the best place to set this up is using the K2 Custom Event Designer.

K2 blackpearl Process-Start from Object-Update in K2 Custom Event Designer

K2 blackpearl Process-Start from Object-Update in K2 Custom Event Designer

The example below uses an ASP.NET form for its user interface, and the K2 processes that subscribe to changes are simply called.

k2 blackpearl process start from business object update in code

K2 blackpearl process start from business object update in code

It is important to design the processes in such a way that they are autonomous and decide if the change in data actually results in, for example, K2 workflow tasks being created.  They might also need to be aware of other existing obsolete K2 processes that needs to be completed to ensure the latest K2 workflow tasks correlating to the business object exists.

k2 blackpearl sub-process executes standalone and k2 business rule dictates new user registration is reguired

K2 blackpearl sub-process executes standalone and k2 business rule dictates new user registration is reguired

Every time an update is made to data, consider the impact on your K2 processes.  Use a separation of concerns pattern when designing K2 workflow processes, and use an K2 IPC event to string together K2 business processes.  Ensure K2 processes subscribe to updates to data via. the K2 Custom Event Designer, or in code if you prefer this approach.  Design K2 processes to be able to execute stand alone, and ensure they are aware of other K2 processes and terminate obsolete ones if the K2 business rules dictates this.

Need further technical advice or support?