---
schema_version: "1"
id: 97115be3678e0ec163e40b6748f7516a14ce3e14ab7c424176af79375a5b5a96
title: Google BigQuery Connector 1.1 の例
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/google-bigquery-connector/1.1/google-bigquery-connector-examples.md
canonical_url: https://docs.mulesoft.com/jp/google-bigquery-connector/1.1/google-bigquery-connector-examples
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 38579c2b2294995766f2dc297bb9b1194e0c18634d0ca9d2a8077c83c1e5b6f0
description: MuleSoft Documentation Site
release: "1.1"
latest: true
---
# Google BigQuery Connector 1.1 の例

Google BigQuery Connector の Mule フローの例を次にいくつか示します。

- [ジョブの取得](#get-job)
- [ジョブの挿入](#insert-job)
- [ジョブの削除](#delete-job)
- [クエリ結果の取得](#get-query-result)
- [ジョブのキャンセル](#cancel-job)
- [ジョブのリスト](#list-jobs)
- [クエリ](#query)
- [On Table Row の使用](#on-table-row)
- [認証](#authorize)
- [HTML フォームの表示](#html-form)

## [](#始める前に)始める前に

- Java 8 または 11
- Anypoint Studio 7.5 以降
- Mule Runtime Engine (Mule) 4.3.0 以降
- DataWeave
- Google API の OAuth ログイン情報

## [](#接続の設定)接続の設定

接続を保護するには、OAuth 接続項目の値を指定する必要があります。次の手順を実行します。

- [接続の設定ファイルを作成する](#create-config-file)​。
- [接続のグローバル要素を設定する](#configure-conn)​。
- [プロパティファイルのグローバル要素を設定する](#configure-global)​。

### [](#create-config-file)接続の設定ファイルを作成する

接続のプロパティが含まれる設定ファイルを作成します。

1. `/src/main/resources/`​ フォルダー内に ​`mule-app.properties`​ という名前のファイルを作成します。
2. `mule-app.properties`​ ファイルに、次のような接続の一連のプロパティを作成します。括弧で囲まれたテキスト (括弧を含む) を各自の設定の適切な値に置き換えます。
    
    config.consumerKey=<consumerkey>
    config.consumerSecret=<consumersecret>
    
    これは、選択した接続設定によって異なる場合があります。

プロパティファイルの作成についての詳細は、​[「プロパティプレースホルダーの設定」](https://docs.mulesoft.com/mule-runtime/latest/mule-app-properties-to-configure)​を参照してください。

### [](#configure-conn)接続のグローバル要素を設定する

接続のグローバル要素を設定します。

1. 新しい Mule プロジェクトを作成します。
2. **\[Mule Palette (Mule パレット)\]**​ ビューで、​**\[Search in Exchange (Exchange 内を検索)\]**​ をクリックして「​`google bigquery`​」と入力します。
3. **\[Google BigQuery Connector\]**​ を ​**\[Selected modules (選択済みモジュール)\]**​ セクションに追加し、​**\[Finish (完了)\]**​ をクリックします。
4. **\[Global Elements (グローバル要素)\]**​ タブをクリックし、​**\[Create (作成)\]**​ をクリックします。
5. **\[Connector Configuration (コネクタ設定)\] > \[Google BigQuery Config (Google BigQuery 設定)\]**​ を選択し、​**\[OK\]**​ をクリックします。
6. JWT または OAuth2 を設定するための値を入力します。コネクタ設定の項目に入力する値についての詳細は、​[「コネクタのグローバル要素を設定する」](https://docs.mulesoft.com/jp/google-bigquery-connector/1.1/google-bigquery-connector-studio#configure-global-element)​を参照してください。
7. **\[Test Connection (接続をテスト**​)\] ボタンをクリックして、Google API と接続されていることを確認します。ポップアップに成功メッセージが表示されます。
8. **\[OK\]**​ をクリックします。
9. **\[Global Element Configuration (グローバル要素設定)\]**​ で HTTPS リスナー設定を開きます。
10. **\[TLS\]**​ タブをクリックし、\[TLS Configuration (TLS 設定)\] > \[Edit inline (インライン編集)\] を選択します。
11. 生成されたキーストアの詳細を使用して ​**\[Key Store Configuration (キーストア設定)\]**​ を指定し、この設定で HTTPS を有効にします。
12. **\[OK\]**​ をクリックします。

### [](#configure-global)プロパティファイルのグローバル要素を設定する

`mule-app.properties`​ ファイルのグローバル要素を設定して、Mule がその場所を認識できるようにします。

1. **\[Global Elements (グローバル要素)\]**​ タブをクリックし、​**\[Create (作成)\]**​ をクリックします。
2. **\[Choose Global Type (グローバル種別の選択)\]**​ ダイアログで、​**\[Configuration properties (設定プロパティ)\]**​ を選択し、​**\[OK\]**​ をクリックします。
3. **\[File (ファイル)\]**​ 項目に「​`mule.app.properties`​」と入力します。
4. **\[OK\]**​ をクリックします。

## [](#get-job)ジョブの取得

この Mule フローでは、指定されたジョブ ID からジョブを取得します。

この例では、次の操作を使用します。

- **HTTP Listener**​  
    HTTP 要求からデータを受け取ります。
- **Get Job**​  
    ジョブを取得します。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Job id (ジョブ ID)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>attributes.queryParams.jobId</code></p>
</div></div></td>
</tr>
</tbody>
</table>
- **Logger**​  
    **Get Job**​ 操作からの HTTP 応答を表示します。

![Get Job 操作の Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/get-job.png)

### [](#この例の-xml)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
	  xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>

	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="getQueryFlow"
		  >
		<http:listener doc:name="Listener"

					   config-ref="HTTP_Listener_config" path="/get" />
		<bigquery:get-job doc:name="Get Job"

						  jobId="#[attributes.queryParams.jobId]"
						  config-ref="BigQuery__Configuration" />
		<logger level="INFO" doc:name="Logger"
				 />
	</flow>
</mule>
```

### [](#この例の実行手順)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#insert-job)ジョブの挿入

この Mule フローでは、入力設定を使用してジョブを挿入します。

この例では、次の操作を使用します。

- **HTTP Listener**​  
    HTTP 要求からデータを受け取ります。
- **Insert Job**​  
    ジョブを挿入します。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Job values content (ジョブ値のコンテンツ)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>payload</code></p>
</div></div></td>
</tr>
</tbody>
</table>
- **Logger**​  
    **Insert Job**​ 操作からの HTTP 応答を表示します。

![Insert Job 操作の Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/insert-job.png)

### [](#この例の-xml-2)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
	  xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>

	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="insertJobFlow"
		  >
		<http:listener doc:name="Listener"

					   config-ref="HTTP_Listener_config" path="/insert" />
		<bigquery:insert-job doc:name="Insert Job"

							 config-ref="BigQuery__Configuration">
			<bigquery:job-values-content><![CDATA[#[payload]]]></bigquery:job-values-content>
		</bigquery:insert-job>
		<logger level="INFO" doc:name="Logger"
				 />
	</flow>
</mule>
```

### [](#この例の実行手順-2)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#delete-job)ジョブの削除

この Mule フローでは、指定されたジョブ ID からジョブを削除します。

この例では、次の操作を使用します。

- **HTTP Listener**​  
    HTTP 要求からデータを受け取ります。
- **Delete Job**​  
    ジョブを削除します。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Job id (ジョブ ID)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>attributes.queryParams.jobId</code></p>
</div></div></td>
</tr>
</tbody>
</table>
- **Logger**​  
    **Delete Job**​ 操作からの HTTP 応答を表示します。

![Delete Job 操作の Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/delete-job.png)

### [](#この例の-xml-3)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
	  xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>

	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="deleteJobFlow">
		<http:listener doc:name="Listener"
					   config-ref="HTTP_Listener_config" path="/delete" />
		<bigquery:delete-job doc:name="Delete Job"
							 config-ref="BigQuery__Configuration"
							 jobId="#[attributes.queryParams.jobId]" />
		<logger level="INFO" doc:name="Logger" />
	</flow>
</mule>
```

### [](#この例の実行手順-3)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#get-query-result)クエリ結果の取得

この Mule フローでは、クエリの結果を取得します。

この例では、次の操作を使用します。

- **HTTP Listener**​  
    HTTP 要求からデータを受け取ります。
- **Get Query Results**​  
    クエリの結果を取得します。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Job id (ジョブ ID)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>attributes.queryParams.jobId</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Start Index (開始インデックス)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>0</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Max Results (最大結果数)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>25</code></p>
</div></div></td>
</tr>
</tbody>
</table>
- **Logger**​  
    **Get Query Result**​ 操作からの HTTP 応答を表示します。

![Get Query Result 操作の Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/get-query-result.png)

### [](#この例の-xml-4)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
	  xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>

	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="getQueryResultFlow">
		<http:listener doc:name="Listener"
					   config-ref="HTTP_Listener_config" path="/get/results" />
		<bigquery:get-query-results doc:name="Get Query Result Paged" config-ref="BigQuery__Configuration" maxResults="25" jobId="#[attributes.queryParams.jobId]">
			<ee:repeatable-file-store-iterable inMemoryObjects="1000" />
		</bigquery:get-query-results>
		<logger level="INFO" doc:name="Logger"
			 message="#[payload]" />
	</flow>
</mule>
```

### [](#この例の実行手順-4)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#cancel-job)ジョブのキャンセル

この Mule フローでは、指定されたジョブ ID からジョブをキャンセルします。

この例では、次の操作を使用します。

- **HTTP Listener**​  
    HTTP 要求からデータを受け取ります。
- **Cancel Job**​  
    ジョブをキャンセルします。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Job id (ジョブ ID)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>attributes.queryParams.jobId</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Content-Type (コンテンツタイプ)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>application/json</code></p>
</div></div></td>
</tr>
</tbody>
</table>
- **Logger**​  
    **Cancel Job**​ 操作からの HTTP 応答を表示します。

![Cancel Job 操作の Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/cancel-job.png)

### [](#この例の-xml-5)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
	  xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>

	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="cancelJobFlow">
		<http:listener doc:name="Listener"
					   config-ref="HTTP_Listener_config" path="/cancel" />
		<bigquery:cancel-job doc:name="Cancel Job"
							 config-ref="BigQuery__Configuration"
							 jobId="#[attributes.queryParams.jobId]" />
		<logger level="INFO" doc:name="Logger" />
	</flow>
</mule>
```

### [](#この例の実行手順-5)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#list-jobs)ジョブのリスト

この Mule フローでは、プロジェクトからジョブを取得します。

この例では、次の操作を使用します。

- **HTTP Listener**​  
    HTTP 要求からデータを受け取ります。
- **List Jobs**​  
    ジョブをリストします。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Content-Type (コンテンツタイプ)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>application/json</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Max Results (最大結果数)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>30</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Pretty Print (プリティプリント)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>False (デフォルト)</code></p>
</div></div></td>
</tr>
</tbody>
</table>
- **Logger**​  
    **List Jobs**​ 操作からの HTTP 応答を表示します。

![List Jobs 操作の Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/list-jobs.png)

### [](#この例の-xml-6)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
	  xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>

	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="listJobsFlow">
		<http:listener doc:name="Listener"
					   config-ref="HTTP_Listener_config" path="/list" />
		<bigquery:list-jobs doc:name="List Jobs"
							config-ref="BigQuery__Configuration" />
		<logger level="INFO" doc:name="Logger" />
	</flow>
</mule>
```

### [](#この例の実行手順-6)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#query)クエリ

この Mule フローでは、クエリジョブ値で指定されたクエリを実行します。

この例では、次の操作を使用します。

- **HTTP Listener**​  
    HTTP 要求からデータを受け取ります。
- **Query**​  
    クエリを実行します。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Query values content (クエリ値のコンテンツ)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">%dw 2.0
output application/json
---

payload</code></pre>
</div>
</div></div></td>
</tr>
</tbody>
</table>
- **For Each**​  
    複数のコンポーネントを反復処理します。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Counter Variable Name (カウンター変数名)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>counter</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Batch Size (バッチサイズ)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>1</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Root Message Variable Name (ルートメッセージ変数名)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>rootMessage</code></p>
</div></div></td>
</tr>
</tbody>
</table>
    
    - **Transform Message**​  
        **Query**​ 操作の結果を JSON 形式で出力します。
        
        %dw 2.0
        output application/json
        var resultt = read(payload."output","application/json")
        ---
        ((resultt.f) map ((item, index) ->
                {(payload.attributes.tableSchema.fields\[index\].name as String) : item.v}
            ))
            reduce ((item, accumulator) -> accumulator ++ item)
    - **Logger**​  
        **Query**​ 操作からの HTTP 応答を表示します。

![Query 操作の Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/query.png)

### [](#この例の-xml-7)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:google-drive="http://www.mulesoft.org/schema/mule/google-drive"
	  xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd
http://www.mulesoft.org/schema/mule/google-drive http://www.mulesoft.org/schema/mule/google-drive/current/mule-google-drive.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>
	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="queryFlow">
		<http:listener doc:name="Listener"
					   config-ref="HTTP_Listener_config" path="/query" />
		<bigquery:query doc:name="Run Query create schema" config-ref="BigQuery__Configuration" responseTimeout="300" responseTimeoutUnit="SECONDS" >
			<bigquery:query-values-content ><![CDATA[#[%dw 2.0
output application/json
---
payload]]]></bigquery:query-values-content>
		</bigquery:query>
		<foreach doc:name="For Each" >
			<ee:transform doc:name="Transform Message">
				<ee:message>
					<ee:set-payload><![CDATA[%dw 2.0
output application/json
var resultt = read(payload."output","application/json")
---
((resultt.f) map ((item, index) ->
        {(payload.attributes.tableSchema.fields[index].name as String) : item.v}
    ))
    reduce ((item, accumulator) -> accumulator ++ item)
]]></ee:set-payload>
				</ee:message>
			</ee:transform>
			<logger level="INFO" doc:name="Logger" message="#[payload]"/>
		</foreach>
	</flow>
</mule>
```

### [](#この例の実行手順-7)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#on-table-row)On Table Row の使用

この Mule フローでは、​**On Table Row**​ ソースを使用します。

この例では、次の操作を使用します。

- **On Table Row**​  
    ウォーターマークに基づいてテーブルのすべての行を返します。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Scheduling Strategy (スケジュール戦略)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>Fixed Frequency</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Frequency (頻度)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>1000</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Start delay (開始遅延)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>0</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Time unit (時間単位)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>MILLISECONDS (Default)</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Dataset name (データセット名)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>test124</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Table name (テーブル名)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>table_data</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Watermark column (ウォーターマーク列)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>id</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Since (以降)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>1</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Column id (列 ID)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>id</code></p>
</div></div></td>
</tr>
</tbody>
</table>
- **Logger**​  
    **On Table Row**​ ソースからの HTTP 応答を表示します。
- **Transform Message**​  
    **On Table Row**​ 操作の結果を JSON 形式で出力します。
    
    %dw 2.0
    output application/json
    ---
    payload

![On Table Row ソースの Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/on-table-row.png)

### [](#この例の-xml-8)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
	  xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>

	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="onTableRow">
		<bigquery:on-table-row doc:name="On Table Row"
							   config-ref="BigQuery__Configuration" datasetName="test124"
							   tableName="table_data" watermarkColumn="id" since="'1'"
							   columnId="id">
			<scheduling-strategy>
				<fixed-frequency />
			</scheduling-strategy>
		</bigquery:on-table-row>
		<logger level="INFO" doc:name="Logger" />
		<ee:transform doc:name="Transform Message">
			<ee:message>
				<ee:set-payload><![CDATA[%dw 2.0
output application/json
---
payload]]></ee:set-payload>
			</ee:message>
		</ee:transform>
	</flow>
</mule>
```

### [](#この例の実行手順-8)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#authorize)認証

この Mule フローでは、接続を認証します。

この例では、次の操作を使用します。

- **HTTP Listener**​  
    HTTP 要求からデータを受け取ります。
- **Request**​  
    HTTP サービスをコンシュームします。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Method (メソッド)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>GET (Default)</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Path (パス)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>/authorize?resourceOwnerId=demo</code></p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Body (本文)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>payload</code></p>
</div></div></td>
</tr>
</tbody>
</table>
- **Logger**​  
    **Request**​ 操作からの HTTP 応答を表示します。

![Request 操作の Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/authorize.png)

### [](#この例の-xml-9)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
	  xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>

	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="authorize">
		<http:listener doc:name="/authorize"
					   config-ref="HTTP_Listener_config" path="/authorize">
			<http:response>
				<http:headers><![CDATA[#[{'content-type' : 'text/html'}]]]></http:headers>
			</http:response>
		</http:listener>
		<http:request method="GET" doc:name="Request"
					  config-ref="HTTP_Request_configuration"
					  path="/authorize?resourceOwnerId=demo">
		</http:request>
		<logger level="INFO" doc:name="Logger"
			 message="#[payload]" />
	</flow>
</mule>
```

### [](#この例の実行手順-9)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#html-form)HTML フォームの表示

この Mule フローでは、HTML フォームを表示します。

この例では、次の操作を使用します。

- **HTTP Listener**​  
    HTTP 要求からデータを受け取ります。
- **Parse Template**​  
    テンプレートを処理します。
    
    次の値を入力します。
    
    <table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">値</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Location (場所)</strong></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>index.html</code></p>
</div></div></td>
</tr>
</tbody>
</table>

![Parse Template コンポーネントの Studio フロー](/mulesoft/current/ja-jp/google-bigquery-connector/1.1/_images/html-form.png)

### [](#この例の-xml-10)この例の XML

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	  xmlns:os="http://www.mulesoft.org/schema/mule/os"
	  xmlns:http="http://www.mulesoft.org/schema/mule/http"
	  xmlns:bigquery="http://www.mulesoft.org/schema/mule/bigquery"
	  xmlns="http://www.mulesoft.org/schema/mule/core"
	  xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:secure-properties="http://www.mulesoft.org/schema/mule/secure-properties"
	  xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/bigquery http://www.mulesoft.org/schema/mule/bigquery/current/mule-bigquery.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/os http://www.mulesoft.org/schema/mule/os/current/mule-os.xsd
		http://www.mulesoft.org/schema/mule/secure-properties http://www.mulesoft.org/schema/mule/secure-properties/current/mule-secure-properties.xsd">
	<secure-properties:config name="Secure_Properties_Config_demo" doc:name="Secure Properties Config"  file="mule-artifact.properties" key="mulesoft" >
		<secure-properties:encrypt algorithm="Blowfish" />
	</secure-properties:config>

	<configuration-properties
			file="mule-artifact.properties" />
	<http:request-config
			name="HTTP_Request_configuration"
			doc:name="HTTP Request configuration"
			>
		<http:request-connection host="127.0.0.1"
								 port="8087"/>
	</http:request-config>
	<http:listener-config name="HTTP_Listener_config"
						  doc:name="HTTP Listener config"
						  >
		<http:listener-connection host="0.0.0.0"
								  port="8082" />
	</http:listener-config>
	<http:listener-config
			name="HTTP_Listener_config1_Test" doc:name="HTTP Listener config">
		<http:listener-connection host="127.0.0.1"
								  port="8087" usePersistentConnections="false"
								  connectionIdleTimeout="4000" />
	</http:listener-config>
	<bigquery:config name="BigQuery__Configuration"
					 doc:name="BigQuery  Configuration"
					 >
		<bigquery:oauth2-connection projectId="${config.projectId}">
			<bigquery:oauth-authorization-code
					consumerKey="${secure::config.consumerKey}"
					consumerSecret="${secure::config.consumerSecret}"
					resourceOwnerId="demo" />
			<bigquery:oauth-callback-config
					listenerConfig="HTTP_Listener_config1_Test" callbackPath="/callback"
					authorizePath="/authorize" />
		</bigquery:oauth2-connection>
	</bigquery:config>
	<flow name="html-form-flow">
		<http:listener doc:name="/"
					   config-ref="HTTP_Listener_config" path="/">
			<http:response>
				<http:headers><![CDATA[#[{'content-type' : 'text/html'}]]]></http:headers>
			</http:response>
		</http:listener>
		<parse-template doc:name="Parse Template"
						location="index.html" />
	</flow>
</mule>
```

### [](#この例の実行手順-10)この例の実行手順

1. コネクタが設定されていることを確認します。
2. プロジェクトを保存します。
3. OAuth2 認証の ​**\[Authorize (認証)\]**​ ボタンをクリックします。
4. Web ブラウザーから「​`http://{app-name}.cloudhub.io`​」と入力してアプリケーションをテストします。

## [](#関連情報)関連情報

- [Anypoint Connector の概要](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [MuleSoft ヘルプセンター](https://help.mulesoft.com)