Workflow::XPDL - Perl extension for reading XDPL
use Workflow::XPDL qw(:all); my $oo_xpdl = Workflow::XPDL->new(); $oo_xpdl->xml_file('workflow.xml'); my $is_valid_workflow_result = $oo_xpdl->is_valid_workflow('1'); my @impl_result = $oo_xpdl->get_imp_details('58'); $oo_xpdl->application_id('transformData'); my %app_data_result = $oo_xpdl->get_app_datatypes('transformData'); my %transition_result = $oo_xpdl->get_transition_ids('1');
Workflow::XPDL is essentially a object oriented reference library to read XML documents in XPDL format (http://www.Workflow.org/standards/xpdl.htm). Workflow::XPDL takes sections of the XPDL document based on input values and returns scalars, hashes, and arrays for use in the calling programs.
None by default.
new() can be called as the default constructor, or can also be called with references to the XML file being read (xml_file), the Workflow Id to be processed (workflow_id), the Activity Id to be processed (activity_id), and the Application Id to be processed application_id). It returns a new Workflow::XPDL object.
new()
activity_id() gets or sets the current activity_id of interest.
activity_id()
application_id
get_app_datatypes
( 'orderInfo' => ['2', 'OUT', 'DeclaredType', 'Order'], 'orderStringIn' => ['1', 'IN', 'BasicType', 'STRING'] );
Where the values are 'Index Id', 'Mode', 'Data Type', and 'Variable Type'.
get_imp_details
[ 'Tool', 'transformData', 'APPLICATION' ];
Which are the values of 'Implementation Type', 'Name', 'Application Type'. If no application is defined to an activity, the first value of the array is set to zero.
get_transition_ids
( '22' => { 'transition_to_id' => '12', 'transition_condition' => 'status == "Valid Data"' }, 'trans_exist' => 'TRUE', '23' => { 'transition_to_id' => '39', 'transition_condition' => 'status == "Invalid Data"' }, 'restriction_type' => 'XOR', );
The key in the hash is the transition id. The value of the key is another hash, containing the name/value pairs of the transition. The key 'restriction_type' defines the type of restriction placed on the transition (only 'XOR' and 'AND' are valid restriction types).
In the case where there are no transitions exist (i.e. the end of a workflow), the key 'trans_exist' is set with a value of 'FALSE'.
header_info returns header information about the XPDL file, in hash. The returning value will look like:
header_info
( 'Created' => '6/18/2002 5:27:17 PM', 'Vendor' => 'XYZ, Inc', 'XPDLVersion' => '0.09' );
is_valid_workflow can optionally accept a workflow id (which will override any existing setting). It returns 0 if the requested workflow is found, 1 if it does not exist.
is_valid_workflow
Workflow::Wfmc
Stephen Rhoton, <srhoton@andrew.cmu.edu>
Future interations will also include the ability to write the XPDL document.
Copyright (C) 2008 by Stephen Rhoton
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Workflow::XPDL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Workflow::XPDL
CPAN shell
perl -MCPAN -e shell install Workflow::XPDL
For more information on module installation, please visit the detailed CPAN module installation guide.