Wiki

Scale Your Enterprise

User Tools

Site Tools


bw:call_bizweaver_web_service_from_sql_server

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:call_bizweaver_web_service_from_sql_server [2019/10/17 12:11]
runger [Add code to call the custom Stored Procedure in SBO_SP_PostTransactionNotice]
bw:call_bizweaver_web_service_from_sql_server [2020/12/18 13:25] (current)
akoehler [To Begin]
Line 1: Line 1:
-======Initial Configuration======+======SQL Configuration to Call a Bizweaver Workflow======
 <WRAP center round alert 60%> <WRAP center round alert 60%>
 The following actions should only be performed by persons familiar with SQL Server Management Studio and understand how to manipulate objects in a database. The following actions should only be performed by persons familiar with SQL Server Management Studio and understand how to manipulate objects in a database.
Line 5: Line 5:
  
 =====To Begin===== =====To Begin=====
 +<WRAP center round alert 60%>
 +The Bizweaver Web Service needs to be installed either from a Versago or Bizweaver installation to have the below file path available. If "Skip this Step" is selected during installation, the applications will need to be reinstalled to access the path.
 +</WRAP>
   * Download DLL executable from [[https://portal.twbs.com]] to the SQL Server server.  The DLL executable is also automatically placed in __C:\Program Files\Bizweaver\BWPortal__ by the Bizweaver installation.   * Download DLL executable from [[https://portal.twbs.com]] to the SQL Server server.  The DLL executable is also automatically placed in __C:\Program Files\Bizweaver\BWPortal__ by the Bizweaver installation.
  
-=====Initialization=====+=====Master Configuration=====
 <WRAP center round info 60%> <WRAP center round info 60%>
 Execute the SQL statements that follow against the **Master** database.  These steps, until the "Configure Target Database" section, MUST be performed on the server where SQL Server is located. Execute the SQL statements that follow against the **Master** database.  These steps, until the "Configure Target Database" section, MUST be performed on the server where SQL Server is located.
Line 40: Line 43:
 </code> </code>
  
-=====Target (SAP) Database Configuration=====+=====Target Database Configuration=====
  
 ====Add the DLL to the Target Database==== ====Add the DLL to the Target Database====
  
-  * Expand the database information for the target (SAP) database.+  * Expand the database information for the target (SAP or vgoCommon for Payments) database.
   * Expand the **Programmability** section.   * Expand the **Programmability** section.
   * Right-click on **Assemblies**; select __New Assembly__.   * Right-click on **Assemblies**; select __New Assembly__.
Line 52: Line 55:
  
 <WRAP center round info 60%> <WRAP center round info 60%>
-The remaining steps, which create & update various SQL Stored Procedures, can be done from any instance of SQL Server Management Studio that has access to the target (SAP) database.+The remaining steps, which create & update various SQL Stored Procedures, can be done from any instance of SQL Server Management Studio that has access to the target database.
 </WRAP> </WRAP>
  
-====Create a custom stored procedure in the target (SAP) database====+====Create a custom stored procedure in the target database====
 This procedure handles the web service call to Bizweaver.  It is used for both POST and GET transactions. This procedure handles the web service call to Bizweaver.  It is used for both POST and GET transactions.
 <code sql> <code sql>
Line 64: Line 67:
  
 ======Configuration for SAP Business One======= ======Configuration for SAP Business One=======
 +The processing of records added or updated in the SAP application can be initiated using a SQL stored procedure.
  
 <WRAP center round help 80%> <WRAP center round help 80%>
Line 69: Line 73:
 </WRAP> </WRAP>
  
 +======Configuration for Automatic Versago Multi-Select Report Processing======
 +The processing of records selected in a Versago multi-select report can be initiated using a SQL database trigger.
 +
 +<WRAP center round help 80%>
 +A sample of the trigger code used to automatically initiate processing is found **//[[bw:bizweaver_multiselect_trigger|here]]//**.
 +</WRAP>
  
  
Line 75: Line 85:
 <wrap em>Contact Third Wave support for assistance with this configuration</wrap> <wrap em>Contact Third Wave support for assistance with this configuration</wrap>
  
-A basic database trigger to initiate Bizweaver processing for payments will look like this. 
  
-<code sql payments_trigger_sql.txt> 
-CREATE TRIGGER [dbo].[twbs_tr_VersagoPayments] 
-ON [dbo].[Versago_Payments] 
-AFTER INSERT 
-AS 
-BEGIN 
--- SET NOCOUNT ON added to prevent extra result sets from 
--- interfering with SELECT statements. 
-SET NOCOUNT ON; 
--- 
-DECLARE 
-@vgo_BatchID INT, 
-@object INT, 
-@url VARCHAR(5000), 
-@bw_url nvarchar(100), 
-@bw_WorkflowID int, 
-@bw_port int, 
-@pArgVariableName nvarchar(50) 
--- 
-/* It may be necessary to change all instances of "vgoCommon" to a different name if you have used a different name */ 
-select 
-t0.BW_URL, t0.BW_Port, t0.BW_WorkflowID 
-from vgoCommon..twbs_vgo_payment_InfoMapping t0 
--- 
-set @pArgVariableName = 'vgo_BatchID' 
-select @vgo_batchid = (select vgo_batchid from inserted) 
-select @bw_url = (select t0.bw_url from vgoCommon..twbs_vgo_payment_InfoMapping t0) 
-select @bw_port = (select t0.bw_port from vgoCommon..twbs_vgo_payment_InfoMapping t0) 
-select @bw_Workflowid = (select t0.BW_WorkflowID from vgoCommon..twbs_vgo_payment_InfoMapping t0)  
--- 
-SELECT @url = @bw_url + '/BWService/api/workflow/InvokeWorkFlow?pTaskID=' + cast(@bw_WorkflowID as varchar) + '&pStartAfter=0&pArguments={' + @pArgVariableName + ':' + CAST(@vgo_BatchID AS VARCHAR) + '}' 
-EXEC sp_OACreate 'MSXML2.XMLHTTP', @object OUT; 
-EXEC sp_oamethod @object, 'open', NULL, 'get', @url 
-EXEC sp_oamethod @object, 'send'SELECT @url 
---select @responsetext as [Response] 
--- select @url 
-EXEC sp_oadestroy @object 
-END 
-</code> 
  
-The following video illustrates this process. 
  
-{{ :versago:versago_db_trigger_demo.mp4?800 |DB Trigger Demo}}. 
  
  
- 
-======Configuration for Versago Multi-Select Report Processing====== 
-Create a trigger on the table where records are saved by your Versago multi-select report. 
- 
-Values in <YourValue> are specific to your installation and need to be changed accordingly.  The < and > symbols are removed when the desired value is entered. 
- 
-<code SQL Trigger.txt> 
-create TRIGGER [dbo].[<YourTriggerName>] 
-ON [dbo].<TableNAme> 
-AFTER INSERT 
-AS 
-declare @vgo_Batchid nvarchar(8), @arguments nvarchar(100) 
---- 
-SELECT @vgo_BatchID = vgo_BatchID FROM inserted 
-BEGIN 
-SET @Arguments = '{"vgo_BatchID":' + '"' + @vgo_BatchID + '"' + '}' 
-EXECUTE [dbo].[spCallBizweaverWS] 
-@wsMethod='POST' 
--- add your URL.  Be sure to use http or https as appropriate. 
-,@wsURL='https:<YourURL>' 
-,@wsContent='application/json' 
--- Add your Auth Token from Bizweaver 
-,@wsAuthToken='<YourBizweaverToken>' 
--- Add your workflow ID from Bizweaver 
-,@wsTaskId='<YourWorkflowID>' 
-,@wsStartAfter='' 
-,@wsParameters= @Arguments 
--- Add your port number 
-,@wsPort='<YourPort>' 
-END 
-</code> 
  
  
bw/call_bizweaver_web_service_from_sql_server.1571328664.txt.gz ยท Last modified: 2019/10/17 12:11 by runger