K2 进程取消

发布于 2024-10-07 05:09:04 字数 290 浏览 4 评论 0原文

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

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

该解决方案的开发人员已不在场,并且无法获取他们工作的详细信息。

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

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

I am assigned a task on K2 Blackpearl that involves programmatically stopping the process of certain workitems directly without using the product's interface as it does not serve the purpose.

The problem is that in this business requirement, a specific proponent can have multiple document uploads which was possible by making a custom application that reads rows from an excel file and uploading to K2 automatically.

The developers of this solution are no longer present and the details of their work are unavailable.

I am just told that stopping of processes can be done using a custom console application.

Can someone please teach me the right path?
I have no prior experience on K2 so this is a huge task for me as I am unfamiliar with its flow.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撕心裂肺的伤痛 2024-10-14 05:09:04

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

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

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

//references

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

//code

// 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 的博客回复:K2

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

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

希望有所帮助。

K2 APIs are very well documented with sample code and demo applications you can download from K2 underground.

The answer to your question is here:
k2underground.com/forums/p/12082/35429.aspx

I've pulled out the relevant lines of code:

// references

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

// code

// 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);

You can find more code samples here:
Tim Byrne's blog re: K2

Out of dozens of available namespaces in the API, the most common namespaces in use are (by the way, the name of the company is SourceCode):

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

Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文