K2 process design overview

Source: Internet
Author: User

Design Process

1. Create a new project

A) Open K2 studio designer, File> New> Project

B) For example,

Project type: K2

Template: K2 Empty Project

Name: k2lab2_api

Location: C: "lab" lab2 "Process

2. Set up process processapi

A) Right-click a process project and choose add> existing items.

B) Find C: "lab" lab0 "process" k2workflowprojectlab0 "k2workflowprojectlab0" process1.kprx and click "add"

C) process1.kprx, renamed as: processapi. kprx

3. Add process datafield

A) View> k2 Object Browser

B) For example, go to the process/activity data tab (the third icon) and expand data fields.

C) Right-click processapi and click Add.

L field name: applicant; Initial Value: John

L field name: content, initial value: Content

L field name: remark, initial value: Approval comments

4. Add code

A) In server events of the approved and declined nodes, use the following code to output all variable values:

Console. writeline ("approve (or declined)-processinstance. datafields. Count =" + K2. processinstance. datafields. Count. tostring ());

For (INT I = 0; I <K2. processinstance. datafields. Count; I ++)

{

Console. writeline (K2. processinstance. datafields [I]. Name. tostring () + "=" +

K2. processinstance. datafields [I]. value. tostring ());

}

5. Modify the URL attribute of clienteventapproval

A) modify the clienteventapproval URL to http: // localhost/lab2website/approval. aspx.

6. Deployment Test

A) test in K2 workspace to ensure the process is correct

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.