1) The following process file is defined:
<Workflows>
<Workflow name = "example" type = "url" location = "/samples/comment-arg.xml"/>
</Workflows>
This defines a process file named example, located in/samples/comment-arg.xml 2) Creating a test class com. hongsoft. OS. Test
The main method code is as follows:
Counter = 0; // variable to be tested
Map inputs = new hashmap ();
Inputs. Put ("test", this); // key: "test" value: the object of this class
Long id = workflow. initialize ("example", 1, inputs); // pass the map
Assertequals ("beanshell script not parsed correctly", 2, counter); // judgment 3) the initial actions defined in the process is as follows:
<Initial-Actions>
<Action id = "1" name = "Start Workflow">
<Pre-functions>
<Function type = "beanshell">
<Arg name = "script">
Com. hongsoft. OS. Test test = transientvars. Get ("test ");
Test. Counter ++;
Test. Counter ++;
</Arg>
</Function>
</Pre-functions>
<Results>
<Unconditional-result old-status = "finished" status = "underway" step = "1" owner = "$ {caller}"/>
</Results>
</Action>
</Initial-Actions>
In this way, when the workflow. initialize () method is called, the test. Counter is changed from 0 to 2.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.