可以调用API或Web Services发起流程。

API发起

BPM.Client.BPMProcess类,方法:

public static PostResult Post(BPMConnection cn, Stream xmlDataStream)

使用方法:

using (BPMConnection cn = new BPMConnection())

{

   cn.Open("192.169.1.100","99199","1",1590);

   postResult = BPMProcess.Post(cn, xmlDataStream);

}

XML文件格式:

<?xml version="1.0"?>

<XForm>

   <Header>

       <Method>Post</Method>

       <ProcessName>采购申请</ProcessName>

       <ProcessVersion>1.9</ProcessVersion>

       <DraftGuid></DraftGuid>

       <OwnerMemberFullName>BPMOU://易正信息/开发部/人资组/99199</OwnerMemberFullName>

       <Action>提交</Action>

       <Comment></Comment>

       <UrlParams></UrlParams>

       <ConsignEnabled>false</ConsignEnabled>

       <ConsignUsers>[]</ConsignUsers>

       <ConsignRoutingType>Parallel</ConsignRoutingType>

       <ConsignReturnType>Return</ConsignReturnType>

       <InviteIndicateUsers>[]</InviteIndicateUsers>

       <Context>{&quot;Routing&quot;:{}}</Context>

   </Header>

   <FormData>

       <Purchase>

           <SN></SN>

           <RequestUser>史蒂夫</RequestUser>

           <RequestDate>2017-09-29 00:00:00</RequestDate>

           <Amount>26000.00</Amount>

           <Reason>112233</Reason>

           <Attachments></Attachments>

       </Purchase>

       <PurchaseDetail>

           <RelationRowGuid>1</RelationRowGuid>

           <RowPrimaryKeys></RowPrimaryKeys>

           <ItemCode>001</ItemCode>

           <Price>10000.00</Price>

           <Qty>1</Qty>

           <SubTotal>10000.00</SubTotal>

       </PurchaseDetail>

       <PurchaseDetail>

           <RelationRowGuid>2</RelationRowGuid>

           <RowPrimaryKeys></RowPrimaryKeys>

           <ItemCode>002</ItemCode>

           <Price>8000.00</Price>

           <Qty>2</Qty>

           <SubTotal>16000.00</SubTotal>

       </PurchaseDetail>

   </FormData>

</XForm>

Web Services发起

url: http://192.169.1.100/2015/YZSoft.Services.REST/BPM/Post.ashx?method=Post

PostDataxml文件,格式同上。

Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor