{ "info": { "author": "Anshit, Vishal", "author_email": "anshit.agarwal@hashedin.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# **Welcome to hi-workflow!**\r\n\r\nWelcome to hiworkflow. The Django app aims to help you create powerful, fluid and dynamic workflows for your need. Let's get started with the installation.\r\n\r\n## **Installation**\r\n\r\nIntegrating hiworkflow to your project is easier than ever. Just use the pip command to get it running.\r\n\r\n``` \r\npip install hiworkflow\r\n```\r\n\r\nTo add hiworkflow to your Django project, just add one line to the settings.py file.\r\n```\r\n INSTALLED_APPS=[ \r\n ....\r\n ....\r\n ....,\r\n 'workflowapp',] \r\n```\r\nAlso add this statement to settings.py. It will help include the library's static folder to your project.\r\n```\r\nSTATICFILES_DIRS = [os.path.join(BASE_DIR,\"static\")]\r\n```\r\nIn the same file settings.py, edit the TEMPLATE variable and add the following to the DIR'S. This will add the templates.\r\n```\r\n'DIRS': ['templates']\r\n```\r\nFinally, add an import statement to every file where you plan to use the hiworkflow.\r\n\r\nTo finalize the installation and include the required Database tables, use the following commands.\r\n```\r\npython manage.py makemigrations workflowapp\r\npython manage.py migrate\r\n\r\n```\r\nAdd these to every file where you need to use the functions.\r\n```\r\n\r\nfrom workflowapp.createflow import BuildWorkflow, BuildTask\r\n```\r\nCongratulations, You are ready to use hi-workflow.\r\n\r\n## **Defining a new Workflow**\r\n\r\n\r\n### **Create workflow**\r\nA new workflow can either be created using\r\n```\r\nnew_workflow = BuildWorkflow(\"Timesheet Workflow\")\r\n```\r\nor,\r\n```\r\nnew_workflow = BuildWorkflow.create_workflow(\"Timesheet Workflow\")\r\n```\r\n\r\n### **Add States**\r\nTo add states to the workflow,\r\n```\r\n.add_states([\"new\", \"submitted\", \"pending_approval\", \"approved\", \"rejected\", \"done\"])\r\n```\r\nThe add_states function takes a list as a parameter. Any number of states can be added at once. Moreover the function can be called again at any point to add more states. The only constraint is that we need the object of the workflow in which we need to add the states.\r\n\r\n### **Type of States**\r\nEach state is categorized into two types\r\n\r\n* Automated\r\n* Manual\r\n \r\nEvery state is defined as Manual by default. To make a state automated, we need to write this piece of code.\r\n```\r\n.make_automated_state([\"new\",\"submitted\",\"pending_approval\",\"approved\"]) \r\n```\r\n\r\nAutomated states transition automatically to the next state, if all the given conditions return true.\r\n\r\n### **Add Transitions**\r\nTo add a transition from one state to another, we need to send 3 parameters- (from_state, event_name, to_state). An object of workflow is required to run this command. On successful execution, it will create a link between the states.\r\n```\r\n.add_transition(\"submitted\", \"Apply for Approval\", \"pending_approval\")\r\n```\r\nAn optional parameter, a function name, can be a added which will ensure that the transition will only be successful if the function returned true.\r\n\r\n```\r\n.add_transition(\"submitted\", \"Apply for Approval\", \"pending_approval\",check_timesheet_not_empty)\r\n```\r\nIn the above example check_timesheet_not_empty() is a function which returns boolean value. If the returned value is true, the state changes from submitted to pending_approval\r\n\r\n### **Add Self Triggered Functions**\r\nYou can add your own set of functions that must be triggered as soon as a certain state is reached.\r\n```\r\n.add_trigger('new' , test_another_callback)\r\n```\r\nOn reaching the 'new' state for any task, test_another_callback() is automatically invoked.\r\n\r\n### **Define Start State and End State**\r\nTo define a start state and end state for the workflow, use the following syntax. Note: A workflow can have only one start state. It might have multiple end states depending on the requirements.\r\n```\r\n.set_start_state(\"new\")\r\n.set_end_state(\"approved\")\r\n.set_end_state(\"rejected\")\r\n```\r\n\r\n### **Graphical Representation of Workflow**\r\nTo visualize a workflow, write the following code in views.\r\n\r\n```\r\ndef visualize(request):\r\n return visualize_workflow( )\r\n\r\n```\r\n### **Get All Workflow Names**\r\nCall the following function to receive a list containing the names of all workflows in the database.\r\n\r\n```\r\nlist_all_workflows()\r\n```\r\n\r\n\r\n## **Defining a new Task**\r\n\r\n### **Create Task**\r\nTo create a new task use the following syntax\r\n```\r\ntimesheet1 = BuildTask(approval_workflow, request.user, \"Employee1\")\r\n```\r\nThis syntax will create a task named \"Employee1\" which will use the schema of approval_workflow. The object timeshee1 will be used to refer to Employee1.\r\n\r\n### **Initialize a task**\r\nTo initialize a task to it's start state, use the following syntax.\r\n```\r\ntimesheet1 = timesheet1.start()\r\n``` \r\n### **To fetch details about the current state of a task**\r\nThe function is called using the object of BuildTask and returns the name of current state in a string.\r\n```\r\ntimesheet1.get_current_state()\r\n```\r\n\r\n### **To fetch names of the possible states from current state**\r\nThe function is called using the object of BuildTask and returns a list of possible states\r\n```\r\ntimesheet1.get_possible_actions()\r\n```\r\n\r\n### **Fetch a List of all Open Tasks**\r\nCall the following function to receive a list containing the names of all tasks with is_active=True .\r\n\r\n```\r\n.get_open_task_list()\r\n```\r\n\r\n### **Fetch a List of all Closed Tasks**\r\nCall the following function to receive a list containing the names of all tasks with is_active=False .\r\n\r\n```\r\n.get_closed_task_list()\r\n```\r\n\r\n## **Miscellaneous Functions to help development**\r\n\r\n### **List all tasks assigned to a user**\r\nThe function is a global function and requires no object to be called. A parameter user_object is required. To send the currently logged in user's object, developers can use *request.user* . The function will return a list of strings.\r\n```\r\nget_assigned_tasks(user_object)\r\n```\r\n### **List all tasks assigned by a user**\r\nThe function is a global function and requires no object to be called. A parameter user_object is required. To send the currently logged in user's object, developers can use *request.user* . The function will return a list of strings.\r\n```\r\ntasks_assigned_by(user_object)\r\n```\r\n### **List all tasks created by a user**\r\nThe function is a global function and requires no object to be called. A parameter user_object is required. To send the currently logged in user's object, developers can use *request.user* . The function will return a list of strings.\r\n\r\n```\r\nuser_tasks(user_object)\r\n```\r\n\r\n## Thank You for using hiworkflow.\r\n\r\n### Developed By: Anshit Agarwal, Vishal Sharma\r\n### At: HashedIn Technologies", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.hashedin.com/", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "hiworkflow", "package_url": "https://pypi.org/project/hiworkflow/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/hiworkflow/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.hashedin.com/" }, "release_url": "https://pypi.org/project/hiworkflow/3.0/", "requires_dist": null, "requires_python": null, "summary": "A Django app to build and use custom Workflows.", "version": "3.0" }, "last_serial": 2044165, "releases": { "0.0.1": [], "1.0": [], "1.1": [ { "comment_text": "", "digests": { "md5": "737124aa62d737b4ba044bed7cdec6b5", "sha256": "f14daa14727190342216954f4da01a56edc0876003e8acabd3d7d7d627804aa8" }, "downloads": -1, "filename": "hiworkflow-1.1.tar.gz", "has_sig": false, "md5_digest": "737124aa62d737b4ba044bed7cdec6b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 184835, "upload_time": "2016-03-15T14:38:58", "url": "https://files.pythonhosted.org/packages/d1/bf/e20662c72dff66e4b1a4aba545efa69a835202985ec214a473f990149987/hiworkflow-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "9e731c6314c52938ab6b7d47e15872fa", "sha256": "3511a96a632b02e563293c0b920a2c37b9dcd65ba40b1f26196da5911f5a5e15" }, "downloads": -1, "filename": "hiworkflow-1.2.tar.gz", "has_sig": false, "md5_digest": "9e731c6314c52938ab6b7d47e15872fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 184860, "upload_time": "2016-03-15T14:57:09", "url": "https://files.pythonhosted.org/packages/47/e3/6de4e8ebf6ceece3d01ddcd9e804b93fb93a87aa21efb72a140dce2f9fcf/hiworkflow-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "520501a1544be78d1447f848d78ca70e", "sha256": "f39a4fa49a9876c3e8beacf907375c518d2700625d393d8957a521547eef65ae" }, "downloads": -1, "filename": "hiworkflow-1.3.tar.gz", "has_sig": false, "md5_digest": "520501a1544be78d1447f848d78ca70e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 185297, "upload_time": "2016-03-15T15:19:32", "url": "https://files.pythonhosted.org/packages/5c/c4/3306c631a22fa39b615642a399b27a70373a3e6274e544b8ec8fa58590ce/hiworkflow-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "0ff9195098e854fb6d22677f82de515d", "sha256": "365cd32a96e81121e7df71cf019193aaba853d5a1d129e03ffa0dfb2708add60" }, "downloads": -1, "filename": "hiworkflow-1.4.tar.gz", "has_sig": false, "md5_digest": "0ff9195098e854fb6d22677f82de515d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 185292, "upload_time": "2016-03-15T15:23:32", "url": "https://files.pythonhosted.org/packages/bc/cc/47627c1ee5baa9dcdbb7d075306710d3fb6dc87a04bbe25029d66c6936ae/hiworkflow-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "513ea7b00f36ab76290547d55945320e", "sha256": "eb881ad55362ae9cff19055b36bae21b5d21b6286e11d0db28fb4d788d452eac" }, "downloads": -1, "filename": "hiworkflow-1.5.tar.gz", "has_sig": false, "md5_digest": "513ea7b00f36ab76290547d55945320e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 189699, "upload_time": "2016-03-16T07:29:45", "url": "https://files.pythonhosted.org/packages/d3/0b/4efcbb09648b4e30c65430c7b23087d497412dd3e32dc28a68419e03cf01/hiworkflow-1.5.tar.gz" } ], "1.6": [ { "comment_text": "", "digests": { "md5": "20bb301faad5dae1eb757130a08229ba", "sha256": "c5433deb65fcb89bab45c8aaa96f6479d3bef913e09c73130e47033f6f6b2685" }, "downloads": -1, "filename": "hiworkflow-1.6.tar.gz", "has_sig": false, "md5_digest": "20bb301faad5dae1eb757130a08229ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190304, "upload_time": "2016-03-16T09:23:34", "url": "https://files.pythonhosted.org/packages/9f/86/e53652db40753c16e7f22c1d9392fa9da2e99653681d7f52c87b81e16c19/hiworkflow-1.6.tar.gz" } ], "1.7": [ { "comment_text": "", "digests": { "md5": "bde608f364490fea7e0a53270fbd6da8", "sha256": "0d798828f422cfacd25dbdb997f4ff05872dd9f863aabbc0c8adc591a0bdb15c" }, "downloads": -1, "filename": "hiworkflow-1.7.tar.gz", "has_sig": false, "md5_digest": "bde608f364490fea7e0a53270fbd6da8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190312, "upload_time": "2016-03-16T10:01:18", "url": "https://files.pythonhosted.org/packages/fe/ec/ab9e94c52fa114e5720388c3c442c7b96642668b5a2d0ed7f6fb5e472256/hiworkflow-1.7.tar.gz" } ], "1.8": [ { "comment_text": "", "digests": { "md5": "8e45ba22dca42837af98c213ed71ee69", "sha256": "208a8ee73d765a82c2cd71ee34a96f8549acd36bf8918cf72d5db5c9426f186f" }, "downloads": -1, "filename": "hiworkflow-1.8.tar.gz", "has_sig": false, "md5_digest": "8e45ba22dca42837af98c213ed71ee69", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190400, "upload_time": "2016-03-16T10:55:26", "url": "https://files.pythonhosted.org/packages/bf/2f/a83ffdda064d023cfbafa86d9007c5d0acd3fc231fa95d382592adc74be1/hiworkflow-1.8.tar.gz" } ], "1.9": [ { "comment_text": "", "digests": { "md5": "e2e0f86efe76423bf02802dc2b85d5b4", "sha256": "c9b6c0aa6d0ef4ba3d1ca5c987ed9cbde30727b581e5003ef72ad63f384fc9d0" }, "downloads": -1, "filename": "hiworkflow-1.9.tar.gz", "has_sig": false, "md5_digest": "e2e0f86efe76423bf02802dc2b85d5b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190744, "upload_time": "2016-03-16T14:55:26", "url": "https://files.pythonhosted.org/packages/ae/cb/2c037828965becd39543de9030b2b037c640cf5f31975f43c7229b3d25ec/hiworkflow-1.9.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "5ac740ed6ad8fa4c88b2f01a12f80c85", "sha256": "3cc9e05eb19515fa01628dc899847b3ef9b7d9f51d2bad47641a321611fd6a3c" }, "downloads": -1, "filename": "hiworkflow-2.0.tar.gz", "has_sig": false, "md5_digest": "5ac740ed6ad8fa4c88b2f01a12f80c85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 190748, "upload_time": "2016-03-17T06:54:37", "url": "https://files.pythonhosted.org/packages/69/ed/c300cab28fc2eb5e71fada8621d4fa38a3c1c66ba3c427c084d0af9c64bb/hiworkflow-2.0.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "53cda788305b2d7e1011ed8f03115e98", "sha256": "f93c4a7a3e8e4aa0d55e4a4029a9380c900904a5eb80f7da5883c97efb68166e" }, "downloads": -1, "filename": "hiworkflow-2.1.tar.gz", "has_sig": false, "md5_digest": "53cda788305b2d7e1011ed8f03115e98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 186318, "upload_time": "2016-03-17T07:50:32", "url": "https://files.pythonhosted.org/packages/23/6f/665682bf5f1ccce4985b41ac472e6bee77326282ea33ddf5292ed326f4bf/hiworkflow-2.1.tar.gz" } ], "2.2": [ { "comment_text": "", "digests": { "md5": "78aa0105f3b20494c4beb1fe5e30a84f", "sha256": "abfe6d6ac6afd3e7bb67fa941ced086be824a553bfb95e1d352b19526643d639" }, "downloads": -1, "filename": "hiworkflow-2.2.tar.gz", "has_sig": false, "md5_digest": "78aa0105f3b20494c4beb1fe5e30a84f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191081, "upload_time": "2016-03-17T10:37:44", "url": "https://files.pythonhosted.org/packages/c5/d5/aff034e81201b6f8570c78a91d7f4ca0e6b26de8ce0cc46c40af494eab1f/hiworkflow-2.2.tar.gz" } ], "2.3": [ { "comment_text": "", "digests": { "md5": "05c4512f221e71c7ce76e7633902ea73", "sha256": "0446fe627aa5639335e0fbbee8a29799ceea61a46401c3dae06c77e2f712e485" }, "downloads": -1, "filename": "hiworkflow-2.3.tar.gz", "has_sig": false, "md5_digest": "05c4512f221e71c7ce76e7633902ea73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191087, "upload_time": "2016-03-17T10:41:13", "url": "https://files.pythonhosted.org/packages/12/75/6e2dd1714f5f1d08d4a09d22b01ad62ba0426742eb46239f42723bf1b71b/hiworkflow-2.3.tar.gz" } ], "2.4": [ { "comment_text": "", "digests": { "md5": "482c911df31d3ae1c147bfc73bac91ca", "sha256": "0a36666c9f7437b8fa98437290439f322b77e5e6bec1798062dfc93120945b28" }, "downloads": -1, "filename": "hiworkflow-2.4.tar.gz", "has_sig": false, "md5_digest": "482c911df31d3ae1c147bfc73bac91ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191089, "upload_time": "2016-03-17T10:56:24", "url": "https://files.pythonhosted.org/packages/8b/dd/1b63adb920f2cab7cf5541ff5d258ea43ee920ee6af1456977a6b286545d/hiworkflow-2.4.tar.gz" } ], "2.5": [], "2.6": [ { "comment_text": "", "digests": { "md5": "8910cab166f86f3c0837144302964f69", "sha256": "594215cab6e9136fa1d0eaddef8613b4efaf439c2b5f0ea29f65828e5f1630b1" }, "downloads": -1, "filename": "hiworkflow-2.6-py2-none-any.whl", "has_sig": false, "md5_digest": "8910cab166f86f3c0837144302964f69", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 206289, "upload_time": "2016-03-17T11:05:04", "url": "https://files.pythonhosted.org/packages/f5/9b/fcc522c154feac151e68702bb912d3b2028647e83e443a972fd736c2de04/hiworkflow-2.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d93ebcfdadeb058015c1bb941b25aa1e", "sha256": "c29d9350aabd8a8c739841a5cde91832a71e11f3f20a3862267fa4cb5dedd91e" }, "downloads": -1, "filename": "hiworkflow-2.6.tar.gz", "has_sig": false, "md5_digest": "d93ebcfdadeb058015c1bb941b25aa1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191092, "upload_time": "2016-03-17T11:02:37", "url": "https://files.pythonhosted.org/packages/aa/89/cc5d725dc18e71234276c6380b8fde44bf2a74ac36575864770c1789b870/hiworkflow-2.6.tar.gz" } ], "2.7": [ { "comment_text": "", "digests": { "md5": "d3b86fdb9088f31e3b854ae73229a957", "sha256": "2c6e4ada6cb73c01a32aeba7653108ce8b6ecf6f6ce048b2c2815ed8f2cbaa19" }, "downloads": -1, "filename": "hiworkflow-2.7.tar.gz", "has_sig": false, "md5_digest": "d3b86fdb9088f31e3b854ae73229a957", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191095, "upload_time": "2016-03-17T11:05:42", "url": "https://files.pythonhosted.org/packages/c4/ba/d5d62f43c348f36d48fb7070d1c6b7323f2cef8c4b48b983f4b51dcc47a8/hiworkflow-2.7.tar.gz" } ], "2.8": [ { "comment_text": "", "digests": { "md5": "56c8139eff52746db972355a8f91b17d", "sha256": "58a82b2ee60da36990052b365283c7a7fb77a9b0a4badacd0f9c2d6df49fcd72" }, "downloads": -1, "filename": "hiworkflow-2.8.tar.gz", "has_sig": false, "md5_digest": "56c8139eff52746db972355a8f91b17d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191105, "upload_time": "2016-03-17T13:10:05", "url": "https://files.pythonhosted.org/packages/cf/e9/2b0421e4777ff5f8854ecac8bb588019f37b2b49f7849837bf953cb70784/hiworkflow-2.8.tar.gz" } ], "2.9": [ { "comment_text": "", "digests": { "md5": "c1abb59af863865f47c090afe7056ff9", "sha256": "89ba2aa595f31388259258448d1761a57efb4fa563e9a94ff9b75dc4eea3f7f9" }, "downloads": -1, "filename": "hiworkflow-2.9.tar.gz", "has_sig": false, "md5_digest": "c1abb59af863865f47c090afe7056ff9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191105, "upload_time": "2016-03-17T13:43:11", "url": "https://files.pythonhosted.org/packages/bb/62/b1e1029fa8919e4f34f265adceb8fc5b4e65263eef27bd5b5db62b445300/hiworkflow-2.9.tar.gz" } ], "3.0": [ { "comment_text": "", "digests": { "md5": "56d699bd68e2b6df1b5de3566997b841", "sha256": "39431fd76f651be2e5ca86cfb387ab497b12b0751f8d5857c6fb1176258aefee" }, "downloads": -1, "filename": "hiworkflow-3.0.tar.gz", "has_sig": false, "md5_digest": "56d699bd68e2b6df1b5de3566997b841", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191378, "upload_time": "2016-03-17T13:51:35", "url": "https://files.pythonhosted.org/packages/12/c5/6e413bf37128b6d43968afa634bf870e55034b6c609024eba4835c9d0c52/hiworkflow-3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "56d699bd68e2b6df1b5de3566997b841", "sha256": "39431fd76f651be2e5ca86cfb387ab497b12b0751f8d5857c6fb1176258aefee" }, "downloads": -1, "filename": "hiworkflow-3.0.tar.gz", "has_sig": false, "md5_digest": "56d699bd68e2b6df1b5de3566997b841", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191378, "upload_time": "2016-03-17T13:51:35", "url": "https://files.pythonhosted.org/packages/12/c5/6e413bf37128b6d43968afa634bf870e55034b6c609024eba4835c9d0c52/hiworkflow-3.0.tar.gz" } ] }