cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

thingworx flow install mathjs

mmancin
9-Granite

thingworx flow install mathjs

Hi,

 

   

I am trying to install within nodejs module the mathjs library to be able to use the unit converter. I have a problem to install an external library. I followed the guide on the portal but i can't install the module and whitelist it.

 

At first, I install mathjs into ThingworxFlow folder

 

 

cd C:\<PROGRAM FILES>\ThingworxFlow
npm install mathjs

 

 

I run the command to download the settings file

 

 

flow-deploy settings download -f ‘.\settings.json' -t "https://<url>:443/Thingworx" -u 'Administrator' -p ‘pass' -c devtools -s default -l debug

 

 

I edit the whitelistExternal with "mathjs" and then upload

 

 

flow-deploy settings upload -f ‘.\settings.json' -t "https://<url>:443/Thingworx" -u 'Administrator' -p ‘pass' -c devtools -s default -l debug

 

 

mmancin_0-1613513001377.png

but from flow keeps telling me that it is not whitelisted. What can I do?

 

mmancin_1-1613513034142.png

 

 

9 REPLIES 9
slangley
23-Emerald II
(To:mmancin)

Hi @mmancin.

 

Please provide a link to the guide you are referring to and provide the version of ThingWorx/Flow you are running.

 

Did you get any errors when you ran the commands?  We can see in the statements you provided, you're using smart quotes in some cases, which could be causing an issue:

 

 

 

Regards.

 

--Sharon

 

Hi, i follow this guide

 

https://support.ptc.com/help/thingworx/platform/r9/it/index.html#page/ThingWorx/Help/Integration_Orchestration/ConnectorDevelopmentSDK/DeployingConnectors.html

 

About smart quotes I think are copy/paste error on this forum because the command correctly run into powershell.

slangley
23-Emerald II
(To:mmancin)

Hi @mmancin.

 

And what version of ThingWorx and ThingWorx Flow are you running?

 

Regards.

 

--Sharon

Thingworx Foundation and Flow both 9.1.0

slangley
23-Emerald II
(To:slangley)

Hi @mmancin.

 

Could you please provide the settings.json with your changes?

 

Regards.

 

--Sharon

{
  "PlatformSettingsConfig": {
    "BasicSettings": {
      "BackupStorage": "C://ThingworxBackupStorage",
      "DatabaseLogRetentionPolicy": 7,
      "EnableBackup": true,
      "EnableClusteredMode": false,
      "EnableSystemLogging": false,
      "EnableSSO": false,
      "FileRepositoryRoot": "C://ThingworxStorage",
      "HTTPRequestHeaderMaxLength": 2000,
      "HTTPRequestParameterMaxLength": 2000,
      "InternalAesCryptographicKeyLength": 128,
      "MetricsLoggingFrequency": 30,
      "MetricsLoggingLevel": "WARN",
      "SessionUpdateDelay": 60,
      "Storage": "C://ThingworxStorage",
      "ScriptTimeout": 30,
      "UserEditLockMaxWaitTime": 30000
    },
    "AdministratorUserSettings": {
      "InitialPassword": "XXX"
    },
    "ContentTypeSettings": {
      "supportedMediaEntityContentTypes": [
        "image/svg+xml",
        "image/png",
        "image/gif",
        "image/bmp",
        "image/jpeg",
        "application/pdf",
        "image/vnd.microsoft.icon"
      ]
    },
    "ExtensionPackageImportPolicy": {
      "importEnabled": true,
      "allowJarResources": true,
      "allowJavascriptResources": true,
      "allowCSSResources": true,
      "allowJSONResources": true,
      "allowWebAppResources": true,
      "allowEntities": true,
      "allowExtensibleEntities": true
    },
    "OrchestrationSettings": {
      "EnableOrchestration": true,
      "QueueHost": "XXX",
      "QueuePort": 5672,
      "QueueName": "256mb",
      "QueueUsername": "XXX",
      "QueuePassword": "encrypt.queue.password",
      "QueueVHost": "orchestration"
    }
  },
  "PersistenceProviderPackageConfigs": {
    "PostgresPersistenceProviderPackage": {
      "ConnectionInformation": {
        "jdbcUrl": "jdbc:postgresql://XXX:PPP/thingworx",
        "password": "XXX",
        "username": "XXX",
        "acquireIncrement": 5,
        "acquireRetryAttempts": 3,
        "acquireRetryDelay": 10000,
        "checkoutTimeout": 1000000,
        "driverClass": "org.postgresql.Driver",
        "fetchSize": 5000,
        "idleConnectionTestPeriod": 60,
        "initialPoolSize": 5,
        "maxConnectionAge": 0,
        "maxIdleTime": 0,
        "maxIdleTimeExcessConnections": 300,
        "maxPoolSize": 100,
        "maxStatements": 100,
        "minPoolSize": 5,
        "numHelperThreads": 8,
        "testConnectionOnCheckout": false,
        "unreturnedConnectionTimeout": 0
      },
      "StreamProcessorSettings": {
        "maximumBlockSize": 2500,
        "maximumQueueSize": 250000,
        "maximumWaitTime": 10000,
        "numberOfProcessingThreads": 5,
        "scanRate": 5,
        "sizeThreshold": 1000
      },
      "ValueStreamProcessorSettings": {
        "maximumBlockSize": 2500,
        "maximumQueueSize": 500000,
        "maximumWaitTime": 10000,
        "numberOfProcessingThreads": 5,
        "scanRate": 5,
        "sizeThreshold": 1000
      },
      "PersistentPropertyProcessorSettings": {
        "maximumBlockSize": 2500,
        "maximumWaitTime": 1000,
        "maximumQueueSize": 100000,
        "numberOfProcessingThreads": 20,
        "scanRate": 25,
        "sizeThreshold": 1000
      }
    }
  }
}
slangley
23-Emerald II
(To:mmancin)

Hi @mmancin.

 

Looks like you sent the wrong file.  In your script, you are referencing settings.json.  That is the one we need.

 

Thanks.

 

--Sharon

{
	"whiteListExternalModules": [
		"request",
		"lodash",
		"soap",
		"xml2js",
		"ws",
		"math",
		"mathjs",
		"math.js",
		"ptc-apiai-connector",
		"ptc-aws-connector",
		"ptc-azure-connector",
		"ptc-bitly-connector",
		"ptc-box-connector",
		"ptc-clock-connector",
		"ptc-dropbox-connector",
		"ptc-dynamics365-connector",
		"ptc-devtools-connector",
		"ptc-excel-connector",
		"ptc-file-connector",
		"ptc-ftp-connector",
		"ptc-flow-sdk",
		"ptc-github-connector",
		"ptc-gitlab-connector",
		"ptc-google_form-connector",
		"ptc-google_gmail-connector",
		"ptc-google_drive-connector",
		"ptc-google_sheet-connector",
		"ptc-google_task-connector",
		"ptc-google_translator-connector",
		"ptc-ILMconnector-connector",
		"ptc-jira-connector",
		"ptc-odata-connector",
		"ptc-oslc-connector",
		"ptc-office365-connector",
		"ptc-onedrive-connector",
		"ptc-pubnub-connector",
		"ptc-rockwell-connector",
		"ptc-rss_feeds-connector",
		"ptc-salesforce-connector",
		"ptc-sap_odata-connector",
		"ptc-sap_rfc-connector",
		"ptc-servicemax-connector",
		"ptc-slack-connector",
		"ptc-soap-connector",
		"ptc-swagger-connector",
		"ptc-thingworx-connector",
		"ptc-thingworx_mapper-connector",
		"ptc-trello-connector",
		"ptc-twilio-connector",
		"ptc-usgeocoder-connector",
		"ptc-windchill-connector",
		"ptc-youtube-connector",
		"ptc-zendesk-connector",
		"ptc-webtools-connector",
		"ptc-database-connector"
	],
	"whiteListBuiltInModules": [
		"assert",
		"crypto",
		"path",
		"buffer",
		"events",
		"fs",
		"http",
		"https",
		"punycode",
		"querystring",
		"string_decoder",
		"url",
		"zlib",
		"math",
		"mathjs",
		"math.js"
	],
	"copyProhibitedConnectors": [
		"azure",
		"excel",
		"ftp",
		"rockwell",
		"odata",
		"sap_odata",
		"sap_rfc",
		"soap",
		"swagger",
		"thingworx",
		"windchill",
		"dynamics365",
		"integrity",
		"zendesk",
		"twilio",
		"database",
		"oslc"
	]
}
slangley
23-Emerald II
(To:mmancin)

Hi @mmancin.

 

Is it possible that you got an error on upload?  If you're not sure, try it again and let us know.  In the meantime, I'll work on setting up my environment to be able to test it.

 

Regards.

 

--Sharon

Top Tags