« Return to Thread: How to create process
Hi,
Thank you for
your help,I have resolved the problem using your method.
发件人: Gary Howard
[mailto:gary.howard@...]
发送时间: 2009年9月4日 15:20
收件人: shark@...
主题: [shark] RE: 答复: Re: How to create process
Winstone,
Try
putting ut.commit(); at the end of the procedure to commit your changes
to the database.
You
need to look for documentation on JTA rather than Shark.
|
Regards, |
|
Gary Howard |
|
Technical Architect |
From: 王鹏 [mailto:winstone_wang@...]
Sent: 04 September 2009 02:48
To: shark@...
Subject: [shark] 答复:
Re: How to create process
Hello,DS:
I am glad to receive your
message,your understanding is right.when I created a process in my program,how can
I persist it?Do you give me a example?
This is my codes for creating process:
public
static void createInstance(String username, String pwd,String pkgID) throws
Exception
{
SharkInterfaceWrapper.setProperties("D:\\tws-community-2.4-8-25\\conf\\Shark.conf",
true);
UserTransaction ut =
(UserTransaction) new
InitialContext().lookup("java:comp/UserTransaction");
ut.begin();
SharkConnection sc =
SharkInterfaceWrapper.getSharkConnection("admin", null);
WMConnectInfo wmci=new
WMConnectInfo("admin", "12", "Shark",
"");
sc.connect(wmci);
String pkgId =
"sqpkg#1#sqpkg_wp1";
String pDefId = "0";
String procDefName = SharkInterfaceWrapper.getShark()
.getXPDLBrowser()
.getUniqueProcessDefinitionName(sc.getSessionHandle(), pkgId, "",
pDefId);
WfProcessMgr mgr =
sc.getProcessMgr(procDefName);
WfProcess process =
mgr.create_process(null);
process.start();
System.out.println("success");
}
-----邮件原件-----
发件人: DS
[mailto:dmitry.shulga@...]
发送时间: 2009年9月4日 00:34
收件人: shark@...
主题: [shark] Re: How
to create process
Hello Skysea,
Frankly, I am not sure I understood the
question (what you mean by "save it to the database"). But I'll try
to explain you what I do and it may be helpful.
I have put in place workflow for the web
content publishing. Since workflow is nothing more than consumer of user actions,
I needed persistence of the association of the web content with the process in
order to be able to, first, infinitely in time extend access to the process
instance, and second, be able to communicate the process instance between
different application instances.
For that I have created my own database,
added a simple table with just two fields, processInstanceId and webContentId.
Now whevever I need to figure out the state of my web content ID, I query the
table, see if I have a process accociated with it and then query the Shark for
the rest.
If this is kind of persistence you are
looking for then here it is - trivial and effective.
DS
Celona Technologies Limited (Company No. 3262010) is registered in England and
Wales, and its registered office is Level 4, 63 Gee Street, London EC1V 3RS.
The information contained in this e-mail message is the confidential property
of Celona Technologies Limited and may be privileged and protected from
disclosure. If you are not the intended recipient, any use, dissemination,
distribution or copying is strictly prohibited. If you think you have received
this e-mail message in error, please e-mail the sender. Thank you.
« Return to Thread: How to create process
| Free embeddable forum powered by Nabble | Forum Help |