This will need a little bit of working thru' but how about something like this as a starting point:
sub workflow { get workflow step from button or link selected. if (not step1) { %existing_detail = get stored details identified by unique session id of user %existing_detail .= new details $self->store(\%existing_detail) } my $page = $self->draw_page(page => workflowstep, params =>\%existing_detail); return $page } sub draw_page { my $wrkflwObj = Workflow->new(step=>$step, param=>\%existing_details +); return $wrkflwObj->output; #return the html }

So, the logic of your workflow's belong in your templates. You get to aggreate all the information the user supplies, and know which step the user wants to go to next. If the user wants to add a product, and the contact doesnt exist, you can take them to a step in the contact workflow, then return them to back to where they need to go.

Flexible, as you can extend the workflow in arbitrary ways.

draw_page could potentially call a library with the method being the step in the workflow, the library would then know exactly what information is needed then return back the html page.

Not really a down side, but you'd have to be careful how you manage the expiry of each set of \%existing_detail, ie if someone doesnt click the cancel button and walks away, then comes back a day later - should their day-old data be restored?

Potential downside, you'll have to be carefull how you manage multiple incomplete "actions" per user, ie if they are 1/2 way thru' the add product action and they want to go to the modify product workflow, what do you do?


In reply to Re: (OT) Work flow in Web based applications by Ryszard
in thread (OT) Work flow in Web based applications by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.