About ofbiz-workFlow

The specific operation steps of
OFBIZ technical problems encountered all the time are the resources of google online. Recently, the workflow process in ofbiz needs to be used in the project. The first feeling is to google first, it may be that ofbiz is in China The resources are relatively scarce, most of the resources I found are not what I want, there is no way! It seems that I can only rely on myself~ After two days of hard work over the weekend, I finally got some eyebrows! I will share it with you now. If there are any problems, you are welcome to criticize and correct!

Without further ado, it can be divided into the following 6 steps, as follows:

1. Because you configure the workflow process yourself, the first step is to log in to the system with the admin account, and create several new user accounts for tasks to be assigned, such as "Zhang Zhang" "Three", "Li Si", "Wang Wu", and assign MyPortlet's admin authority to be assigned, then enter the work plan -> manual service menu -> create a manual service, you will enter a form for adding manual services, name* , Type*, Status* are required, the name can be filled in: "Workflow - Adjust Inventory", the Type is the drop-down box, select "Workflow Process" at the bottom; the status is also a drop-down, you need to pay attention to this place, my The version of ofbiz is 10.04. I don’t know if it is a problem with the template itself. There is no “[task] created” in the status, but I follow a task assigned by default: task1 to process, the initial state of task1 is [task] ] has been created, the status code is: PTS_CREATED, so we can only change the template file, enter the file ofbiz/applications/workeffort/widget/WorkEffortForms.xml, find <field name="currentStatusId" title="$ {uiLabelMap.CommonStatus}*" position="1"> This label is changed to:

copy code
<field name="currentStatusId" title="${uiLabelMap.CommonStatus}*" position="1">
            <drop-down>
                <entity-options entity-name="StatusItem" key-field-name="statusId" description="[${uiLabelMap.WorkEffortGeneral}] ${description}">
                    <entity-constraint name="statusTypeId" value="CALENDAR_STATUS"/>
                    <entity-order-by field-name="description"/>
                </entity-options>
                <entity-options entity-name="StatusItem" key-field-name="statusId" description="[${uiLabelMap.WorkEffortTask}] ${description}">
                    <entity-constraint name="statusTypeId" value="TASK_STATUS"/>
                    <entity-order-by field-name="description"/>
                </entity-options>
                <entity-options entity-name="StatusItem" key-field-name="statusId" description="[${uiLabelMap.WorkEffortTask}] ${description}">
                    <entity-constraint name="statusId" value="PTS_CREATED"/>
                </entity-options>
                <entity-options entity-name="StatusItem" key-field-name="statusId" description="[${uiLabelMap.WorkEffortEvent}] ${description}">
                    <entity-constraint name="statusTypeId" value="EVENT_STATUS"/>
                    <entity-order-by field-name="description"/>
                </entity-options> Copy Code         </field>
            </drop-down>


Then refresh the page, the above status "[task] has been created" will be added in the status drop-down, select this status! Select the current system time for the expected start date and the actual start date; finally, click Save.

2. After clicking Save, the page will jump to "Edit Human Services - Workflow - Adjust Inventory", then click the tab "Subordinate Fixed Assets" on the upper part of the page (there is a problem with the name of this option, it is estimated that it is a translation problem), Then click "Create next-level human service", use the workflow process created above - workflow - adjust inventory as the parent, and create a sub-level task, (note that the task is created here! The first step is to create a workflow Process!), select the value of "Label Service Association Type Identifier" as "Dependent", "Or enter the manual service details below" and enter the name of the subtask in the name* below, for example: "Workflow—Adjust Inventory—Subtask 1 ", Type* select "Task" in the drop-down, Status* or "[Task] Created", Estimated Start Date and Actual Start Date select the current time, and click "Save". At this point, a subtask under the workflow has been created.

3. At this point, the page will jump to "Edit Human Services - Workflow - Adjust Inventory - Subtask 1". In order to save time, we can directly assign the subtask created in the second step to an existing user. For example, "Zhang San", of course, "Zhang San" students need to have the admin permission of the work_effort module. This is not to say about creating a new member in the "Group" menu and assigning permissions! Assign tasks to members, and become an assignment in ofbiz. Click the option "Member" to the right of "Subordinate Fixed Assets" just now, and you will enter "Add Human Service Member Assignment", "Member ID" Select the created "Zhang San" , the start date, select the time when the subtask is triggered, and set the "Status ID" to "Assigned", click "Add", OK, the current subtask will be assigned to "Zhang San", sometimes at this time It will throw an error after adding! Just add it again and you're done!

4. We now need to add another subtask for "Adjust Inventory - Subtask 1". For the sake of convenience, directly click "Subordinate Fixed Assets" - "New Subordinate Labor Service", and repeat step 2 for Adjust Inventory - Subtask 1 Add another subtask "Adjust Inventory - Subtask 2". Of course, the value of "Labor Service Association Type Identifier" is also "Dependent". After saving, repeat step 3 to adjust the subtask "Adjustment" just created. Inventory - Subtask 2" was assigned to "Li Si", "Li Si" and Zhang San were created from the beginning!

5. Okay, you're done! If the start time of the assigned subtask has come, the "end time" doesn't matter, it doesn't matter whether it is or not. Of course, if there is an end time, the assigned member subtask will disappear when the end time is reached, regardless of whether you have The status of this task has changed to "Completed", which is also easy to understand, because the next subtask has to continue! If not filled, the subtask will exist until the user changes the status to "Completed"!

6. In the last step, enter the system as "Zhang San" and "Li Si" respectively, enter "My Portal" - under My Tasks, you will see the list of tasks assigned to you by the admin, at this time "Li Si" The sub-task of "four" is dependent on "Zhang San", that is to say, only after the sub-task of "Zhang San" is completed, the task of "Li Si" can be seen. The normal process is that each person assigns the task to himself. When done, the entire workflow process is over!

Reprinted from http://www.cnblogs.com/Ivan-j2ee/archive/2012/07/30/2615791.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326333788&siteId=291194637