Do I need two different PartnerLinks for two different calls to the same Web Service in BPEL? - bpel

If I want to make two parallel calls (in one flow activity) to the same web service in BPEL, do I need to create two different PartnerLinks or can I use the same one?

You can invoke the same partnerLink multiple times in parallel in the same flow. You do not need to define a new one.
If you expect a result from the invocation, you need different outputVariables, however. If you write to the same variable in parallel, you will have race conditions just like in any other programming language.

Related

Azure Datafactory V2 - IfCondition activity cannot include another IfCondition activity

I'm using Azure Data factory V2 and I need to implement two levels of checks with in a parent check validation. example: IF Condition one is true Then I need to check for Condition 2. And, If Condition2 is True then Check for Condition 3.
It's kind of hierarchical checks. When I implement using multiple IF Condition activities within parent IF condition activity, then it doesn't work. I do see following error, when i implement it.
"ERROR: IfCondition activity cannot include another IfCondition activity"
ADF- V2 doesn't support multiple IfCondition activities with in a single pipeline.
So as a workaround, we used multiple filter activities upfront and split the pipeline flow before IfCondition Activity is invoked.
Thanks
You can use some of the dynamic functions to implement a more complex logic with and() and or().
You can put several continuous if's that set up variables, and use those variables to determine the outcome at the end.
And if that doesn't work for you, or you don't feel like it, you can always Execute a Pipeline inside of the If that uses another If Activity. But I wouldn't recommend this if you want to keep your monitor as easy to read as possible since it launches another pipeline (or more than one)

Cucumber reuse value from previously run scenario

I am trying to reuse a value that was created during the previously run scenario. I am not sure if there is a way in cucumber to make a value available across scenarios.
For instance:
1st scenario:
Given inputOfA
When A is created
Then A is returned
And A contains an Id
2nd Scenario:
Given IdOfA
When customer gets A by Id
Then A is returned.
For the 2nd scenario, it would be great if I can get the Id created from the first without having to persist it anywhere.
Can any of you let me know if this is possible using cucumber or do I have to persist the Id created in the first scenario?
This is not something you want.
It would require the scenarios to be executed in a specific order. The scenario execution order isn't specified. It may even be random.
What you want scenarios that are independent. Scenarios you can execute in any order.
If you want to use the result from one scenario in a future scenario, you want to setup the second scenario to execute the same thing as the previous scenario should have done. This may feel like duplication and maybe it is. But the usage of BDD is to drive the implementation. The first scenario was used to drive some behaviour. The second scenario should be used to drive another behaviour.
It is possible that the first scenario can be deleted when the second is implemented. If it is redundant, remove it.
But whatever you do, avoid the path of scenarios that depends on each other. It will only lead to a bad place with seemingly random errors occurring.

Send one of multiple parameters to REST API and use it

I use MEAN stack to develop an application.
I'm trying to develop a restful API to get users by first name or lastname
Should I write one get function to get the users for both firstname and lastname?
What is the best practice to write the URL to be handled by the backend?
Should I use the following?
To get user by firstname: localhost:3000/users?firstname=Joe
To get user by name:localhost:3000/users?firstname=Terry
And then check what is the parameter in my code and proceed.
In other words,What is the best practice if I want to pass one of multiple parameters to restful API and search by only one parameter?
Should I use content-location header?
There is no single best practice. There are lots of different ways to design a REST interface. You can use a scheme that is primarily path based such as:
http://myserver.com/query/users?firstname=Joe
Or primarily query parameter based:
http://myserver.com/query?type=users&firstname=Joe
Or, even entirely path based:
http://myserver.com/query/users/firstname/Joe
Only the last scheme dictates that only one search criteria can be passed, but this is likely also a limiting aspect of this scheme because if you, at some time in the future, want to be able to search on more than one parameter, you'd probably need to redesign.
In general, you want to take into account these considerations:
Make a list of all the things you think your REST API will want to do now and possibly in the future.
Design a scheme that anticipates all the things in your above list and feels extensible (you could easily add more things on to it without having to redesign anything).
Design a scheme that feels consistent for all of the different things a client will do with it. For example, there should be a consistent use of path and query parameters. You don't want some parts of your API using exclusively path segments and another part looking like a completely different design that uses only query parameters. An appropriate mix of the two is often the cleanest design.
Pick a design that "makes sense" to people who don't know your functionality. It should read logically and with a good REST API, the URL is often fairly self describing.
So, we can't really make a concrete recommendation on your one URL because it really needs to be considered in the totality of your whole API.
Of the three examples above, without knowing anything more about the rest of what you're trying to do, I like the first one because it puts what feels to me like the action into the path /query/users and then puts the parameters to that action into the query string and is easily extensible to add more arguments to the query. And, it reads very clearly.
There are clearly many different ways to successfully design and structure a REST API so there is no single best practice.

posting to same URL but using 2 different functions

a portion of my application involves creating tests (i.e., picking x-number of questions from a filtered set of questions). The user is able to determine how big they want the test but to do so I need to calculate on the server how many questions are available. The function which creates the test is sent through this post:
app.post('/user/create_test', users.create_test);
As the user changes filters, I would like to determine the number of questions available... All I can think of is to use AJAX post to send the filter information but it will be passed to the same function as creating a test would... is there any way to post to the same URL but determine which function you execute?
Consider creating another function. - The best way to do Restful API's.
Consider renaming to app.post('/user/test').
The second function could be app.post('/user/test/filters').
Or make a single POST request and make sure your function does both creating and filtering.
In general, the design of the app lacks maturity. Rethink the client-server communications.

Looking for a network-accessible hash table

I have a data acquisition application broken into a client and a server.
The server is reponsible for grabbing data from the hardware, running some realtime analysis, and recording the data to disk when it's asked.
The client is a GUI that the operator can use to look at some pretty graphs (generated by the server), set some parameters, and turn recording on and off. It's usually run on the same machine as the server, but can be run from any other machine on the network.
Both are written in Qt (C++). Both are used on Linux.
The communication between the two is currently done with a homegrown library (in C++, but not Qt) that is essentially a hash table. The server has a list of parameters, like analysis.graph.width, and those parameters can be set and get by both the server and client(s).
The system is being redesigned to support new hardware, and now is a good time to replace this library if something better exists. Here are some requirements:
Ideally would play well with Qt (using QVariant to store values, using signals/slots)
Must allow values to be many different types (integers, strings, doubles, bools, lists of those)
Keys will be strings
Must be fast, allowing set/get operations up to 30 times per second
Must allow multiple clients to set/get parameters simultaneously
I found this list: http://en.wikipedia.org/wiki/Structured_storage, but the libraries listed there seem too complex (distributed, mirrored) or not cabable enough (values can only be strings).
Is anyone aware of libraries that would fit some or all of the requirements?
Well Dave I have had used redis for the same problem. It doesn't meet all your requirements but meets
Must allow values to be many
different types (integers, strings,
doubles, bools, lists of those)
Keys will be strings
Must be fast, allowing set/get
operations up to 30 times per second
Must allow multiple clients to
set/get parameters simultaneously
You can use the c/c++ api to communicate with redis. How to use Redis within a C++ program? ... yes you will have to convert datatypes from one to another say char* to QString etc.

Resources