Skip to main content
Nintex Community Menu Bar

how to delete process instance programmatically?

  • October 26, 2009
  • 2 replies
  • 36 views
  • Translate All

Forum|alt.badge.img

how to delete process instance  with particular folio name programmatically?


 


Please reply

2 replies

Forum|alt.badge.img+9
  • October 27, 2009



SourceCode.Workflow.Management.



WorkflowManagementServer


DeleteProcessInstances and GetProcessInstances will help get you pointed in the right direction


Translate

Forum|alt.badge.img+4
  • October 29, 2009

Hi,

See below sample code to delete instances based on the Process Instance Folio:


using m = SourceCode.Workflow.Management;
using h = SourceCode.Hosting.Client.BaseAPI;

private void button1_Click(object sender, EventArgs e)
        {


            h.SCConnectionStringBuilder scConn = new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();


            scConn.Host = "LocalHost";
            scConn.Port = 5555;
            scConn.Integrated = true;
            scConn.IsPrimaryLogin = true;


            m.WorkflowManagementServer wms = new SourceCode.Workflow.Management.WorkflowManagementServer();


            wms.Open(scConn.ToString());
           
            m.ProcessInstances pi = wms.GetProcessInstances("test");


            foreach (m.ProcessInstance var in pi)
            {


                wms.DeleteProcessInstances(var.ID, true);
            }
            wms.Connection.Close();


        }



hth,

Translate