Or leave us a private message
Executing javascript (question and ideas)
What javascript execution engine is used? I have having issues with scripts as some functions are not working properly.
Problem 1:
"testString".endsWith("g");
is valid javascript and works with node and browsers. This should return true.
However running this as a script in a workflow results in an error due to it not being a function.
Problem 2:
If I use variables in the script the strings are not escaped.
Variable:
[[testPath]] = "C:\test"
In script:
"[[testPath]]" => "c:est"
Suggestions:
I think it would be very powerful to use node.js as the javascript execution as it is so widely used. Edge.js is a c# library that allows node to easily be executed from .Net. I haven't researched it much but may be an option.
As far as escaping strings you could predefine them all on a javascript object that the script runs in. Instead of using [[varName]] we could just use $ww.varName if we use $ww as the example object that Warewolf populates. This would take care of string escaping problems and even allow complex objects to be manipulated as expected while coding javascript.
Hi Playsted,
We will look into updating the library in a coming version.
Thanks for the suggestion and thinking on this we will definitely consider it.
Workflow Persistence
Hello,
Is workflow state persisted? Can long running workflows (for example if waiting for user interaction/approval) be resumed on server restart? I know workflow foundation supports this (if enabled) but didn't see any specifics in documentation.
Thanks
Hi Playsted,
We have moved away from using the Workflow Foundation engine and in doing so we did not have an immediate requirement from any of our customers to support workflow persistence, and so we did not implement it. So at present there is no state persistence in Warewolf, however should the requirement arise in the market then we can implement it.
Thanks
File already exists
When trying to write a file, I keep getting the error: File already exists.
This was working before as the tool is set to overwrite and nothing has changed, it just stopped working.
version 0.6.0.301
windows 10
1. Open c:\windows\temp
2. Delete *.tmp files
Windows workflow foundation creates these files at run time when certain tools are executed.
Format Number tool giving error on valid numbers!
Hi
Im passing a recordset of numbers into the Format Number tool and I keep getting an error in the debug: One of the identified items was in an invalid format.
Everything works until I start passing in decimal numbers, regardless of if I try and round them or not.
I have checked my computer regional settings and they are correct for the numbers I am using e.g. 200.0876 and regional settings says use a full stop . for Decimal Symbol.
I dont know what else to do, please help.
Executing Warewolf service in javascript
I saw the example for executing a warewolf service using Javascript in the examples folder. However i tried doing it using jQuery as so
<script type="text/javascript">
function execution() {
var wareWolfUrl = "http://localhost:3142/services/Hello World.json
$.ajax({
type: "GET",
url: wareWolfUrl,
cache: false,
success: function (response) {
console.log(response);
},
error: function (errorThrown) {
console.log(errorThrown);
},
complete: function (e) {
console.log(e);
}
});
}
</script>
i am getting the following error:
XMLHttpRequest cannot load http://localhost:3142/services/Hello%20World.json? No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:23128' is therefore not allowed a... response had HTTP status code 401.
Am i doing something wrong or is the way in the sample the only way that the service can be executed.
Thanks
fire and forget
singleton vs single call
I have a recordset with X rows.
I need to perform some validation for each one to decide whether to exclude this record at this point (carrying on would result in failure)
Hypothetical
in my recordset is a return code. I then need to decide based on this code whether to proceed. lets assume of all 10 return codes 3 will allow the process to continue the other 7 are considered failure.
I create my service that takes in a code and then gets a list of statuscodes and the resulting action.
I then call this service for each entry in my recordset. If that services has to goto the DB each time its going to be a perfomant dog. If however it were to cache the results (as we do in code all the time - think lookup date bank names, branch codes, post codes etc) it would make performance much better
So what Im asking for is a services that is created but doesnt get collected once its been used. Singleton vs SingleCall
If this exists plz point me in the correct direction
Excellent question.
You are correct, performance would be a dog. The best design to handle this is to create your validation workflow to accept recordsets Inputs and return recordset Outputs (rather than scalars and then putting it inside a for each).
In this way you can map the entire recordset with next to no overhead into the validation workflow, do one db call and then handle the iteration between records inside that workflow.
You just need to drag it from the explorer onto your new workflow to re-use it.
Be sure to map your inputs and outputs when re-using a workflow.
How do I turn off security?
It is not a windows group, its internal to Warewolf.
1. Open Security Settings
2. Under the Windows Group heading, you will see a Public group.
3. Give this group Administrator rights.
4. Click Save
Any user can now do anything on that Warewolf.
Can I return json from a service call?
Most API's these days allow a variety of return types. What types can I offer without having to build it into everything I do and still have it as XML
You can return XML or JSON. By default the system will return XML from any service call. The caller can define the response type as json by placing a .json after the name of the service they are calling. eg
http://127.0.0.1:1234/services/BringBackTheATeam.json?VoteMail=...
Servicio de atención al cliente por UserEcho