Haystack Connector
The Haystack connector reads asset data from a Haystack server. Pass an object with the parameters you require from the following table:
Code example
…
{
"_orchcomp": "J2_connector",
"_name": "Haystack Connector",
"_sequenceno": 1,
"_actualparams": {
"action": "readall" | "readybid" | "readhistory" | "eval" | "config" ,
"project": "project_name",
"url": "<URL-to-your-database>",
"uname": "johnDoe",
"pwd": "secret",
"cmd": "",
"to": "file",
"fileName": "haystack-connector-responses.json"
}
},
…
Haystack Connector schema
| Parameter | Type | Description | Required |
|---|---|---|---|
| _orchcomp | String | Enter “J2_connector”. | Required |
| _name | String | Enter a descriptive name for what the component does in the orchestrator. | Optional |
| _sequenceno | Number | Enter a number that defines the task’s order in the sequence of tasks to execute. | Required |
| _actualparams | Object | Pass an object that contains formal parameters or alternative parameters you want to add as key-value pairs, such as “userType”: “<your-user-type>”. | Optional |
| _actualparams.action | String | Enter one of the following SQL statements: "readall", "readbyid", "readhistory", "eval", "config". | Required |
| _actualparams.project | String | Takes the project name as a string. | Required |
| _actualparams.url | String | Takes a datasource URL as a string. | Required |
| _actualparams.uname | String | Takes the database username as a string. | Required |
| _actualparams.pwd | String | Takes the database password as a string. | Required |
| _actualparams.cmd | Object | Pass a command. | Optional |
| _actualparams.to | String | To save the request response to File Service, enter "file" as the value. | Optional |
| _actualparams.fileName | String | Enter the file name including the file extension. | Optional |
Haystack connector code examples for each action type
Refer to the following examples when you create your Haystack connector, depending on the action type you use:
readall
"_actualparams": {
"params": {
"action":"readall",
"cmd":"point and equipRef == @mechericenter",
"project": "project_name",
"url": "<URL-to-your-database>",
"uname": "<username>",
"pwd": "<password>"
}
}
readbyid
"_actualparams": {
"params": {
"action":"readybid",
"id": "p:mechericenter:r:2660ba41-851d6a87"
"project": "project_name",
"url": "<URL-to-your-database>",
"uname": "<username>",
"pwd": "<password>"
}
}
readhistory
"_actualparams": {
"params": {
"action":"readhistory",
"id": "p:mechericenter:r:2660ba41-851d6a87",
"range":"today",
"project": "project_name",
"url": "<URL-to-your-database>",
"uname": "<username>",
"pwd": "<password>"
}
}
config
"_actualparams": {
"params": {
"action": "config"
"project": "project_name",
"url": "<URL-to-your-database>",
"uname": "<username>",
"pwd": "<password>"
}
}
eval
"_actualparams": {
"params": {
"action":"eval",
"cmd": "readAll(point).hisRead(date(2024,08,02)..now()).hisClip()",
"project": "project_name",
"url": "<URL-to-your-database>",
"uname": "<username>",
"pwd": "<password>"
}
}