Mark Overmeer > BPM-XPDL-0.90 > BPM::XPDL

Download:
BPM-XPDL-0.90.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.90   Source   Latest Release: BPM-XPDL-0.92

NAME ^

BPM::XPDL - XPDL access

INHERITANCE ^

 BPM::XPDL
   is a XML::Compile::Cache
   is a XML::Compile::Schema
   is a XML::Compile

SYNOPSIS ^

  my $xpdl = BPM::XPDL->new(version => '2.1');
  $xpdl->importDefinitions(...);
  my $xml  = $xpdl->writer($sometype)->($doc, $perldata);

  my ($type, $data) = $xpdl->from('data.xml');
  my ($type, $data) = BPM::XPDL->from('data.xml');
  print "Root type: $type\n";
  print Dumper $data;    # from Data::Dumper

  $xpdl->addKeyRewrite('PREFIXED');
  my $xml = $xpdl->create($data);
  print $xml->toString(1);

DESCRIPTION ^

This module provides access to the Process Description Language, as defined by the WfMC, the Workflow Management Coalition (wfmc.org) You can read and create() these XPDL files with one simpe method.

All versions of the specification are supported. It will convert older versions into newer versions if you want to. See from().

Limitiations

The XPDL files may contain additional external type definitions, which are not imported/included in the specification. You need to import those explictly by hand. See t/20sample.t

TypeDeclarations are part of the interpretation of the messages which are exchanged between the Applications, and therefore not interpreted by this module.

METHODS ^

Constructors

$obj->from(XMLDATA, OPTIONS)
BPM::XPDL->from(XMLDATA, OPTIONS)

Read an XML message, in any format supported by XML::Compile method dataToXML(): string, file, filehandle, and more. Returned is a list of two: the type of the top-level element plus the data-structure.

When called as instance method, the data will automatically get converted to the version of required by the object. When called as class method, the version of the top-level element will determine the returned version automatically (which may give unpredictable versions as result).

When the method is called as class method, then a temporary instance is created. Creating an instance is (very) slow.

example:

  my $xpdl          = BPM::XPDL->new(version => '2.1');
  my ($type, $data) = $xpdl->from('data.xml');

or

  my ($type, $data) = BPM::XPDL->from('data.xml');
BPM::XPDL->new(OPTIONS)
 -Option            --Defined in          --Default
  allow_undeclared    XML::Compile::Cache   <false>
  any_element         XML::Compile::Cache   'SKIP_ALL'
  block_namespace     XML::Compile::Schema  []
  hook                XML::Compile::Schema  undef
  hooks               XML::Compile::Schema  []
  ignore_unused_tags  XML::Compile::Schema  <false>
  key_rewrite         XML::Compile::Schema  []
  opts_readers        XML::Compile::Cache   []
  opts_rw             XML::Compile::Cache   []
  opts_writers        XML::Compile::Cache   []
  parser_options      XML::Compile          <many>
  prefix_keys                               <true>
  prefixes            XML::Compile::Cache   <smart>
  schema_dirs         XML::Compile          undef
  typemap             XML::Compile::Cache   {}
  xsi_type            XML::Compile::Cache   {}
allow_undeclared => BOOLEAN
any_element => CODE|'TAKE_ALL'|'SKIP_ALL'|'ATTEMPT'|'SLOPPY'
block_namespace => NAMESPACE|TYPE|HASH|CODE|ARRAY
hook => ARRAY-WITH-HOOKDATA | HOOK
hooks => ARRAY-OF-HOOK
ignore_unused_tags => BOOLEAN|REGEXP
key_rewrite => HASH|CODE|ARRAY-of-HASH-and-CODE
opts_readers => HASH|ARRAY-of-PAIRS
opts_rw => HASH|ARRAY-of-PAIRS
opts_writers => HASH|ARRAY-of-PAIRS
parser_options => HASH|ARRAY
prefix_keys => BOOLEAN

Enables the visibility of the various XPDL namespaces which can be merged within one document.

prefixes => HASH|ARRAY-of-PAIRS
schema_dirs => DIRECTORY|ARRAY-OF-DIRECTORIES
typemap => HASH|ARRAY
xsi_type => HASH|ARRAY

Accessors

$obj->addCompileOptions(['READERS'|'WRITERS'|'RW'], OPTIONS)

See "Accessors" in XML::Compile::Cache

$obj->addHook(HOOKDATA|HOOK|undef)

See "Accessors" in XML::Compile::Schema

$obj->addHooks(HOOK, [HOOK, ...])

See "Accessors" in XML::Compile::Schema

$obj->addKeyRewrite(PREDEF|CODE|HASH, ...)

See "Accessors" in XML::Compile::Schema

$obj->addSchemaDirs(DIRECTORIES|FILENAME)
BPM::XPDL->addSchemaDirs(DIRECTORIES|FILENAME)

See "Accessors" in XML::Compile

$obj->addSchemas(XML, OPTIONS)

See "Accessors" in XML::Compile::Schema

$obj->addTypemap(PAIR)

See "Accessors" in XML::Compile::Schema

$obj->addTypemaps(PAIRS)

See "Accessors" in XML::Compile::Schema

$obj->allowUndeclared([BOOLEAN])

See "Accessors" in XML::Compile::Cache

$obj->anyElement('ATTEMPT'|'SLOPPY'|'SKIP_ALL'|'TAKE_ALL'|CODE)

See "Accessors" in XML::Compile::Cache

$obj->blockNamespace(NAMESPACE|TYPE|HASH|CODE|ARRAY)

See "Accessors" in XML::Compile::Schema

$obj->hooks()

See "Accessors" in XML::Compile::Schema

$obj->namespace()
$obj->prefix(PREFIX)

See "Accessors" in XML::Compile::Cache

$obj->prefixFor(URI)

See "Accessors" in XML::Compile::Cache

$obj->prefixed(TYPE)

See "Accessors" in XML::Compile::Cache

$obj->prefixes([PAIRS|ARRAY|HASH])

See "Accessors" in XML::Compile::Cache

$obj->typemap([HASH|ARRAY|PAIRS])

See "Accessors" in XML::Compile::Cache

$obj->useSchema(SCHEMA, [SCHEMA])

See "Accessors" in XML::Compile::Schema

$obj->version()
$obj->xsiType([HASH|ARRAY|LIST])

See "Accessors" in XML::Compile::Cache

Compilers

$obj->compile(('READER'|'WRITER'), TYPE, OPTIONS)

See "Compilers" in XML::Compile::Schema

$obj->compileAll(['READERS'|'WRITERS'|'RW', [NAMESPACE]])

See "Compilers" in XML::Compile::Cache

$obj->dataToXML(NODE|REF-XML-STRING|XML-STRING|FILENAME|FILEHANDLE|KNOWN)
BPM::XPDL->dataToXML(NODE|REF-XML-STRING|XML-STRING|FILENAME|FILEHANDLE|KNOWN)

See "Compilers" in XML::Compile

$obj->initParser(OPTIONS)
BPM::XPDL->initParser(OPTIONS)

See "Compilers" in XML::Compile

$obj->reader(TYPE|NAME, OPTIONS)

See "Compilers" in XML::Compile::Cache

$obj->template('XML'|'PERL'|'TREE', ELEMENT, OPTIONS)

See "Compilers" in XML::Compile::Schema

$obj->writer(TYPE|NAME)

See "Compilers" in XML::Compile::Cache

Administration

$obj->declare('READER'|'WRITER'|'RW', TYPE|ARRAY-of-TYPES, OPTIONS)

See "Administration" in XML::Compile::Cache

$obj->doesExtend(EXTTYPE, BASETYPE)

See "Administration" in XML::Compile::Schema

$obj->elements()

See "Administration" in XML::Compile::Schema

$obj->findName(NAME)

See "Administration" in XML::Compile::Cache

$obj->findSchemaFile(FILENAME)
BPM::XPDL->findSchemaFile(FILENAME)

See "Administration" in XML::Compile

$obj->importDefinitions(XMLDATA, OPTIONS)

See "Administration" in XML::Compile::Schema

$obj->knownNamespace(NAMESPACE|PAIRS)
BPM::XPDL->knownNamespace(NAMESPACE|PAIRS)

See "Administration" in XML::Compile

$obj->namespaces()

See "Administration" in XML::Compile::Schema

$obj->printIndex([FILEHANDLE], OPTIONS)

See "Administration" in XML::Compile::Cache

$obj->types()

See "Administration" in XML::Compile::Schema

$obj->walkTree(NODE, CODE)

See "Administration" in XML::Compile

Other

$obj->create(DATA)

Pass a correctly constructed Perl data-structure, which maps to a xpdl:Package type, and it will produce XML for it (returns an XML::LibXML::Document object).

Be warned that the output may contain deprecated constructs. Accidentally, the non-deprecated versions usually match better on the provided data.

  my $xml = $xpdl->create($data);
  print $xml->toString(1);

SEE ALSO ^

This module is part of BPM-XPDL distribution version 0.90, built on December 04, 2012. Website: http://perl.overmeer.net

ACKNOWLEDGEMENTS ^

Interapy http://www.interapy.nl sponsored the development of this software.

LICENSE AND COPYRIGHT ^

Copyright (c) 2009-2012 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html

syntax highlighting: