gpt4 book ai didi

c# - K2 流程取消

转载 作者:行者123 更新时间:2023-11-30 14:03:20 24 4
gpt4 key购买 nike

我在 K2 Blackpearl 上分配了一项任务,涉及以编程方式直接停止某些工作项的进程,而不使用产品的界面,因为它没有达到目的。

问题在于,在此业务需求中,特定的支持者可以上传多个文档,这可以通过制作一个自定义应用程序从 excel 文件中读取行并自动上传到 K2 来实现。

此解决方案的开发人员已不在场,他们的工作细节不可用。

我刚刚被告知可以使用自定义控制台应用程序停止进程。

有人可以教我正确的道路吗?我以前没有 K2 的经验,所以这对我来说是一项艰巨的任务,因为我不熟悉它的流程。

最佳答案

K2 API 有很好的文档,您可以从 K2 underground 下载示例代码和演示应用程序。

您的问题的答案在这里:k2underground.com/forums/p/12082/35429.aspx

我已经提取了相关的代码行:

//引用

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SourceCode.Workflow.Management;
using SourceCode.Hosting.Client.BaseAPI;

//代码

// connection string
SCConnectionStringBuilder scBuilder = new SCConnectionStringBuilder();
scBuilder.Authenticate = true;
scBuilder.IsPrimaryLogin = true;
scBuilder.Integrated = true;
scBuilder.Host = "localhost";
scBuilder.Port = 5555;

// connect to K2 Server
WorkflowManagementServer wfmServer = new WorkflowManagementServer();

wfmServer.CreateConnection();
wfmServer.Connection.Open(scBuilder.ConnectionString);

// optionally get a list of process instances to explore
/*
ProcessInstances procInst =
wfmServer.GetProcessInstancesAll(string.Empty, string.Empty, string.Empty);
*/

// when you've got a proc inst you're interested in, stop it.
int _procInstId = 123; // get this from your process instance context
wfmServer.StopProcessInstances(_procInstId);

您可以在此处找到更多代码示例: Tim Byrne's blog re: K2

在 API 的几十个可用命名空间中,最常用的命名空间是(顺便说一句,公司名称是 SourceCode):

> Sourcecode.Workflow.Client
> SourceCode.Workflow.Management
> SourceCode.SmartObjects.Client

希望对您有所帮助。

关于c# - K2 流程取消,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4394169/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com