How to get comments by instanceId from the COMMENTS table in Activiti 5.22.0? - alfresco

I am trying to get the comments associated with a Process Instance.
I thought these comments were being populated into the ACT_HI_COMMENT
table, but they are found in the COMMENTS table instead, so
I am not able to get them using taskService.getProcessInstanceComments
nor the
historyService.createProcessInstanceHistoryLogQuery(processInstanceService).includeComments().singleResult()
Does anyone know which is the correct service call to get this records
in Activiti 5.22.0 / Alfresco APS 1.9.0?
Thanks for your help!

I just found that this can be done by using:
com.activiti.service.runtime.CommentService
Like this:
commentService.getCommentsForProcessInstance(instanceId, true);

Related

How to use IdentityRoleClaim Table (IdentityRoleClaim<TKey> Class) in Identity in ASP.Net Core

I am trying to make the best use of Identity Core. In Identity, I am seeing, there are 7 tables like this-
In there, I am curious about this table-
Which can be found in here.
I am trying to use this table for claim based authentication where Super Admin can assign claims onto any role. So that Roles could be dynamic. So, what I am thinking is something like this-
But there is no table exists named Claim or close to this.
That is why I am thinking I have some gap in my knowledge. But there is no clear documentation known to me on this topic as far as I have found.
Can anyone please let me know,
How can I add an entry to the RoleClaim table?
Why there is no Claim table in Identity?
Is there any clear documentation regarding this?
I have found one close to my need, but I am not sure. The doc can be found in here and here.
Thanks in advance for helping.
Re-
If needed, my total code can be found in here.
1.How can I add an entry to the RoleClaim table?
var accountRole = await _roleManager.FindByNameAsync("Admin");
await _roleManager.AddClaimAsync(accountRole, new Claim("Manage", "Cashier"));
Reference:
https://stackoverflow.com/a/53332171/11398810
2.Why there is no Claim table in Identity?
This is by design.I think you need to raise question in github to ask for PG for help.
Reference:
https://github.com/dotnet/aspnetcore/issues
3.Is there any clear documentation regarding this?
There seems to be no official document to explain them.

Reading Issue Fields via Workfront-API

Please tell me how to read Issue Fields like resolveProjectID & resolveTaskID:
****.workfront.com/attask/api/OPTASK/search?id=5bf801f101b144a12aabb51f2c068caa
returns:
{"data":
[{"ID":"5bf801f101b144a12aabb51f2c068caa",
"name":"test-dev-issue","objCode":"OPTASK",
"plannedCompletionDate":"2018-11-27T00:00:00:000+0200",
"status":"NEW",
"primaryAssignment":null}]
}
According to the API-Explorer guide (https://support.workfront.com/hc/en-us/articles/220633507-API-Explorer), resolveProjectID & resolveTaskID should be located within OPTASK fields. I couldn't find anything helpful yet within their documentation.
Thank you!
The search you're executing will work, but if you know the ID of the record you're retrieving then you should call it directly (/api/v9.0/OPTASK/5bf801f101b144a12aabb51f2c068caa).
The return value is, by default, a small set of fields providing some basic data. If you want more fields, add a parameter (fields=).

How to open a record on a subgrid using easyrepro?

https://github.com/Microsoft/EasyRepro/issues/178
Hi all,
I am using dynamics365 version 9.x
Using EasyRepro I can navigate into an account via the global search and then also use the xrmBrowser.Entity.ClickSubgridAddButton("foobar"); function to create a new record of that 'foobar' type. By doing this I know I am accessing the correct subgrid on the account record.
My question is....which function would I use to simply open up the record I have created. I have tried SelectSubgridLookup but I don't think that is the function I am looking for.
From the image you can see I have created the 'bonno bonno' contact but I cannot open the record using EasyRepro. any help would be greatly appreciated! :)
https://github.com/Microsoft/EasyRepro/issues/178
Hello #darthtang - sorry for the delayed reply to your post here. From reviewing, it appears this is a feature gap and needs to be enhanced.
While not ideal, if you wanted to open the record, you could try the following instead:
xrmBrowser.Entity.ClickSubgridGridViewButton(subgridName)
This should take you to the 'Associated View' via Related Navigation. From here, you could call:
optional:
xrmbrowser.Related.Search(contactrecordname);
xrmBrowser.Related.OpenGridRow(#)
At this point, you could then switch back to perform actions on the opened Contact entity record:
xrmBrowser.Entity.SomeMethod();
Please let me know if this set of steps help you with your scenario. I've added a feature enhancement to the backlog to allow opening of a record from a subgrid on a form.

Order details function in Hybris

I am new to Hybris.
Can anyone please let me know the function to get the order details in Hybris.
I need to pass the order details to SAP via we-service.
Thanks.
Biju
You can use orderFacade to get order details based on order code. For example
final OrderData orderDetails = orderFacade.getOrderDetailsForCode(orderCode);
orderFacade is using CustomerAccountService to get OrderModel and then populate it to orderData.
Or if you want to get Order History, you can use this function -
final SearchPageData<OrderHistoryData> searchPageData = orderFacade.getPagedOrderHistoryForStatuses(pageableData);
Hybris exposes most of the data available in hybris as a RESTful web service
. These files are named as
*Resource.Java.
you should find something to get order in one of the OrderResource.Java files.

SQL Search Statement like Google?

Is there some kind of SQL Statement that I can used to do a search on 1 Column in my table that is similar to what I am looking for.
Like if I am looking for something to do with a "Car" but I spell it as "Kar" it must return items of "car".
Or
If I am looking for "My Company" and I spell it as "MyCompany" it must still retun "My Company".
Select * from TableName where Column Like '%company%' will return "My Company" but I need more as the user will not always know how to spell. So I need something more advanced like some small Google App or something...
That feature is in the text services so if you build a full-text search index, you should be able to use the feature.
Have a look here:
http://msdn.microsoft.com/en-us/library/ms187384.aspx
http://msdn.microsoft.com/en-us/library/ms142571.aspx
This is quite an involved problem. The quick answer is to use the SQL Server soundex algorithm, but it's pretty hopeless. Try the suggestions on this SO answer. (Updated)
Read this blog post: http://googlesystem.blogspot.com/2007/04/simplified-version-of-googles-spell.html
This is something you could implement with SQL, but it's not a built in feature.
Another way to help you users find what they are looking for is to implement type-ahead on the search field. If the user type: "my" he will get "My Company" as a suggestion and likely go with that.
You can easily implement type ahead using jquery or other javascript libraries. Here's a list of type ahead plugins for jQuery: http://plugins.jquery.com/plugin-tags/typeahead
No. A full text index might get you closer, depending on your requirements (what exact features are you looking for?) One option would be roll you own .NET assembly with the desired features add it (CREATE ASSEMBLY) to sql server and use that to search.

Resources