0
Respost

Executing javascript (question and ideas)

playsted fa 8 anys en Server / Execution updated by Pieter fa 8 anys 6

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.


execution server workflow
Answer
Pieter fa 8 anys

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.

0
Respost

Workflow Persistence

playsted fa 8 anys en Server / Execution updated by anonymous fa 8 anys 1

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

execution service workflow
Answer
anonymous fa 8 anys

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

0
Fixed

File already exists

Anònim fa 8 anys en Server / Execution updated by Gandalf fa 8 anys 1

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

service execution tool
Answer
Gandalf fa 8 anys

1. Open c:\windows\temp

2. Delete *.tmp files


Windows workflow foundation creates these files at run time when certain tools are executed.

0
Respost

Format Number tool giving error on valid numbers!

Kyle TFL fa 8 anys en Server / Execution updated by Gandalf fa 8 anys 3

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.


execution tool workflow
+2
Respost

Executing Warewolf service in javascript

Henry Jones fa 9 anys en Server / Execution updated by Gandalf fa 9 anys 3
Hi,

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
web execution
0
Completat

fire and forget

Paul Cannell fa 10 anys en Server / Execution updated by Gandalf fa 10 anys 1
When performing a longer running activity such as file processing id like to fire off the workflow. Have it return to me as the called immediately. Then internally it can email me / whoever when its complete. At the moment the call to the workflow is blocking.
0
Completat

singleton vs single call

Paul Cannell fa 10 anys en Server / Execution updated by Gandalf fa 10 anys 0
If you think back to .net remoting you'll prob need to read no further but in case you missed that "fun" time read on.

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
Answer
Gandalf fa 10 anys
Hi Paul

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.

Answer
anonymous fa 10 anys
All workflows are re-usable via the Explorer in the Studio.
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.
0
Respost

How do I turn off security?

Anònim fa 10 anys en Server / Execution updated by Gandalf fa 10 anys 0
Im working at home and my network is secure, I dont want to have to set permissions on everything all the time.
Answer
Gandalf fa 10 anys
From release 0.4.2.3 onwards we have introduced a Public group.

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.
+2
Respost

Can I return json from a service call?

Chas Digal fa 11 anys en Server / Execution updated by Gandalf fa 11 anys 1

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

service execution
Answer
Gandalf fa 11 anys

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=...