NAME
Workflow::XPDL - Perl extension for reading XDPL
SYNOPSIS
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');
DESCRIPTION
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.
EXPORT
None by default.
FUNCTIONS
- new();
-
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. - activity_id();
-
activity_id()
gets or sets the current activity_id of interest. - application_id();
application_id
gets or sets the current activity_id of interest. - get_app_datatypes();
get_app_datatypes
can optionally take an application id (which will override any existing setting). It returns all the datatypes associated with a particular XPDL application in a hash, with key values being the datatype name, i.e. something like: -
( 'orderInfo' => ['2', 'OUT', 'DeclaredType', 'Order'], 'orderStringIn' => ['1', 'IN', 'BasicType', 'STRING'] );
Where the values are 'Index Id', 'Mode', 'Data Type', and 'Variable Type'.
- get_formal_parameters(); Not yet implemented.
- get_imp_details();
get_imp_details
gets detailed information about an application implementation of an activity. It can optionally take an application id (which will override any existing setting). It returns an array similar to the following: -
[ '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();
get_transition_ids
optionally takes an activity id, and returns a hash that describes all the activities that an activity can transition to, and the type of transition. Returns output similar too: -
( '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();
-
header_info
returns header information about the XPDL file, in hash. The returning value will look like:( 'Created' => '6/18/2002 5:27:17 PM', 'Vendor' => 'XYZ, Inc', 'XPDLVersion' => '0.09' );
- is_valid_workflow();
-
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.
SEE ALSO
AUTHOR
Stephen Rhoton, <srhoton@andrew.cmu.edu>
TODO
Future interations will also include the ability to write the XPDL document.
COPYRIGHT AND LICENSE
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.