Wiki

Scale Your Enterprise

User Tools

Site Tools


bw:databuilder_tool

Differences

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

Link to this comparison view

Next revision
Previous revision
bw:databuilder_tool [2019/03/06 14:43]
runger created
bw:databuilder_tool [2022/08/02 15:33] (current)
akoehler
Line 1: Line 1:
-====== Introduction (DataBuilder======+======Introduction to DataBuilder======
  
 This document described the use of the Bizweaver DataBuilder tool. This tool is used to create JSON and XML data structures for use with web service APIs. This document described the use of the Bizweaver DataBuilder tool. This tool is used to create JSON and XML data structures for use with web service APIs.
- 
-====== Audience ====== 
- 
-This document is intended for developers of Bizweaver workflows. 
  
 ====== Related Documents ====== ====== Related Documents ======
Line 11: Line 7:
 The following documents contain additional information that may be helpful with the development of Bizweaver workflows. The following documents contain additional information that may be helpful with the development of Bizweaver workflows.
  
-  * [[bw:web_service_tool|WebService Tool]]+  * **[[bw2:web_service_tool|WebService Tool]]**
  
 ====== Before You Begin ====== ====== Before You Begin ======
Line 17: Line 13:
 You will need to know, or have examples of , the data structures the API is expecting. This includes element (field names) and child objects within the structure. Keep in mind that names will generally require an exact match, including case. You will need to know, or have examples of , the data structures the API is expecting. This includes element (field names) and child objects within the structure. Keep in mind that names will generally require an exact match, including case.
  
 +=====For SAP Business One Service Layer=====
 +An easy way to view the data structures used for SAP Business One is to create a small workflow that executes a GET on the object in question.  The workflow will have two WebService2 steps: a login step and a GET step.  The GET step references the target object (e.g. SalesOrders). The GET step will return the data structure for the object in the "Output String."  This is also an easy way to create a template file for the object in your environment as it will include any user-defined fields as well.
 +
 +More information dealing with SAP Service Layer can be found **[[bw2:sap_business_one_integration_using_service_layer|here]]**
 ====== General Notes ====== ====== General Notes ======
  
Line 29: Line 29:
   - The “CumulativeData” variable from the main DataBuilder step in referenced in the web service step that transmits the information to the API.   - The “CumulativeData” variable from the main DataBuilder step in referenced in the web service step that transmits the information to the API.
  
-====== Sample Building JSON for SAP Business One on HANA ======+====== Sample Building JSON for SAP Business One Service Layer ======
  
 ===== Workflow ===== ===== Workflow =====
 +This workflow builds two sections of a JSON structure for an SAP Business One sales order.  The sections are the header and the rows.  Each section consists of a SQL statement to gather the needed information and the DataBuilder to format the information.  Once the pieces are constructed, the output is sent to the SAP Service Layer API in the WebService step.  Other APIs will work in a similar manner.
  
-{{:bw:databuilder1.png?600|}}+{{  :bw:databuilder1.png?600  |}}
  
 ===== Create Main DataBuilder Step ===== ===== Create Main DataBuilder Step =====
  
-{{:bw:databuilder2.png?600|}}+{{  :bw:databuilder2.png?600  |}}
  
 This should always contain the first items of the data structure. This should always contain the first items of the data structure.
Line 45: Line 46:
   - Select the desired data structure type to be created (JSON or XML).   - Select the desired data structure type to be created (JSON or XML).
   - Leave the “Add as an array” checkbox cleared unless you know that the top-level object needs to be any array. This is uncommon.   - Leave the “Add as an array” checkbox cleared unless you know that the top-level object needs to be any array. This is uncommon.
 +  - Select the "Top-level element" checkbox, assuming this is the top level (header) node of the structure.
 +    - This option causes the "CumulativeData" step-variable to be cleared before starting to build a new structure.
   - Enter the name of the top-level object.   - Enter the name of the top-level object.
     - The requirements of the receiving API will determine this.     - The requirements of the receiving API will determine this.
Line 63: Line 66:
 ===== Create the Lower-Level DataBuilder Step(s) ===== ===== Create the Lower-Level DataBuilder Step(s) =====
  
-{{:bw:databuilder3.png?600|}}+{{  :bw:databuilder3.png?600  |}}
  
-{{:bw:databuilder4.png?600|}} +This will be the next section in the expected data structure. The process is the same as described in the “Main DataBuilder” step.
- +
-These will be the next sections in the expected data structure. The process is the same as described in the “Main DataBuilder” step.+
  
 For objects such as a set of rows, the display will only display a single entry. However, all data received as input will be included when the workflow executes. For objects such as a set of rows, the display will only display a single entry. However, all data received as input will be included when the workflow executes.
  
-In most cases the lower-level sections will need to be marked as an **array**. The “Add as an array” checkbox should be selected. However, always check your API documentation to verify this.+<WRAP center round tip 80%> 
 +In most cases the lower-level sections will need to be marked as an **array**. The “Add as an array” checkbox should be selected. However, always check your API documentation to verify this.  **At the same time**, the "Top-level Element" checkbox should remain cleared. 
 +</WRAP> 
 + 
 +<WRAP center round important 80%> 
 +When creating lower-level section that __may__ have more than one entry (i.e. an array), be sure to put the DataBuilder tool within a **Loop**.  As each record is read from the input it is added to the bottom of the array being constructed.  Not using a loop will result in an incorrect data structure. 
 +</WRAP> 
 + 
  
 All objects other than the main one will require an Object Name. This must exactly match (including case) what is expected by the API. All objects other than the main one will require an Object Name. This must exactly match (including case) what is expected by the API.
Line 84: Line 93:
     - The lower-level object is displayed in the left-side data structure.     - The lower-level object is displayed in the left-side data structure.
  
-{{:bw:databuilder5.png?600|}}+{{  :bw:databuilder5.png?600  |}}
  
 Here is the resulting JSON that is sent in the API call. Here is the resulting JSON that is sent in the API call.
  
 +<code json>
 { {
 "CardCode": "C20000", "CardCode": "C20000",
Line 109: Line 119:
 ] ]
 } }
 +</code>
 ===== Reference the Output of the Main DataBuilder Step in the API Call ===== ===== Reference the Output of the Main DataBuilder Step in the API Call =====
  
 The output of the main DataBuilder step is used in the API call. This is done by using the “**CumulativeData**” variable from the Main DataBuilder step. An example is shown in the image below. The output of the main DataBuilder step is used in the API call. This is done by using the “**CumulativeData**” variable from the Main DataBuilder step. An example is shown in the image below.
  
-{{:bw:databuilder6.png?600|}}+{{  :bw:databuilder6.png?600  |}} 
 + 
 +====Databuilder Variables==== 
 +^Name         ^ Description          
 +|AddAsArry|True or False if the add as array checkbox is selected| 
 +|CumulativeData|This is the collection of all data that was built in the databuilder| 
 +|Data|This is the last run of data that was entered into the databuilder| 
 +|DataSourceName|This indicates the name of the tool that is being used for the source data for the databuilder| 
 +|DataType|This indicates the type of data your are building XML or JSON| 
 +|ObjectName|Is the name of the top level of your JSON or XML| 
 +|TopLevelElement|True or False if the top level element checkbox is selected| 
 +| StepMessage|During a failure the reason for failure will be populated here | 
 +| StepStatus        |True or False|
  
bw/databuilder_tool.1551901420.txt.gz · Last modified: 2019/03/06 14:43 by runger