Set order of viewmodel creation in catel - catel

Is it possible to set a order in which the viewmodels are created.
I want to display logmessages in a own view. Some other views are created before, and their logs on startup ar not displayed because they are created befor this logview.

This is not possible, since they are loaded on-demand when the views are loaded (and that's up to WPF).
There are a few options:
[Recommended] Create a service that holds the log messages from the start. Then the log vm loads the service and retrieves the messages it missed. Then the service (which you have full control over) will keep track of the log, and you can even hide the log view in between and still show all messages.
Create a custom implementation of the IViewModelFactory. Then you have full control of when and how vm's are created. Then you can create a LogViewModel at the beginning of the factory and return it once it is required by Catel.

Related

Sharepoint Concurrency Issue

I am totally new to Sharepoint development (Sharepoint 2013), and could use some help.
I inherited a console application where I'm getting this message below:
Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes.
Actually, within the application and another console application (both running as jobs), there are numerous using blocks where they are newing up SPSite and SPWeb, opening the same list, and looping through the entries and posting update. These loop are incredibly slow. So the SPSite and SPWeb stays open for a long time, while additional SPSite/SPWeb are new'ed up to the same list.
Should I new up only one SPSite and SPWeb per application and use them globally within the application? Should I grab my list objects and assign them to a .NET List and close out the SPSite/SPWeb and then when I'm ready to update the record to temporarily new up a SPSite/SPWeb for the duration of the Update()? These list items are being updated by the other job as well while marching thru the list and posting updates to the same list. Is that an issue?
In reality, the notion of a Error Log list exists as well. Items are constantly being appended to this list. Would that cause that error message above?
Would create a Retry loop for the Update() work? Or is the issue of the list item updated by another process prevent a successful update?
Thanks.

Maximo: Create Reports feature for custom apps

I have create a new custom view in Maximo DB, added it through the Database Configuration.
Created an application on top to display the data based on that view.
Added new signature option CREATEREPT to use default dialog to create reports (Ad Hoc Reports).
When I try to preview any report in that dialog, I get the following error
BMXAA8093E - The report could not be created and the cause of the
error cannot be determined. Try to create the report again, or contact
your system administrator.
null
It appears error BMXAA8093E can occur in a few different scenarios where a problem occurs with a report and a more specific explanation can't be provided:
https://www.ibm.com/support/pages/error-trying-save-qbr-or-create-new-report
I would suggest first confirming if a more specific error or any additional information is provided in the application logs. Following that you may want to verify that you have a Report Object Structure (ROS) for the object structure based on your custom view (i.e. in Integration -> Object Structures there is a record with "Consumed By" set to "Reporting" that has your object structure based on the custom view as a source object). Although you mentioned adding a Signature Option it is not clear from your description whether a ROS (mentioned earlier) exists and whether Administration -> Report Administration -> Set Report Object Structure Security has been used to tie that ROS to an existing security group or groups.
I had the same issue. Here is the solution that worked for me: go to Database Configuration, select your view, ensure that EXTENDSOBJECT is populated. In my case, it was not. You can fix this from backend. Let's assume your extended object is ASSET and your view is MYVIEW:
update maximo.maxobject set EXTENDSOBJECT='ASSET' where objectname = 'MYVIEW';
update maximo.maxobjectcfg set EXTENDSOBJECT='ASSET' where objectname = 'MYVIEW'; commit;
Do NOT forget to restart the app server.

How to use action from another web application object

I'm using Blueprism and I have to create a robot for a web application. So far I've had all of my subpages spied in one object, but now I must split that object into 5 different objects, each object for one subpage for example :
Now I got this : Web App - Object and I must split it into
Web App - Login Page
Web App - Main Page
Web App - Settings Page etc.
Everything worked when I had just one object but now it's not.
I spied elements again for my new objects in my application modeler.
Also I tried the "Sharable option" and of course published all of my pages.
For example my Web App - Main Page action cannot be used by my Settings Page. I can choose it from the list but then I get this error :
Internal : Failed To perform Step 1 In Navigate Stage 'Click' on page 'click' - Not Connected
What should I do and what should I write in application modeler when I'm asked for the URL of my start page? I've tried the main url for example web.com, my subpages url : web.com/main and also I tried to leave it blank.
Please help me to solve this problem
When splitting your functionality across multiple objects, it's important to note how Blue Prism handles connections ("attachments") to individual applications.
When a Business Object is leveraged to Launch a business application, the attachment to the application itself is (normally) handled in the background by Blue Prism. When another business object is created, the attachment isn't handed off to the secondary object(s). This is clearly laid out in the Blue Prism Object Design Guide document, section "4.2.4. Attaching":
An object must be attached to the application before it can be used
to automate it. When an object launches an application, it is
automatically attached to that application. Therefore, the ‘Basic
Actions’ object does not require an ‘Attach’ action. The remaining
objects that wish to work with an application that is already launch
must first attach to the application.
The solution to this object design paradigm is to include a non-published "Attach" function in each of the secondary objects that's called at the start of each of the secondary object's actions. From the aforementioned guide:
If an object attempts to attach to an application when it is already
attached, an error will result. Therefore, when building an ‘Attach’
action, it is best practice to first detect if the object is already
attached to the application. A typical ‘Attach’ action may look like
this
By using the approach above, every other action within the object can call the ‘Attach’ page as is its first stage to
ensure the action is ready to work with the application e.g.
If you are already launched the application then no need to keep url to rest of the Objects , just in application modeler u check the checkbox for application is already running, after that in each and every page attach the application and in the attach page keep the web page(all the navigating pages) names in the collection and passing it as a webtitle parameter to the attach stage
This works fine.

How to dynamically pass sql in query in Launch in context?

I need to have a button in custom Location app, upon clicking which will take me to workorder application list tab with all the workorders created on the assets of the particular location.
I am using launch in context.
I tried using WF, but the workorder is opening in main tab instead of List tab.
Work flow used
Interaction Node details
after routing, wotrack is opening like "http://hostname/maximo/ui/?event=loadapp&value=wotrack&additionalevent=changetab&additionaleventvalue=List&uniqueid=72&uisessionid=35&_tt=6e2h84jnc2qpnu9tohvo04qpdp"
how it is fetching workorder with unique id 72?
I think Launch in Context is the wrong tool. Launch in Context is used for launching the user from Maximo into some external website / application, using some data from Maximo to provide some context to that application.
Instead, it sounds to me like you should use a Workflow process with an Interaction Node. In the Interaction Node, you can specify the Application and tab to take the user to and the Relationship from the Main Object of the current app to use to find the record(s) that should be loaded in the destination app for the user.
I don't remember how to set up Launch in Context, but this web page on the URL parameters you can use should help on that part at least.
http://maximodev.blogspot.com/2012/04/maximo-urls.html
Specifically, the example using the SQL query is probably what you need, since you want to display the records (workorders) associated with the records (assets) associated with the record (location) you have. (The earlier outline of the article has the wrong URL values for the "Perform a query using a where clause" section, but the example near the bottom has the correct setup.)
http://localhost/maximo/ui/maximo.jsp?event=loadapp&value=wotrack&additionalevent=sqlwhere&additionaleventvalue=status%20in%20('WAPPR')
I think if you give the Launch in Context the part of that URL after the hostname, it will try to load it as a page at the current, which would end up taking you to exactly where you want to be, regardless of the public hostname of the server.
maximo/ui/maximo.jsp?event=loadapp&value=wotrack&additionalevent=sqlwhere&additionaleventvalue=status%20in%20('WAPPR')

check document is opened by other user xpages

I m working with xpages for following scenario.
I have one agent that will update the value to one of the field of datasource from notesview. sometimes, while one user is opening the datasource via xpage and other user run the agent in the same time. at that time, agent can run and update the field of datasource. but from the xpages side, we can catch the exception for the document is modified by other user and cannot save the xpages.
i would like to prevent this from agent side. i would like to know whether there is a way to know that document is opened by one of the user from agent side, so that agent wont update the value to that datasource.
thank for your help.
First of all: mixing agent and XPages is more trouble than it is worth, you are better off converting your agent code into a Java class (and pay the technical debt accumulated over time in the agent).
One BIG reason: an agent and XPages do not share anything other than the document in memory (if handed over) on that one user's session.
If you launch the agent from an XPage: you can use an ApplicationScope variable (e.g. a java.util.HashMap) that you fill with the unid and username when a user opens a document. Before you launch that agent, you check the scope if the unid is inside with a different username. If yes, don't run the agent.
You need to build a mechanism to expire and renew these locks otherwise you end up with dead lock entries.
If the agent is launched directly or on schedule things get a little more complicated. You could implement a web service servlet that handles the locks since both XPages and agents can talk to a web service.

Resources