I have an input schema which contains a single object in which it have a root node and a datanode and the elements. I have a WCF Method which accepts List of objects as input. I am trying to map these two schemas. But when i am sending the input file it only transforms the first set.
Is there anything additional I have to do to map this?
Input Schema
<ns0:Emp xmlns:ns0="http://SampleAppWithExcelToXmlWCF.InputSchema">
<Add>
<EmailId>EmailId_0</EmailId>
<Phone>Phone_0</Phone>
<EmpName>EmpName_0</EmpName>
<EmpNo>EmpNo_0</EmpNo>
<ActiveInd>ActiveInd_0</ActiveInd>
</Add>
<Add>
<EmailId>EmailId_1</EmailId>
<Phone>Phone_1</Phone>
<EmpName>EmpName_1</EmpName>
<EmpNo>EmpNo_1</EmpNo>
<ActiveInd>ActiveInd_1</ActiveInd>
</Add>
<Add>
<EmailId>EmailId_2</EmailId>
<Phone>Phone_2</Phone>
<EmpName>EmpName_2</EmpName>
<EmpNo>EmpNo_2</EmpNo>
<ActiveInd>ActiveInd_2</ActiveInd>
</Add>
</ns0:Emp>
Above is the input schema sample
As output I want it to be multiple EmployeeDO's as in the schema
The input schema is generated by using a custom ExcelToXML Convertor Pipeline.
Connect Add and EmployeeDO with a Looping Functiod.
You may have to adjust the min/max Occurs on both sides since that does have an effect, despite the Looping Functoid. Basically, both should be max=unbounded.
Related
I have a transmogrifier pipeline to insert objects to my Zope database (importing zexp files from a directory structure). This works - the objects are created; but I don't get them added to the portal_catalog.
I added a section to add the objects to the catalog explicitly, inspired by plone.app.transmogrifier.reindexobject: I call portal_catalog.catalog_object(obj) for each item.
The objects exist, and getPhysicalPath yields the correct values, but the objects are not added. There is no error message or exception whatsoever.
I tried to specify the list of indexes (the idxs argument), but this didn't change anything. If not specified, all indexes should be filled anyway, right?
Since it looks like a transaction problem to me (no errors, but nothing stored in the catalog either), I tried transaction code (begin, savepoint, commit, and in case of exceptions abort), but it didn't help. When I call the catalog immediately after the catalog_object call (portal_catalog(path='/Plonesite/full/path/to/object')), nothing has happened, and an empty list is returned.
The catalog does contain objects; even objects of my custom datatypes (AT-based). Not even the Folder objects of my imports are indexed.
Without the objects in the catalog, my import is useless. What can I do?
Thank you!
Edit: Any hint about how to get my object trees in the catalog is appreciated! Even if it can't be integrated in my process. I need the contents cataloged ...
My custom content types are contained in the Plone Catalog Tool page selection field, but I don't know whether this is sufficient.
Edit 2:
Somehow my objects have been catalogued - the unrestrictedSearchResults method shows them! However, it can't be the desired solution to use this method all over; so I need to "un-restrict" the entries somehow.
It turned out that I have a monkey:patch (xmlns:monkey="http://namespaces.plone.org/monkey") for the Products.CMFPlone.CatalogTool.CatalogTool.searchResults method; this filters the catalog for my additional field subportal unless a special value for it is given - even in the management view ... Unfortunately, I had no way to specify this special value in that view.
Thus, the solution was to weed out all wrong values (for subportals which don't exist in the other Zope tree) to have the default value take effect.
Quite specific to my setup, I'm afraid ...
I'm new to BRE and fairly new to BizTalk as a whole, so this may be quite simple and just evading me...
What I'd like to do is this: create a business rule in BRE that takes as an input the incoming message and checks to see if a value contained in message matches any of the values within a specified set of values. A sample message is as follows. The <isFound> field would then be updated accordingly.
<n1:DocumentTemplate xmlns:n1="mynamespace">
<rootOid>2.16.840.1.113883.3.51.60.2.5</rootOid>
<isFound>false</isFound>
</n1:DocumentTemplate>
Basically I'd like to match the <rootOid> node against a list of values. I've already created a business that will match the <rootOid> against a hardcoded value in the Conditions of the business rule...just as a proof of concept to learn the basics of how to use the BRE and call a rule in an orchestration.
I'm failing to find a way to match against a list of values beyond doing a giant list of hard-coded ORs in the "Conditions" of the Business Rule. The list of accepted values is large enough that doing a bunch of ORs is not going to work.
Ideally, I'd like to have a maintainable XML file full of acceptable <rootOid> values to check against from within the business rule.
I also realize that there is a way to call a database and read the values from a table/column for matching, but I'd rather keep SQL out of the equation so that this can be a little more self-contained.
One "Equal" expression is enough. Your RHS fact should be another vocabulary item. In case of XML type a proper path will pull all values one by one and cause multiple evaluations and respectively firing an action if there's a match. The key to remember: BRE is a pattern matching engine.
The vocabulary is just a convenient alias for the fact definition. Let's say you create an XML file with the following structure:
<options>
<value>A</value>
<value>B</value>
<value>C</value>
</options>
Define a vocabulary for this fact as
Name: PossibleValues
XPath Selector: /options/value
XPath Field: .
Then defining a rule as IF currentValue == PossibleValues will cause three condition evaluations as the RHS yields three facts into the working memory. Consequently, only those that were true will fire a rule (Action). Compare this to the default definition BRE creates when you pick a node from the XML schema which will only assert one (first) fact:
XPath Selector: /options/
XPath Field: value
(namespaces omitted for brevity)
At runtime pass this XML document as an argument to the BRE (whether in the orchestration or in .Net component depending on BRE invocation context). At design time for testing you have to implement Fact Creator component (implements IFactCreator) to provide an instance of required arguments.
Long-term facts (like the one in the question) are better managed using custom fact retrievers. Fact retriever is a .Net component that implements IFactRetriever. See the documentation for details. Inside fact retriever implementation load XML (from disk) and assert it into the working memory as TypedXmlDocument.
I would like to change the data that is displayed in one of the Pooled Tasks
columns. It's not clear where does that data comes from.
For example, in my pooled-tasks-todo-dashlet.jsp file it has this section:
<%-- Status column --%>
<a:column id="col6" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink id="col6-sort" label="#{msg.status}" value="bpm:status" styleClass="header"/>
</f:facet>
<h:outputText id="col6-txt" value="#{r['bpm:status']}" />
</a:column>
Where is the status value "#{r['bpm:status']}" stored?
How do you add a new value that is not already defined?
Thanks
The object #{r} is the current node object iterated over the Alfresco JSF component a:richList. The value of this component is set by a JSF Bean, thus if you want to add a new property to #{r} I think the better way is by adding it in the Java bean that populates the richlist.
If you are only interested in modifying the values of the property jbpm:status, I guess it is bpm engine specific (it can be either jbpm or activity).
I have done it in one of my project.
If you observe jsp page in rich list tag you will find this
value="#{WorkflowBean.pooledTasks}
The bean which populate the rich list is workflowBean
which points to this class org.alfresco.web.bean.workflow.WorkflowBean
and this API get called when dashlet is open
List getPooledTasks()
It populates the pooledTask List then just like for loop we iterate the nodes one by one with r pointing to current workflow node.
I have some incoming XML documents, I need to check attributes that are configurable in this coming XML and if the attribute is not there in the XML document being checked add it.
The attributes to be checked will be specified in the app.config file
OrderRequest.orderDetails.orderSummary.testCount, I need to check if the testCount attribute exists under the element OrderRequest. If No add it along with it’s value which is also specified in the app.config
INCOMING XML --> Read the attributes from the app.config which need to be checked in this XML file --> Read the incoming XML using XDocument --> If the attribute is not there in the incomg XML add it to the XML.
Any ideas how I can go on this.
I wrote a series of articles on how to create custom configuration sections, which can be found here: http://dotnetslackers.com/articles/CustomConfiguration/default.aspx
Is this a static development task? What I mean is, are you only testing the testCount attribute, or is this generic to say loop through the element type and check all of its attributes to ensure they are there?
Either way, essentially you have to find an element, get its name, access your custom configuration section and lookup the name, use the GetAttribute method to check for attribute existence, and append a new attribute to the element if not.
HTH.
I have 2 classes both inherit from the same interface.
i want sometimes to run the website using one class and sometimes with another one.
Want to decide which one to use based on a configuration value.
Can i use web.config to decide which class to create the current instance from?
Yes.
Create a factory method that returns an object of type IMyInterface. Pass in the config value as a parameter to determine which concrete object to create.
IMyInterface FactoryMethod(string configValue)
Indeed you can. Of interest to you is the field AssemblyQualifiedName of Type. So get your type and do:
myObj.GetType().AssemblyQualifiedName
And write the result of this into your config:
<add key="TypeName" Value="...." />
Then, you'll need to consider what constructors it has, and it can be loaded like so:
Type.GetType("...").GetConstructor(...).Invoke(...);