|
Element "zpro > process > ProcessDef" |
|
|
ProcessDef element is the base element for the Process Definition elements. To create your own Process Definition element follow these steps:
After the element is created in the library, open it with MoreMotion XML Editor and modify it as required.
The necessary modifications on the Process Definition Element Process Parameters If you need to pass parameters to your process class then you should define it with <prop> element. The following code defines a custom property named "myprop" that excepts A string type value. <prop name="myprop" type="string" caption="My Property"/>
See Property Types. Note that %config() function is used in order to transfer the values entered into the process parameters to the configuration files under "/WEB-INF/MM-INF/config" directory. The parameter of the %config() function is the name of a hidden property. During build, the value of the std.config property will be added to the configuration file after the CScript functions in it are resolved. An process class can access to the process configuration as follows. String myprop = callDef.getProcessConfig().getParameter("myprop").stringValue();
Required Items When this process definition element is placed into a page and the project is built, the items (Files, executables,etc.) required by the process should be deployed to the target directories under the application server. We should use <reqitems> definitions for that purpose as in the example.
There should be one item definition for the each item to be deployed. target-prefix attribute defines where to deploy the items on the server. myunit.res file in the example will be taken from the same directory where this process definition element is located and it will be copied to the \WEB-INF\MM-INF\resources directory. The code piece below defines the name of the process class to be called by the Process Manager. <class>mypack.MyProcess</class>
A Unit Name is used as the base identifier for the messages created by a Process Broker using createMessage() method. If the unit name, for instance, is myunit and a message is created with createMessage("MY_MESSAGE_ID",null,null)
then:
|