{"id":25782,"date":"2019-11-07T12:52:32","date_gmt":"2019-11-07T11:52:32","guid":{"rendered":"http:\/\/help.qualiware.it\/qw-help\/?p=25782"},"modified":"2023-05-19T12:15:54","modified_gmt":"2023-05-19T10:15:54","slug":"workflow-reset-e-rigenerazione","status":"publish","type":"post","link":"https:\/\/help.qualiware.it\/qw-help\/workflow-reset-e-rigenerazione\/","title":{"rendered":"Workflow: reset e rigenerazione"},"content":{"rendered":"<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">' Il seguente snippet pu\u00f2 essere usato per resettare il workflow e rigenerarlo\r\n\r\nDim QWSess As QWSession = DB.QWSession\r\nDim ok as boolean\r\nDim ss as string, msg as string\r\nDim TIPO, TIPO_CONT, NUMERO as string\r\nDim IND_REV as integer\r\n\r\nunpackcode(\"DW\",CODDOC,TIPO,TIPO_CONT,NUMERO,IND_REV)\r\n\r\n'DOC_REVE\r\nss = \"delete from DOC_REVE where TIPO = '\" + TIPO + \"' and TIPO_CONT = '\" + TIPO_CONT + \"' and NUMERO = '\" + NUMERO + \"' and IND_REV = \" + cstr(IND_REV) \r\nok = DB.ExecuteSQL(ss)\r\n\r\nif not ok then\r\n     msg = \"Questa Query ha restituito un errore : \" + vbnewline\r\n     WriteLog(\"ERRORE \" + vbnewline + msg + ss)\r\nend if\r\n\r\n'WF\r\nmsg = \"\"\r\nmsg = QWWorkFlowEngine.RemoveWorkFlow(QWSess, \"DW\", CODDOC)\r\n\r\nif msg &lt;&gt; \"\" then\r\n     WriteLog(\"ERRORE \" + vbnewline + msg)\r\nend if\r\n\r\ndim qwdr as QWTable = new QWTable\r\nqwdr.database = DB\r\nqwdr.sql = \"SELECT * \"\r\nqwdr.sql += \"FROM DOCUMENT \"\r\nqwdr.allowallrecords = false\r\nqwdr.requestlive = true\r\nqwdr.active = true\r\n\r\nif qwdr.rowset.findkey(TIPO, TIPO_CONT, NUMERO, IND_REV) then\r\n     msg = \"\"\r\n     ok = QWFD_SetWorkflow(QWSess, qwdr, msg)\r\n\r\n     if not ok then\r\n          WriteLog(\"ERRORE \" + vbnewline + msg)          \r\n     end if\r\nend if\r\n\r\nqwdr.active = false\r\nqwdr.dispose()\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8216; Il seguente snippet pu\u00f2 essere usato per resettare il workflow e rigenerarlo Dim QWSess As QWSession = DB.QWSession Dim ok as boolean Dim ss as string, msg as string Dim TIPO, TIPO_CONT, NUMERO as string Dim IND_REV as integer unpackcode(&#8220;DW&#8221;,CODDOC,TIPO,TIPO_CONT,NUMERO,IND_REV) &#8216;DOC_REVE ss = &#8220;delete from DOC_REVE where TIPO = &#8216;&#8221; + TIPO + &#8220;&#8216;&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[82],"acf":[],"_links":{"self":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/25782"}],"collection":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/comments?post=25782"}],"version-history":[{"count":1,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/25782\/revisions"}],"predecessor-version":[{"id":30652,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/25782\/revisions\/30652"}],"wp:attachment":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/media?parent=25782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/categories?post=25782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/tags?post=25782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}