共1页 1
-
2005年09月15日
yage-在线金山词霸的彩蛋
在一篇blog中看到yage-yahoo、amazon、google、ebay,一时好奇,就用在线金山词霸查了一下yage,结果居然看到了彩蛋:
除了yage和解释"n.南美卡皮木",在它们之间还会随机出现暗字体的“king金山soft软件”、软king件soft金山”,呵呵,想不到词霸还有这么有趣的时候。
-
2005年09月15日
Shark里面如何使用自定义数据类型
gramani总结得很好。
Step 1. Write a trivial class (I called mine com.intellicare.asterisk.Agent.java). Make sure it is serializable (important!).
Step 2. Open your JaWE editor. Open the xpdl that you want to use.
Step 3. pull down Package -> Type Declarations. Click "New". Enter: id:agent, name: agent, Type: External reference, Location: com.intellicare.asterisk.Agent. Click OK.
Step 4. pull down menu Package -> workflow relevant data. Click New. Enter: id: agentWfdata, name: agentWfdata, isArray: false, Type: declared type. The dropdown menu subtype will now appear with your item "agent" in it. Pick that.Click Ok.
You are done with your xpdl now.
Now the wf data variable agentWfdata will be available to your Java/Shark app as follows:
1. In order to access/initialise it within your Java program, here's what you do: Assume you have Shark initialised and your process has started. Assume you have objects WfActivity currentActivity and Agent agent. Then you can update the wfdata variable with agent as follows:
Map processContextMap = currentActivity.container().process_context();
processContextMap.put("agentWfdata", agent);
currentActivity.set_result(processContextMap);
currentActivity.complete();
2. Now wf data variable agentWfdata is available to all activities of your process. For example you can declare an application in your xpdl this way:
step(i) Open your xpdl in JaWE editor. pull down Package -> Application. Enter id:myApp, name:myApp, Then "new" formal parameter with id:agentFormalParam, mode:in and out, type:declared type. Again you should get the choice of "agent" in your drop down menu for decalred type. Click OK. Now suppose one of your activities has "Tools" mapped to this application, then the *actual* parameter that you can map to the formal parameter "agentFormalParam" is "agentWfData". This is because they both are of type decalred type "agent".
step (ii). Now in your Java/Shark program you can write a toolagent which can access the wfdata "agentWfdata " as follows:
Assume your toolagent has just that one AppParam, thenwithin the execute method:
public static void execute(AppParameter param1) {
Agent agent = (Agent) param1.the_value; //this is ok since we declared this to be *in* and out param
//now do whatveer you want with agent variable..
Agent agent2 = new Agent(..blah..);
param1.value = agent2; //this is ok since we declared this is to be in and *out* param
//etc..
}
-
2005年09月15日
shark的学习路线
Geeta的总结。
Are you also new to workflow in general? In which case, you should try and read up on the WfMC specs. Here's a link I found really helpful for the definitions: http://www.wfmc.org/standards/docs/tc003v11.pdf
Once you have at least an overall idea of the specs and the definitions involved, you can look at JaWE, the java Workflow editor which ships with Shark. There is a tutorial in JaWE which is pretty helpful.
Then you can read up on Shark documentation on the Shark website. Especially look at all the links here: http://shark.objectweb.org/doc/1.1/index.html as well as http://shark.objectweb.org/doc/faq.html
There is also a "getting started" page which you can work through. Also, browse though the mail archives. There's a lot of stuff hidden there..
Finally if you are used to web applications, look at the code in http://shark.objectweb.org/components.html#_apps_ . It is a beginner's web app which uses Shark as a client and may help orient you.
-
2005年09月08日
操作dbf的类库
操作DBF文件的类库建议采用javadbf。
名称为javadbf的开源项目有两个,一个是http://javadbf.dev.java.net,因为这个项目缺少文档而代码注释不知是何国鸟语,故不选;另一个是http://sarovar.org/projects/javadbf/,印度人的开源项目,文档完备,注释多到冗余,在http://sarovar.org上下载次数排第6,LGPL。
通过对一些dbf文件进行读写测试,印度人的这个项目完全符合我们项目的需要。我们将采用此javadbf作为操作dbf的工具。 -
2005年09月02日
how to use the Deadline Activity property
Q:
Can somebody explain how to use the Deadline Activity property? I have the case that I will need to instantiate a process and set a variable, let say start_date, to the date that this process was instantiated. After that in one of its activities, say Activity1 I want to make a deadline such that if (start_date+2days) have passed it will move to the next activity if not triggered manually? Is this possible to be done and if so how?
A:
Set the deadline to Synchronous and enter as condition something like:
var d = new java.util.Date(start_date.getTime() + WAIT_TIME_OUT);
d;
where start_date is of type Date and WAIT_TIME_OUT is in milliseconds. WAIT_TIME_OUT can be a process- or package-level WRD with initial value (some kind of constant), or just a numeric value - it is your choice.
Fill in the Exception name with some meaningfull string, for example
TimeToContinueException
Then set two outgoing transitions:
- By exception ("TimeToContinueException");
- By condition - the normal activity completion.
If you need exactly the process start date, you can use the Shark supplied value PROCESS_STARTED_TIME instead your own variable start_date.
For more details see the "how_to" document, point "How to write deadline expressions for activities?"







