@_text@
+State: @wf_current_state@
+ } + text.format text/html + form {} + form.format text/html + form_constraints { + {wf_current_state:current_state} + _page_order:hidden + } + } + aa_log "===== Form en:tip.form created" + + # + # Create the TIP workflow + # + ::xowiki::test::create_form_page \ + -user_id $user_id \ + -instance $instance \ + -path $testfolder \ + -parent_id $folder_id \ + -form_name Workflow.form \ + -update { + _title "TIP Workflow" + _name en:tip.wf + workflow_definition { + # Actions are used here with the following parameters: + # next_state: state after activation of action + # roles: a list of roles; if the current user has one of these + # roles, he is allowed to perform the action + # Currently implemented roles: + # all, swa, registered_user, unregistered user, admin, + # creator, app_group_member, community_member + # + Action save -roles admin + Action propose -next_state proposed -proc activate {obj} { + my msg "$obj is going to state [my next_state]" + } + Action accept -next_state accepted + Action reject -next_state rejected + Action mark_implemented -next_state implemented + + # States + # - form: the form to be used in a state + # - view_method: Typically "view" (default) or "edit" + #State parameter {{form "en:tip-form"} {view_method edit}} + #assigns the specified form to all states + + State parameter {{form "en:tip.form"} {extra_js 1.js}} + + State initial -actions {save propose} + State proposed -actions {save accept reject} + State accepted -actions {save mark_implemented} + State rejected -actions {save} + State implemented -actions {save} + } + form_constraints {@table:_name,wf_current_state,_creator,_last_modified} + } + + aa_log "===== Workflow en:tip.wf created" + + + + } on error {errorMsg} { + aa_true "Error msg: $errorMsg" 0 + } finally { + #calendar::delete -calendar_id $temp_calendar_id + + } + } + } #