biztalk: using first node xml file to decide what map to use - xslt

I have a problem in my project i have to create orchestration and base o first node of xml file i have to decide what map will be use. Any idea how to do it?
I try to use decide shape and in decide shape use xslt query to find first node equal particular node decide shape will send it to particular map.
is that a good approach?

Here's some suggestions:
If the schema can be resolved by the XmlDisassembler, the engine will apply the matching Map on the Receive Port automatically.
If the number of different Maps is manageable, say 4 or 5, and very unlikely to change, then sure, the decide shape is a workable approach.
Be sure to carefully examine the differences in the Maps. I've had times when the planners believed the maps were significantly more different then in reality. If the difference is a handful of differing codes or conditional fields, maybe one Map can handle all cases.

Another option that would use a receive location for each type of message would be to use a Listen shape in the orchestration. Each branch of the listen would be expecting a different message type (or root node as you put it) and you could apply the appropriate map. Then, assuming you are mapping to a canonical schema, the rest of the orchestration would be the same regardless of input message type.
In the image the orchestration is using a listen shape to listen for 3 types of message. It's mostly for replay-ability for when the orchestration fails at different stages, I can inject it back into the flow after a fix is made.

Related

How to check for an internal edge via TraCI?

I am trying to figure out whether an edge/lane is internal. When SuMO creates internal edges/lanes, it prefixes them with a colon [1]. Currently, I am exploiting this information, however, it seems that you also can annotate arbitrary other edges as internal using the tag function. This is also set for internal edges created by SuMO [1]. Therefore, I want to retrieve the information via TraCI.
To my knowledge, there is no TraCI command to retrieve this information (i.e. either the value of function or whether the edge/lane is internal).
The classes MSEdge and MSLane in the microsim directory have methods to retrieve both of those values, however, the classes Edge and Lane from libsumo do not.
I also checked whether the value of the function tag might get added to the parameter map during initialization, which I could access via TraCI's getParameter. This also does not seem to be the case. I checked some files from the netimport directory but could not find anything satisfactory.
Is there any other way to retrieve the function/isInternal information via TraCI without adding a new TraCI command (and the aforementioned missing methods in libsumo)?
This is a static property of the network so the easiest way of retrieving the information is to parse the network. In Python you can use sumolib for that:
import sumolib
net = sumolib.net.readNet("my.net.xml")
function = {}
for e in net.getEdges():
function[e.getID()] = e.getFunction()
There is currently no TraCI call for that but the colon thing is a very good indicator. The main developers are also a bit reluctant to add all static information retrieval to the TraCI API in order not to overload it.

How to add an element to WS-operation in consumer end for 1 provider when there's other providers?

I have authored a WSDL and the consumer/client that implements operation AddCar that has data for model and colour. Now one WS producer/server wants to also have data for length. I assume that other producers have difficulties to adapt to this change due to implementation outsourcing. My options include:
Make new operation AddCarWithLength
Make 2 versions of WSDL and consumer code with same operation
Just update the WSDL with optional length and include it operation data only for producer that wants it.
Just update the WSDL with 0-N name-vaue pair elements and include it operation data only for producer that wants it.
Demand customers that they get the company that implemented the WS producer to update it.
Options:
is out of the question
I have generated C# classes in consumer/client so there would be two code sets. i still would have to know (maybe with config parameter or smthn) which version producer/server uses
Means that I only have to know which producer/server i talk with.
Same as 3 but would allow future extensibility
Can be problematic
Question:
What is the correct / best way to do this when demanding all producers to be updated can be unrealistic?
WSDL are known for the precious definitions. At first services should always designed with a clear picture of usage and future in mind. Anyhow, now my understanding is adding a attribute (data element - length) to your existing WCF service. My suggestion would be,
Analyse and add a custom class of yours and name it as a data contract and add to your WCF operation and expose it as a new interface / operation contract.
Eg.
with in Class car , have a data member as Properties.
With in properties define all your analysis result elements like, length, width, color, weight etc.
Also add a Dictionary<string,string> CustomAttributes; so in future you can use it.
Similar to above, but if you don't have much time.
with out any analysis just add a Dictionary<string,string> Parameters; and expose a new contract and utilize that.

modeling self referencing nodes in EMF and edit them with ECP

I'm trying to model a network with EMF.
The network should be made up of nodes connected to each other.
Each node should have one or many connections to the others, like a mesh network.
The model should be editable by the EMF Client Platforms (ECP) Demo Application.
When the user creates nodes, in ECPs model-explorer, he/she can set the connections to the other nodes, preferably in a list.
First try was a self-reference, but the problem is there are no bidirectional self-references. This results in, not seeing the connection from the opposite node.
My next idea was to use an intermediate connection class, which leads to another problem. I would like to create this connection automatically without a connection class appearing in the model-explorer. Which would be possible to achieve in the generated EMF viewer, but not in the ECP demo application I'm using.
Third Idea: The only way I can think of solving the last idea, is using a tableControl in the view of the node, to edit the connection class in there. But then the problem with hiding the connection class in the model-explorer remains and the connection class appears in the project folder (highest level) and not in their containing class (in my case a network class).
Doe's anyone have some ideas, how to solve any of my problems?
edit: additional information
The connections between the nodes are by definition full duplex.
And the graph should afterwards be used as input for a shortest path algorithm.
Your first try is the good one. Actually, you can model opposite in Ecore. To do so, you have to model two EReferences towards the same object (so two reflexives references), then set the property eOpposite of one of your EReference to the other one.
Here is a simple metamodel with the eOpposite set: https://repository.genmymodel.com/vincent.aranega/NodeGraph
In the Ecore-XMI, it looks like this (note the eOpposite value):
<eStructuralFeatures xsi:type="ecore:EReference" xmi:id="_pwXZhv1pEeW9zv77lynsJg"
name="references" upperBound="-1" eType="#_pwXZg_1pEeW9zv77lynsJg" eOpposite="#_pwXZiv1pEeW9zv77lynsJg"/>
<eStructuralFeatures xsi:type="ecore:EReference" xmi:id="_pwXZiv1pEeW9zv77lynsJg"
name="relatives" upperBound="-1" eType="#_pwXZg_1pEeW9zv77lynsJg" eOpposite="#_pwXZhv1pEeW9zv77lynsJg" />
With this metamodel, you are able to create a Graph that contains many Node. Each node can reference other nodes. If a Node A as a reference to another named B, the relatives collection of B is automatically updated with A.

Clojure - component and names

I am trying to understand Stuart Sierra's component, specifically the naming convention for the components in order to structure a Clojure application.
If I look into system for instance, I see several components mapped to the :server key :
aleph
immutant
Since both use the same key :server, does that mean that I can only use one of them if I use this library ?
Similarly, I use onyx. Several components are already defined inside onyx system.clj.
Does that mean that some keys are effectively reserved by onyx ?
What will happen to the :port parameter, which seems to be used by many components in the wild ?
Questions
What is get the difference between the keys used when associng in the start method and the keys used in component/system-map ?
Is there a naming convention for those keys, how do we avoid collisions between those keys ?
In which cases (if any) does it make sense to have several systems and can they run at the same time ?
Keys in the system map identify specific components (instances) in that system. You can use whatever key you like for whatever component you need.
Keys in a specific component record can be one of three things:
a configuration value set up at creation time
some internal value that is irrelevant to the user of the component
a dependency (which will refer to another component when the system is started)
1 and 2 are generally set up by the component constructor and users do not need care about the actual key used in the record.
Dependencies are configured by setting a mapping on the depending component from the dependency key (3) to the key in the system map referring to the dependancy component. This is done with the component/using function and giving it a map of component keys to system-map keys as the second argument. That way you can always map any expected key to any actually used key. You can use the short-hand form of component/using with a vector of keys, but only if the keys in the system-map are the same as the keys in the component you're configuring.
I hope that answers the first two questions
The third question I think I'd like to see an example of what you're looking for as a separate post
The last question: yes you can have multiple systems running at the same time. That may or may not make sense depending on what you want to do, but running a test system as well as a development system seems like a fairly obvious setup.

How to see if all data structures dependencies are solved?

Lets imagine demo situation that we have such simple structure
struct service
{
std::string name
std::set<std::string> depends_on_service_name;
};
We have some raw data (text file, io stream or what ewer) coming into our parser that turns it into service struct instances and puts them into std::map<service> services we need a way to chack if all map items have all there depends_on_service_name resolved (meaning there shall be services[item].name in map for each service[other_item].depends_on_service_name). Is there any standart way to check for such things in boost of manual for_each is the way to go each time parser appends new item(s) into map?
The "way to go" here is to solve this problem during input verification and abstraction. You are representing a directed (probably acyclic) graph with the service map, and you should represent it as such (e.g. using Boost.Graph) instead of rolling your own graph structure with sets and maps. While you are building this explicit graph structure, missing services will naturally be discovered.