当前位置:网站首页>Windchill - how to start workflow through API
Windchill - how to start workflow through API
2022-06-22 07:52:00 【Glory eggplant】
/**
* Parameters pbo It is the main part of the process , It can be Windchill An existing or newly created object in the system
* Main items , It can be a part , file ,ECR,ECO or Problem Report etc.
* Such as : WTPart, WTDocument, WTChangeRequest2, WTChangeOrder2,...
*
* Parameters templateName Is the name of the process template defined under the process administrator
*/
public void startWorkflow(WTObject pbo, String templateName ) {
String wfTemplateName = templateName ;
WTObject primaryBusinessObject = pbo ;
WfProcess wfProcess = null;
WTContainerRef containerRef = null;
WfProcessDefinition processDefinition = null;
TeamReference teamRef = null;
if (primaryBusinessObject !=null) {
// 1. Based on main items WTDocument give an example
if (primaryBusinessObject instanceof WTDocument) {
WTDocument wtDocument = (WTDocument)primaryBusinessObject ;
containerRef = wtDocument.getContainerReference();
//2. According to the process template name , Get the defined process template
processDefinition =
WfDefinerHelper.service.getProcessDefinition(wfTemplateName,containerRef );
//3. The group that gets the main item , Of the user's subsequent processes Context Team
teamRef = wtDocument.getTeamId();
//4. establish Process.
wfProcess =
WfEngineHelper.service.createProcess(processDefinition,teamRef,containerRef);
//5. Set process variables
ProcessData data = wfProcess.getContext();
// Set the main item process variable first
data.setValue("primaryBusinessObject", primaryBusinessObject ) ;
// Set other process variables
data.setValue("YourAttributeKey","YourAttributeValue");
//6. Start process
wfProcess = wfProcess.start(data, true, containerRef);
//7. Update and refresh process
Persistable persistable = PersistenceHelper,manager.modify(wfProcess);
PersistenceHelper.manager.refresh(persistable);
//8. So far, the process has been started
}
}
边栏推荐
- AudioQueue
- Vue page caching problem solving (keep alive + page level routing guard + lifecycle activated)
- MySQL intercepts the string cs0000_ 1 medium_ Following characters
- Qualcomm platform msm8953 display subsystem learning
- Mystery of power bank
- 基于消息传递的并发编程(MPI)之异步收发
- Semaphore
- Blob format problems involved in image uploading
- Query where uiwebview is used in the project
- 9、 Textinput component
猜你喜欢
![[songhongkang MySQL database] [advanced chapter] [06] logical architecture of MySQL](/img/57/22d8a6dafffe685f69660fde9e8c87.png)
[songhongkang MySQL database] [advanced chapter] [06] logical architecture of MySQL

充电宝的玄机

(7)双向链表

Remote Desktop Manager
![[普通物理]波的能量与干涉](/img/fe/066aa9e8ed776b8f069b59b7123367.png)
[普通物理]波的能量与干涉

New year's Day mall material Icon

The significance of code coverage testing to programming white and its application

Backup the method of uploading babies in Taobao stores to multiple stores

Vue page caching problem solving (keep alive + page level routing guard + lifecycle activated)

Open source get through version - integral function
随机推荐
Baidu Post Bar crawler crawls to the middle of the building
Crmeb mall order shipping function
模板代码概述
充电宝的玄机
ConfigManager JsonToObject
Applet /vant UI to upload files
Daily maintenance of website
ASP. Net core development experience
7、 Picker component
3、 Stylesheet component
Leetcode 172 Zero after factorial (2022.06.21)
Qualcomm platform LCM summary
[普通物理]波的能量与干涉
Taobao store backup one store upload to multiple stores precautions
Xmind 2022思维导图激活版资源?
各大企业连连出现亏损,环保行业何去何从?
【图论常见模板题】4种最短路解法和2种最小生成树解法
数据可视化优秀案例
Open version - user level
模電實驗——實驗二 JFET共源極放大電路