How to initiate two or more tasks from a same client activity ?

  • 5 March 2014
  • 3 replies
  • 0 views

Badge +1

Hi,

I am having a problem, Im working on Sharepoint2010 with K2 blackpearl workflow.

Requirement:

I have a form with 2 buttons, and I need to generate tasks from these 2 buttons.

 

Problem:

When I generate task from Button1, the activity is generated and tasks moves forward, then its become impossible to generate task from Button2(on the same form). What could be the solution ? so that I could generate 2 tasks from Button1 and Button2 remaining on same form

 

Faizan Ahmed


3 replies

Badge +7

Are you working with an InfoPath form or a SmartForm?  

 

Every event has an ID tied to it.  If you are working with SharePoint, it might be possible to load a data column with the event ID that you are currently working in.  If you are working in SmartForms, you can load a paramater with the ID and action the next event with Button #2.  Can you go into detail on what events you are trying to fire after clicking on the button?

14147i19034E4C49414D85.png

Badge +1

hi,

Im new in Sharepoint + K2 .  Im using custom form + telerik controls with application pages. I want to redirect myself on the same form after generating a task(or activity) from Button1 so that i could be able to generate another task (or activity) using Button2. 

 

Codebehine my aspx.cs file:

protected void Button1_Click(object sender, EventArgs e)
{

// some code 

Hashtable hashTable = new Hashtable();
hashTable["EmpNo"] = Convert.ToString(ActivityDataField["SendRecommendationToEmployee"]);

base.DoAction("SendResponseToEmployee", hashTable, panel1.ID);

}

 

After performing this action my task goes away, and i become unable to use this code;

protected void Button2_Click(object sender, EventArgs e)
{

// some code 

Hashtable hashTable = new Hashtable();
hashTable["SomeValue"] = Convert.ToString(ActivityDataField["SendToChairman"]);

base.DoAction("SendResponseToChairman", hashTable, panel1.ID);

}

 

 

Badge +3

If I understand correctly you have a form with 2 buttons and that form is associated with a K2 task (client event). As you as you click on either of the buttons that the workflow progresses which results in the form being invalid.

 

It seems like you need to assign parallel activities. For that you need 2 lines from the initial activity and set up rules so that only when both buttons are clicked should you progress to the next activity.

Reply