K2 Studio - 2 Process Start Rules


Badge +2

Hello,

 

I have a SmartForm with a button to submit a Request, and a subview of the same form with a button to cancel existing Requests. Different actions are performed depending which button is clicked.

In my K2 Studio workflow, I have 2 routes (2 lines) under the Start Event - one where the Status  = Requested, and the other where the Status = Cancelling.

All good so far.

 

However, the Configure Process Start Rule on the Start event specifies = "When BtnSubmit is Clicked".

As a result, clicking the Submit button successfully starts the Workflow, but clicking the Cancel button does not, as that would require the use of the "OnView <xyz> subview, when btnCancel is clicked".

 

So how do I assign 2 different process start rules? Do I just need to add 2 SmartForms Client Events to the Start box and configure one for each button?

 

Thanks

Gram


2 replies

Badge +10

Not sure if I understand properly. Why would you start a request just to cancel it. What you can do is in the arrow that comes out from teh stat activity have two arrows. One pointing to cancel activity and one pointing to submit activity. Create a datafield called "StartAction" and use this for the line rules. SO line one would have rule "Start Action" = "submit" and line two would have rule "Start Action" = "Cancel". When you start a process make sure to pass the value of this "StartAction" datafield so teh workflow knows where to go from the start.

Badge +2

Hi s0m3one,

 

> Not sure if I understand properly. Why would you start a request just to cancel it. What you can do is in the arrow that comes out

> from teh stat activity have two arrows. One pointing to cancel activity and one pointing to submit activity. Create a datafield called

> "StartAction" and use this for the line rules. SO line one would have rule "Start Action" = "submit" and line two would have rule

> "Start Action" = "Cancel". When you start a process make sure to pass the value of this "StartAction" datafield so teh workflow

> knows where to go from the start.

 

Apologies, I'm not quite understanding what you're suggesting.

I already have 2 lines out from my Start activity, and each has a Line Rule.

Going by what you're saying, it sounds like I don't need to add a Data Field, because I already have the RequestStatus field which gets updated by rules in the Smartform, and is passed from the SmartObject to the workflow using an Item Reference.

 

Where the RequestStatus field = Requested, the Line Rule points to the Request workflow, and where RequestStatus = Cancelling, it leads to the Cancel route. That all seems fine, and the Request route through workflow is all working ok because the SmartForm integration in the Start activity specifies the Start Process Rule as "When BtnSubmit is Clicked".

 

But when the user wishes to Cancel, they select a record from the "get list" view at the bottom of the request form, which then opens a subview, where they can confirm they wish to cancel the specified request or back out.

So... I have a different button (with it's own rule actions), which also needs to initiate the workflow.

Hence the title of this thread - I need the workflow to start when I click either of 2 different buttons in different locations, so it looks like I need 2 Process Start Rules. Do I need to create a separate workflow just for the cancellation?!

 

Cheers,

G

Reply