Dynamically Selecting Map in Logic App - azure

I am trying to build a logic app that receives incoming X12 EDI messages. I have an integration account set up and an agreement created. However, I don't see a way to associate a map with an agreement. It seems I have to hard code this in the logic app which would mean one logic app for each trading partner document type. Surely there is a way to select maps based on sender, receiver and document type. This is basic functionality for other EDI packages but I don't have a clue with logic apps.

Not sure whether there is a better way, but you can specify the map name at run time.
Then, as you are already using an integration account, you can externalise Business Rule using liquid templates, as explained here: https://blog.mexia.com.au/business-rules-on-azure-logic-apps-with-liquid-templates
You could pass some metadata about the trading partner to the liquid template, and then return the name of the map and use it in the mapping action.
HTH

Actually, this is almost as easy as BizTalk Server* ;)
Since the Map Name can be composed at runtime, you can upload your Maps using a set pattern, for example [SenderID] + "_" + [MessageType] -> "CONTOSOSID_810"
Then Initialize a Variable set to [SenderID] + "_" + [MessageType] and use that as the Map parameter to the Liquid Action.
Important Point: Every output of the X12 Decoder can loop so you may have to manually index the paths in the Initialize Variable depending on if/how you're debatching the transactions.
*BizTalk Server automatically resolved the Map based on the Party's message Type which you could use here, just that the names are a bit messy.

Related

Azure Maps Indoor Module: Change floor without user input

I've been working with the Azure maps indoor module https://learn.microsoft.com/en-us/azure/azure-maps/tutorial-creator-indoor-maps . You can allow a user to pick a level with a level control element from the library, however I cannot figure out a way to pre-set a certain level (e.g. I want to start with a certain facility and the 2nd level pre selected when the map loads.) For the facility there is a indoorManager.setFacility() function that allows you to select a facility but I have not found the equivalent for the level.
Requirement: I want to to select a level in Azure Maps without user input.
There doesn't appear to be any official way to do this yet, note that Azure Maps Creator is still in preview. That said, I did figure out a hacky way around this (may break in the future).
var facilityId = 'FCL13';
var level = 2;
//Set the facility and the levels "ordinal number". The ordinal number appears to be off by 1.
indoorManager.setFacility(facilityId, level - 1);
//Used to trigger the level control to refresh.
map.events.invoke('moveend')

How to group API calls in API-Management's Developer Portal

In the API-Management's Developer Portal, we have the problem that all Operation (API) calls are listed in a long list, making it difficult for our customers to find out what calls that belong together. What we'd like is the possibility to group calls by something, i.e. the controller name. (In Swagger this can be done by using the tags field in the Swagger specification.)
In the templates section, there's an option Operation list (grouped), which, by the name of it, might be able to solve our problems. But how can I use this template?
I'm currently importing the API list using the OpenAPI specification.
Update 1:
This is what it looks like in a sample operation list for us. There's no search box available.
(grouped) template is used when user selects "Group by tags" option - rightmost button next to search field on APIs/operations list. Here is how it looks on UI:

Need clarification on creating Tasks in Asana

The documentation for tasks seems to imply that the POST method uses name/value pairs as the data payload (I'm assuming for a content type of application/x-www-form-urlencoded). Can it accept JSON instead, using the same format as the data returned from a GET call for tasks?
Also, the Memberships field is supposed to contain an array of projects and sections. There's already a Projects field for a task - do those projects need to be duplicated in the list of projects for Memberships or can just the sections be included?
Yep, it's totally possible to use a JSON payload (with the correct Content-Type: application/json) - in fact, in a number of scenarios - like this one - it's considerably easier.
I don't recall off of the top of my head the right way to get this going with form data (if I recall, we might have an outstanding bug filed about it :) ), but with JSON, you should be fine if you specify the project in both locations. I don't think you can get away with not specifying any values in projects (unless you specify a workspace, which might work).
I don't think you can specify only the section. Finally, I think if you specify a different project in each location, it will put it into both: into projects in the "no section" area for whichever ones are in the projects property and put it in the specified sections for those specified in memberships

Shopware 5 accessing controller variables (Template Variables) on frontend

The technical term given in many articles for this is Template Variables. I am trying to understand how we can find the variable name given in the controller for a specific field of Shopware 5 front end (ex. Product Name)
For example, I can see the template variable for article name has been given as $sArticle.articleName. I found this when I checked the source code manually.
Let’s say I want to find the discount value given for particular product, How can I print this on my theme? What variable I should use and what is the easy way to find it.
I can assign values from back end for all the variables but my question is how I can access them on my theme file when I update my theme when it comes to technical development side.
Please Note: I am trying to understand the shopware5 technical side.
Using the {debug} function will usually give you a list of all assigned variables. This list should also include a variable $Controller which will give you a hint to the currently related Controller.
Unfortunately you are not able to identify where the assigned variables come from. Due to the event driven architecture of Shopware the variables can be assigned to the view after the request has been dispatched to the related Controller. This means that variables might he assigned through third party plugins as well as specific event listeners and store front decorators (in Shopware 5).
Kind regards!
If you want to use your variables inside the template you have to write a plugin and assign your controller-variables to the view.
Check out Globale Variablen im Template verwenden in the shopware documentation.
If you want to use see which variables are allready assigned, you can use {debug} in the template. Also {$sArticle|var_dump} is really helpful, if you want to debug a specific variable ($sArticle} in this example).
You have to known that shopware assigns the members of an object to the view.

LIFERAY - how to create a user with a specific userID?

I'm using Liferay 6.2.
My need is to add one user in LR, with a specific userID.
Or alternately, update a userID with another value.
The standard addUser service does not provide the possibility to specify the userID, and even the updateUser.
I would like to understand how LR choose the IDs for a new user, and if I can modify it.
thanks!
Like in almost any database driven application they're assigned in sequence. And no, you don't have to choose anything, it'll be taken care of by the framework. It needs to be unique, you can't add another user with the same ID and you must be sure that the user with this id will never be created in future. Thus: If you'd use an id that has already been given out, you'd have a duplicate. If you'd use one that has not yet been given out, you'll have a duplicate some time in future, when the sequence of ids comes to this value and the framework assigns the same id for the second time.
If you have an architecture that relies on a specific ID, your architecture is wrong. Rethink the problem and change the architecture and whatever you've already done to implement it.
LR core services use a CounterService to automatically assign UserId (and plugin developer should do the same)... so all the generating code is properly wrapper in the service methods that creates a number of rows in different tables when creating a user.
I agree with previous comment "If you have an architecture that relies on a specific ID, your architecture is wrong"... by the way you can use a tip.
Do you know Expando in LR? In enables you to add virtual columns on a DB entity... by using it, you can create a virtual column "myExternalId" to table "User_" (entity "User") and store there the ID you need. Then modify your code to use the field myExternalId instead userId.

Resources