Hi,
I am trying to create a workflow that uses Winforms, but despite not receiving any error, neither the process instance nor the worklist item are created.
I envisage that this would work by looking up data stored at activity level and making the decision what form to open based on that. Below is the code I have in the 'StartProcess' form, would anyone be able to shed any light on my this doesn't seem to work?
Any help would be much appreciated.
using
System;using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SourceCode.Workflow.Client;
namespace
K2WinForms{
public partial class StartProcess : Form
{
private string strK2Server = @"FGL-VSPD-BPL-02";
private string strK2Process = @"K2WinFormsBPProduct";
public StartProcess()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Connection oK2Connection = new Connection();
ProcessInstance oNewProcessInstance;
try
{
oK2Connection.Open(strK2Server);
oNewProcessInstance = oK2Connection.CreateProcessInstance(strK2Process);
oNewProcessInstance.DataFields[
"ApprovalStage"].Value = "Business Approval";oNewProcessInstance.Folio =
"Winforms";oK2Connection.StartProcessInstance(oNewProcessInstance,
false);oK2Connection.Close();
MessageBox.Show("Process Created....");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
Thanks,
Kevin.