NAME

WebService::WebSequenceDiagrams - Simple API for WebSequenceDiagrams

SYNOPSIS

  use WebService::WebSequenceDiagrams;

DESCRIPTION

WebService::WebSequenceDiagrams is an API for WebSequecenDiagrams.

see detail => http://www.websequencediagrams.com/

METHODS

new([%args])
  my %args = (
          style     => [ 'default' | 'rose' | 'qsd' | 'napkin' | 'mscgen' | 
                    'omegapple' | 'modern-blue' | 'earth' | 'roundgreen' ],      # default is 'default'
          paginate  => [ 0 | 1 ],                                                # default is 1 
          paper     => [ 'letter' | 'a4' | '11x17' ],                            # default is 'letter'
          landscape => [ 0 | 1 ],                                                # default is 1
          format    => [ 'png' | 'pdf' ]                                         # default is 'png'
  );

  my $wsd = WebService::WebSequenceDiagrams->new(%args);
draw(%message, %outfile, [%args])
  my %args = (
          style     => [ 'default' | 'rose' | 'qsd' | 'napkin' | 'mscgen' | 
                    'omegapple' | 'modern-blue' | 'earth' | 'roundgreen' ],      # default is 'default'
          paginate  => [ 0 | 1 ],                                                # default is 1 
          paper     => [ 'letter' | 'a4' | '11x17' ],                            # default is 'letter'
          landscape => [ 0 | 1 ],                                                # default is 1
          format    => [ 'png' | 'pdf' ]                                         # default is 'png'
  );

  my $wsd->draw(
          message => $message,
          outfile => "/path/to/save",           
      %args,
  );

message methods

These methods create message text programmably.

see detail => http://www.websequencediagrams.com/examples.html

signal(%args)
  $wsd->signal(
          from => 'Alice',
          to   => 'Bob',
          text => 'Authentication Request',
          line => 'solid' | 'broken',   # default is 'solid'
  );
signal_to_self(%args)
  $wsd->signal_to_self(
          itself  => 'Alice',
          text    => 'This is a signal to self.\nIt also demonstrates \nmultiline \ntext.',
          line    => 'solid' | 'broken',   # default is "solid"
  );
participant(%args)
  $wsd->participant(
      name => 'Alice',
          as   => 'A',  # optionally
  );
alt(%args)
  $wsd->alt(
      text => 'successful case',
  );
else(%args)
  $wsd->else(
      text => 'successful case',
  );
opt(%args)
  $wsd->opt(
      text => 'opt',
  );
loop(%args)
  $wsd->loop(
      text => '1000 times',
  );
end()
note(%args)
  $wsd->note(
          position => 'left_of' | 'right_of' | 'over',
          name     => 'Alice' | ['Alice', 'Bob'],
          text     => 'This is displayed left of Alice',        
  );
activate($name)
deactivate($name)
destroy($name)

AUTHOR

Takeshi Miki <miki@cpan.org>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO