Be sure the cppwfms has been installed properly in your system and all the environment variables have been configured as depicted in this section. Mainly the WfMS can be executed in 2 different modes:

  • as a service which retrieves request via the Web Service interface and execute them,
  • or as a local application that loads and executes a single workflow instance.

Running as a local instance

In order to run the WfMS as a local application you need to provide a workflow description in the argument lists as follows:

				 
	# ./wfms tests/power.xml
	
The verbosity of the output can be changed bye specifying the interested level using the --logger-level or just -ll. Levels from the more verbose to the less one are the following: Debug, Info, Error, Fatal
				 
	# ./wfms --logger-level Debug tests/power.xml
	
The WfMS loads the workflow into the memory and executes it, the evolution of the Petri Net state (its marking) is printed out until the final state (where no further transitions can be enabled) is reached. For example, the power.xml workflow starts with an initial marking which is:
				 
	# Net Marking: 
	# 	[
	#  		N:	{n -> '2' {0x8105ae0}};
	# 		Acc:	{ret -> '2' {0x8106158}};
	#  		Power:	{};
	#  		Dec:	{p -> '19' {0x81061e8}};
	#  		Result:	{};
	#  	]
	
And ends with a final marking which is:
			
	# Net Marking: 
	#  	[
	#		N:	{n -> '2' {0x8105e98}};
	# 		Acc:	{};
	#		Power:	{};
	# 		Dec:	{};
	# 		Result:	{ret -> '524288' {0x8113a68}};
	# 	]
	
The workflow performs the 2^19 operation.
Hovewer, the workflow definition is generic and it can be used in order to calculate the result of a generic N^M.

This can be obtained just modifing the workflow definition (changing the marking) or providing a custom marking to the workflow as an argument.

Providing a custom intial marking

A marking can be simply provided using the --init option, which accepts a string in the following grammar:

				
	params = 
		'{' ( ( argument (',' >> argument)* '}' ) | '}' );
           
	argument = 
		(string_literal ':' value_list) | value_list;
    	
	value_list = 
		( '{' value (',' value)* '}' ) | value;
    			
	value =
		( '\'' string_literal '\'' ) | real_value | int_value;
				
The grammar is able to parse strings in the following format:
				
	# ./wfms --init "{2, 4}" sub/power.xml 		// which performs 2^4 
		
	or
		
	# ./wfms --init "{Power:8, N:2}" sub/power.xml 	// which performs 2^8
		

Running JDL workflows

One of the capabilities of the cppwfms is the ability to run workflows written using several languages. JDL workflows can be executed by using the --jdl option.

				
	# ./wfms --jdl test/example.jdl 		// which performs 2^4 
		
	or
		
	# ./wfms --init "{Power:8, N:2}" sub/power.xml 	// which performs 2^8
		

Running as a standard Web Service

If you want the cppwfms to listen for incoming requestes via a WebService, you can use the --ws-i option that enable the WebService interface:

	# ./wfms --ws-i
	# INFO	-  [2008-May-07 14:06:15] - Starting the SOAP server
	# INFO	-  [2008-May-07 14:06:15] - 	* Server Socket successfully created on port: 18083
	# INFO	-  [2008-May-07 14:06:15] - 	* Listening for incoming connections...
	
The service definition (WSDL) can be downloaded here.