2010-12-09 4 views
2

K2 Blackpearl에서 작업 인터페이스를 사용하지 않고 프로그래밍 방식으로 특정 작업 항목의 프로세스를 중지하는 작업이 할당되었습니다.K2 프로세스 취소

문제는이 비즈니스 요구 사항에서 엑셀 파일의 행을 읽고 K2에 자동으로 업로드하는 사용자 지정 응용 프로그램을 만들어 특정 제안자가 여러 문서 업로드를 할 수 있다는 것입니다.

이 솔루션의 개발자는 더 이상 존재하지 않으며 해당 작업의 세부 정보는 제공되지 않습니다.

사용자 지정 콘솔 응용 프로그램을 사용하여 프로세스를 중지 할 수 있다고 말한 것입니다.

누군가 저에게 올바른 길을 가르쳐 주시겠습니까? K2에 대한 이전의 경험이 없으므로이 프로그램의 흐름에 익숙하지 않아서 이것은 큰 과제입니다.

답변

7

K2 API는 K2 지하에서 다운로드 할 수있는 샘플 코드 및 데모 애플리케이션으로 잘 설명되어 있습니다.

질문에 대한 답은 여기에 있습니다 :

// 참조

: 나는 코드의 관련 라인을 뽑아 한 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.Workflow.Client 
> SourceCode.Workflow.Management 
> SourceCode.SmartObjects.Client 

희망하는 데 도움이 .

+0

안녕하세요. sherif, 응답 해 주셔서 감사합니다. 나는이 해결책을 점검 할 것이다. :) – janejanejane

관련 문제