Can APEX call a code on a dedicated server?
Then Pass and retrieve variables?
Of course I need to pass a password for the server,
Thanks
This is only possible via WebServices (HttpRequest). Here's a simple example: http://boards.developerforce.com/t5/NET-Development/How-to-call-net-web-service-from-salesforce/td-p/134795
Related
So im building app based on Express and using Prisma ORM. What i need is to SSH to a server, open up express.js console and create new db entry using prisma. Something similar to python manage.py shell for Django or rails console for Rails. Is there a solution for this of any kind?
Like I pointed in the comment there is a way ( kind of ) to get access to a running express instance. If that's all you need follow:
How can I open a console to interact with Express app?
Express doesn't exactly have a feature like rails console which is a framework feature in that case.
That said, I question the long term implication of this approach. If you really just need to seed some data, write an "init" script, and call it after you ssh into a server or using some CI/CD approach. This is more re-usable, since you can even pass a json file to the script to load dynamic data.
Also, Prismajs has an official way to seed the data ( if that's what you need) that you can leverage:
https://www.prisma.io/docs/guides/database/seed-database
UPDATE:
If you are able to run to code on your machine and point the remote database, then you can use node --inspect to debug in a chrome console. Which should give you about the same effect as a rails REPL
https://medium.com/#tbernardes/debugging-nodejs-with-chrome-inspector-devtools-1cd2ef323b5e
I need to display all existing environment variables for snapshots installed on BPM. Is there a way I can do this using the wsadmin command ?
I don't think we have a wsadmin command to display all existing variables for a snapshot. If this is something that would be useful, I would suggest opening a Request for Enhancement(RFE) with BPM development for their consideration. Here is a link on how to do this:
https://developer.ibm.com/answers/questions/175980/how-do-i-submit-an-enhancement-request-or-rfe-for.html
Thanks!
I agree with Paula, there is no wsadmin cmd to display env variables.
However, you can check out:
BPMSetEnvironmentVariable:
https://www.ibm.com/support/knowledgecenter/SSFPJS_8.5.6/com.ibm.wbpm.ref.doc/topics/rref_bpmsetenvironmentvariable.html
And REST call to get env variable:
https://www.ibm.com/support/knowledgecenter/SSV2LR/com.ibm.wbpm.ref.doc/rest/bpmrest/rest_bpm_wle_v1_system_env_variable_get.htm
This can be achieved by the BPM REST Interface APIs.
Use this API to retrieve the list of process applications, in which you can find the ID of the snapshot you are interested in.
https://<bpm_host_or_ip>:9443/rest/bpm/wle/v1/processApps
Use this API to retrieve the envrionment variables and their default values.
https://<bpm_host_or_ip>:9443/rest/bpm/wle/v1/processAppSettings?snapshotId=2064.11a398d0-c6b8-41e4-b8eb-daaef864be14"
You can easily use jq in a Linux environment to parse out the information you are interested in.
Finally use this API to retrieve the current value of a given environment variable.
https://<bpm_host_or_ip>:9443/rest/bpm/wle/v1/system/env/variable?processAppAcronym=<APP_ACRONYM>&name=<ENV_VAR_NAME>
I'm using Laravel 5.2.29 and I've set up some scheduled commands.
One of them uses some methods used in my app through normal use (i.e., via a browser) and so the session is accessible.
However, when I try and run the command manually using artisan schedule:run, I get the following exception:
Session store not set on request.
The Session isn't being set (I suppose in the same vein as if a route were accessed without the web middleware), so is there a way to manually boot up the Session? I'd rather not rewrite my methods to not use it.
You don't have access to the session in CLI. Session is strictly connected with the web browser (client side) which doesn't make sense in command line.
If You need a local storage (for server side) You can try with cache driver.
I am new to Mule and I have been struggling with a simple issue for a while now. I am trying to connect to flat files (.MDB, .DBF) located on a remote desktop through my Mule application using the generic database connector of Mule. I have tried different things here:
I am using StelsDBF and StelsMDB drivers for the JDBC connectivity. I tried connecting directly using jdbc URL - jdbc:jstels:mdb:host/path
I have also tried to access through FTP by using FileZilla server on remote desktop and using jdbc URL in my app - jdbc:jstels:dbf:ftp://user:password#host:21/path
None of these seem to be working as I am always getting Connection exceptions. If anyone has tried this before, what is the best way to go about it? Connecting a remote flat file with Mule? Your response on this will be greatly appreciated!
If you want to load the contents of the file inside a Mule flow you should use the file or FTP connector, i don't know for sure about your JDBC option.
With the File connector you can access local files (files on the server where mule is running), you could try to mount the folders as a share.
Or run an FTP server like you already tried, that should work.
There is probably an error in your syntax / connection.
Please paste the complete XML of your Mule flow so we can see what you are trying to do.
Your usecase is still not really clear to me, are you really planning to use http to trigger the DB everytime? Anyway did you try putting the file on a local path and use that path in your database url. Here is someone that says he had it working, he created a separate bean.
http://forums.mulesoft.com/questions/6422/setting_property_dynamically_on_jdbcdatasource.html
I think a local path is maybe possible and it's better to test that first.
Also take note of how to refer to a file path, look at the examples for the file connector: https://docs.mulesoft.com/mule-user-guide/v/3.7/file-transport-reference#namespace-and-syntax
If you manage to get it working and you can use the path directly in the JDBC url, you should have a look at the poll scope.
https://docs.mulesoft.com/mule-user-guide/v/3.7/poll-reference
You can use your DB connector as an inbound endpoint when wrapped in a poll scope.
I experienced the same issue when connect to Microsoft Access Database (*.mdb, *.accdb) using Mule Database Connector. After further investigation, it's solved by installing Microsoft Access Database Engine
Another issue, I couldn't pass parameter to construct a query as same as I do for other databases. e.g.: SELECT * FROM emplcopy WHERE id = #[payload.id]
To solve this issue:
I changed the Query type from Parameterized into Dynamic.
I generated the query inside Set Payload transformer (generate the query in form of String, e.g.: SELECT * FROM emplcopy WHERE id = '1').
Finally, put it into the Dynamic query area: #[payload]
I connect to a remote sqlserver database using the jdbc service. My apps script has my password and userid. Is there a security risk involved. I ask because javascript is open to inspection; are app-scripts open to users?
What is the best way to get that secure information into an app?
Even hard coded values don't show up in the javascript when rendered by the browser. That is because all the code that you write runs on the server side (except client handlers).
However, if you share a script or spreadsheet with the script with another user, the code is visible to the other user.
You can store your username and password in a spreadsheet that only you have access to and read from there during runtime. However, ensure that the script runs under your id (i.e only published as a web app).
Use the UserProperties service. It's values are only available to you and if you decide to make the application multi-user, you could even direct users to store their unique sql username/password in their own UserProperties.