bw:bizweaver_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bw:bizweaver_api [2019/05/01 14:45]
runger
bw:bizweaver_api [2020/07/23 11:26] (current)
Line 1: Line 1:
 +======Bizweaver API======
 Bizweaver has its own API that can be used in a variety of ways.  This is a directly-called API and does not currently use REST as the communication mechanism.  Instead, a specially formatted URL is used. Bizweaver has its own API that can be used in a variety of ways.  This is a directly-called API and does not currently use REST as the communication mechanism.  Instead, a specially formatted URL is used.
  
-The two most common uses are to invoke a Bizweaver workflow from a Versago form (or report), and to have one workflow call another workflow.  See the [[versago:form_configuration#invoking_a_bizweaver_workflow|Invoking a Bizweaver Workflow]] Versago page for information about using this process from Versago.+The two most common uses are to invoke a Bizweaver workflow from a Versago form or report, and to have one workflow call another workflow.  See the **//[[versago:form_configuration#invoking_a_bizweaver_workflow|Invoking a Bizweaver Workflow]]//** Versago page for information about using this process from Versago.
  
-To use the API within Bizweaver workflowsimply use a WebService2 step.  The body of the step will contain an action string as described below.  When the second workflow is called the calling workflow will wait until it receives a response from the called workflow. Once a response is received the calling workflow will continue to its next step.+To initiate another workflow within Bizweaver, use a **//[[bw:web_service_tool|WebService2]]//** step.  The step is configured to use POST (preferred) or GET.  When the second workflow is calledthe calling workflow will wait until it receives a response from the called workflow. Once a response is received the calling workflow will continue to its next step.
  
-<WRAP center round important 60%>+<WRAP center round tip 80%> 
 +Processes beginning with v2.4 should always use POST.  Processes from older versions that used GET should be converted to POST as soon as possible. 
 +</WRAP> 
 +<WRAP center round important 80%> 
 +A token must be generated in order to use the POST processes described below.  Information on configuring a token is found **//[[bw:bizweaver_general_settings#bizweaver_webservice|here]]//**. 
 +</WRAP> 
 +<WRAP center round important 80%>
 Use caution when connecting multiple workflows in a sequence.  You may need to adjust the timeout value on the earlier steps to be sure the processing doesn't continue before the called step(s) have completed their work. Use caution when connecting multiple workflows in a sequence.  You may need to adjust the timeout value on the earlier steps to be sure the processing doesn't continue before the called step(s) have completed their work.
 </WRAP> </WRAP>
  
-The Bizweaver API can be used with any tool that can send a URL.  For example, you might create a small VBScript for a specific user to let them execute a workflow on demand.  Or you could call the URL from a Versago Action link in a report. 
  
-===== Bizweaver Action Target String =====+=====Call Another Workflow Using POST===== 
 +When a Bizweaver workflow is called (initiated) using POST, the configuration of the WebService2 tool involves two sections: the URI and the Body.  An example is shown below. 
 + 
 +{{ :bw:webservice_bizweaverpost.png?400  |}} 
 + 
 + 
 + 
 +  * Change the **YourServer:YourPort** values as needed by your installation.  The URI might look something like https://MyPortal.MyCompany.com:443 
 +    * Remember that you will need to use HTTP or HTTPS depending on your environment. 
 +    * The rest of the URI, __/BWService/api/workflow/InvokeWorkFlow__, will always be the same. 
 +  * Select POST from the "Method" drop-down list. 
 +  * Enter "application/json" in the "Content Type" field. 
 +  * Select the "Calling BW Task" checkbox. 
 +  * Enter the appropriate values in the "Body Information" section in the structure shown.  This structure can be copied from here, pasted into your workflow, and the values changed as needed. 
 + 
 + 
 +<WRAP center round tip 60%> 
 +Finding the proper port needed will be in your IIS Manager which can be found in Start -> Windows Administrative Tools -> Internet Information Services (IIS) Manager. There will be a drop down for your server, then you will see Sites drop down and then Versago click on Versago and on the right panel there will be the proper port needed to use in the API call. 
 +</WRAP>
  
-The Action String to invoke a Bizweaver workflow is shown below.+Here is a sample of the full URL.  Copy and paste this string as a starting point.
  
-http:%%//%%<color #ed1c24>1</color>:<color #ed1c24>2</color>/BWService/api/workflow/InvokeWorkFlow?pTaskID=<color #ed1c24>3</color>&pStartAfter=0&pArguments={<color #ed1c24>4</color>:'~<color #ed1c24>5</color>~'}+<code> 
 +https://MyPortal.MyCompany.com:443/BWService/api/workflow/InvokeWorkFlow 
 +</code>
  
-The elements in <color #ed1c24>red</colorare specific to your installation. The other items (included variable names used by Bizweaver) are **case sensitive**, so the easiest way to create the Action Target is to copy this string and paste it into Versago, then make the needed changes. You might also update the Bizweaver server information so that you will only need to change a few items.+<code json> 
 +
 +  "pTaskID":"NN", 
 +  "pArguments": 
 +    { 
 +    "Arg1":"Value1", 
 +    "Arg2":"Value2" 
 +    } 
 +
 +</code>
  
-  - The server where Bizweaver is installed +  * **NN** is the ID of the workflow being called
-  - The port assigned to the Bizweaver web service when the application was installed. +  * **Arguments** (parameters) are any values being passed to the workflow being called
-  - The Bizweaver workflow ID to be invoked. This can be found in Bizweaver and will always be numeric. +    * Arguments are always sent in pairs.  Each paid is separated by colon **:** as shown. 
-  - The name of the variable in Bizweaver that will receive a value from Versago+    * The argument (Arg1, Arg2, etc.) is the variable name expected by the workflow being called. 
-  - Value(s) to be passed to Bizweaver. +      * Variable names are case-sensitive
-    - If value(s) are not being passed to Bizweaver, the space between the curly braces is left blank+    * Values are the value being passed
-    - If the value is a value from the form, use the Column Name from the form enclosed in tilde symbols (~) as shown. +      * Text and dates are enclosed in double-quotes. 
-    - If the value is static the tildes are not used+      * Numeric values do not require double-quotes. 
-    - In both cases the value being passed is enclosed in single quotes. +    * "pArguments" is required even if no values are being passed In this case the "pArguments" section will look like this.
-  If multiple values need to be sent to Bizweaver, separate each pair of values (steps 5 and 6) by a commaSee sample 3 in the next section.+
  
-===== Bizweaver Action Target String Samples =====+<code json> 
 +
 +  "pTaskID":"NN", 
 +  "pArguments":{} 
 +
 +</code>
  
-  - Example using HTTP to port 8082 on server “TWBSTestserver.demo.com”, invoking workflow ID 10, and sending a value from form control name “vgoRecNum” to a Bizweaver variable named “vgoRecNum.” \\ \\ **http:%%//%%<color #ed1c24>TWBSTestserver.demo.com</color>:<color #ed1c24>8082</color>/BWService/api/workflow/InvokeWorkFlow?pTaskID=<color #ed1c24>10</color>&pStartAfter=0&pArguments={<color #ed1c24>vgoRecNum</color>:'<color #ed1c24>~5~</color>'}** \\ \\ 
-  - Example using HTTPS to port 443 on server “TWBSTestserver.demo.com”, invoking workflow ID 10, and sending a value from form control name “vgoRecNum” to a Bizweaver variable named “vgoRecNum.” Note that the only difference is the “HTTPS” and port number. \\ \\ **https:%%//%%<color #ed1c24>TWBSTestserver.demo.com</color>:<color #ed1c24>443</color>/BWService/api/workflow/InvokeWorkFlow?pTaskID=<color #ed1c24>10</color>&pStartAfter=0&pArguments={<color #ed1c24>vgoRecNum</color>:'<color #ed1c24>~5~</color>'}** \\ \\ 
-  - Example using HTTP to port 8082 on server “TWBSTestserver.demo.com,” invoking workflow ID 10, and sending two values; one from form control name “vgoRecNum” to a Bizweaver variable named “vgoRecNum” and a static value “TextString” to a Bizweaver variable name “vgoText.” \\ \\ **http:%%//%%<color #ed1c24>TWBSTestserver.demo.com</color>:<color #ed1c24>8082</color>/BWService/api/workflow/InvokeWorkFlow?pTaskID=<color #ed1c24>10</color>&pStartAfter=0&pArguments={<color #ed1c24>vgoRecNum</color>:'<color #ed1c24>~5~</color>',vgoText: 'TextString'}** 
bw/bizweaver_api.1556736327.txt.gz · Last modified: 2019/05/01 14:45 by runger