Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: handling tasks and customizing flow of tasks using perl

by asham (Novice)
on Sep 29, 2013 at 18:28 UTC ( [id://1056252]=note: print w/replies, xml ) Need Help??


in reply to Re: handling tasks and customizing flow of tasks using perl
in thread handling tasks and customizing flow of tasks using perl

Hi Laurent, Thanks a lot for looking into this.

Yes true xml are not used for such code mix but it would be kind of configuration file only right? as it holds details related to tasks. exampple: should a task be executed or not and if yes than with what configuration parameters. The only extra thing I was thinking of adding was the pre/post tasks which may vary for some users. (also idea of this post is to come up with some good design to handle the use case.)

Regarding the building graph/hash suggested by you, I had considered that but I was not convinced with the idea because doing that means I am kind of fixing the flow of tasks. Any changes in future require update of code rather than just a tiny update in xml/properties file which can be even exposed to user. (i generally prefer xml/properties file compared to such code updates because of more flexibility and ease of use. As end user may not know the code and can just update the xml file to change/control the flow.)

Just to let you know that mixing xml/perl is not the best design and that's why I am looking for inputs here. I wanted to check if people were using it or apis are for this. (note: jsp/jsf mix html and java. so thought something on those lines.)

Regarding paths: 1) A->B->C->D 2) A->C->D 3) A->B->C 4) A->D

These are just for example, you can check the xml file shared in my first post. note its rough design and any such redundancies will be handled when we actually finalize an approach.

regarding the details requested by you. I am updating original question with a real life example. Please check, hope it helps in understanding the case more.

  • Comment on Re^2: handling tasks and customizing flow of tasks using perl

Replies are listed 'Best First'.
Re^3: handling tasks and customizing flow of tasks using perl
by Laurent_R (Canon) on Sep 29, 2013 at 22:33 UTC

    Hmm,

    there are many aspects to be taken into account.

    I was writing last week a program template aimed at some other IT persons. The idea was to give them the (quite complicated and thoroughly tested) algorithm, and let them construct the input data, which could be summarized as follows:

    ('table1' => { 'index_fields' => [0, 1, 2], 'ignored_fields' => [6]}, 'table2' => { 'index_fields' => [2], 'ignored_fields' => [4, 7]}, )

    It is not too complicated to give IT persons instructions on how to fill the next records in this structure to achieve the desired result.

    But if your user has no IT background, this might not be workable.

    I still don't think that asking them to fill an XML structure is the right idea. Asking your users to write a config file such as:

    1. A -> B -> D

    is clearer for your user (so long as you explained the details) and actually easier for you to parse.

      Hi Laurent, My apologies for the late reply. Have been busy with work.

      Thanks for your reply.Regarding your reply,yes true asking users to write config file is easy. but I guess we are again missing the point.

      Idea is to come up with some design which allows customization of code and still allows to control basic flow of tasks. Till now the suggestions cover following: 1) vsespb's suggestion, covered use of known customizations. 2) your suggestion, covers control of flow and tasks.

      Also I gave it another thought and wondered if providing a template to even an inexperienced user something like following should be kind of easy to understand right?

      <xmlFile> <action name="A" execute="true" /> <action name="B" execute="true" /> </xmlFile>

      I understand its xml file. But normal user simply need to switch true to false to control flow or change order of elements (example: putting B before A) to change flow while experienced user can make use of customization tasks available. The only thing tempting me to use xml is the schema file/validations/child elements/structure offered by it which can help me mix complex and simple tasks at the same place.

      Anyway will wait a bit more for inputs before I go with any implementation.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1056252]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found