可以調用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>{"Routing":{}}</Context>
</Header>
<FormData>
<Purchase>
<SN></SN>
<RequestUser>丹尼爾</RequestUser>
<RequestDate>2020-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
PostData為xml檔,格式同上。