k2 process and asp pages

  • 11 April 2008
  • 3 replies
  • 0 views

Badge +8

Hi,


I have designed a k2 blackpearl process with asp pages. I have a start.aspx. In this start.aspx I create a smartObject. I have also created some process data fields. In this start.aspx I set the process data fields by using this code.


  Connection conn = new Connection ();
        conn.Open ("blackpearl");


        ProcessInstance process1 = conn.CreateProcessInstance("HCSolutionsProcessesProcess1");
        process1.DataFields["RequestID"].Value = requestID;
        process1.DataFields["Email"].Value = txtEmail.Text;
        process1.Folio = "Request for " + txtName.Text;


        conn .StartProcessInstance(process1);
        Response .Redirect("start.aspx");
        conn.Close();


 I also have a second asp page called approve.aspx. In this page I want to update some process data fields and I want to add some more of them.

How is this possible? I think the code above doesn't work because I don't want to "CreateProcessInstance". 


Thx,
Jochen 


 


3 replies

Badge +9

I would think the easiest would be to store the data in the session state and only do the Call to CreateProcessInstance when you are ready to start the process.  As the data follows the session state, you don't really have to do any cleanup if the session expires.


 However, if you need to store the data.  e.g. in draft mode.  You might want to store the data in a persistable store and keep it as a draft.  This could be a SmartObject or you could even start the process and have a draft client activity as the first stage in your process.


 So you can see, there's a lot of ways of skinning a cat.  You probably have to decide which way suits your requirements best.

Badge +8

Thank you for this.
I think I had an error in reasoning. Because I think I don't need to store the data in the process data fields too when I have the same data in a smartObject. I only have to call the load methode of my smartObject and so I can use all the data of the smartObject in my process.


E.g. I have a field email in my start.aspx where the user enters a email adress. This email adress is stored in a smartObject. I call the the load methode of the smartObject in the MailEvent to get the email adress


 thx,
Jochen

Badge +9
That is right.  Normally you would only need to pass the identifier of the SmartObject record (i.e. ID field) into the process.  From there, the process will be able to pull out any relevant data using the identifier.

Reply