Logging Application Block-Microsoft Enterprise Library 4.1 - enterprise

In Logging Application Block in Logger.Write it takes event id as one of the parameter which is integer.So how to decide what should be passed as event id?

btw, do you really need to use the eventId? I think you can just pass the string you want to log:-
Logger.Write("SomeMessage");
EDIT :- I meant there should be another overload which takes just the string you want to write.
EDIT :- From here :-
EventId - a value you can use to
further categorise Log Entries
(defaults to 0 for a LogEntry and to 1
for a LogEntry implicitly created by
Logger.Write);

What we do is gather the different "stories" that you want to report on and then assign a sequence of event IDs to each of those stories. So in short, come up with a system that works for you and document it for future reference.

Related

I am facing issue in jmeter

When I record and run the test in login transaction one request is failed.i check that request I found in post data session id keep on chenging.i did correlation for that Id .after I want to replace the variable name insted of that Id.but it not replace. Because that Id is not there any subsequent requests and any parameter value undre the requests.how I need to handle that Id how to replace it... please help me for the above issue
Note: I search that ID in view results tree it showing that Id passing in 3subsequent requests
Make sure that you really "did correlation for that Id", i.e.
Double check that the variable has the anticipated value using Debug Sampler and View Results Tree listener combination
Make sure that the placement of the Post-Processor performing the correlation is correct as according to JMeter Scoping Rules the Post-Processor is applied to:
One Samples only if it's placed as a child of this sampler
All the Samplers which reside at the same level (or lower) with the Post-Processor
so it might be the case you're overwriting the variable with the empty value somewhere else.

FPM - WD - LPD: POWL as Listpopup to choose a record and then return it

The situation is like this:
We have a POWL, where I added a toobar-button.
The click on that button opens a FPM-POWL, which I created
with the help of this link
https://sapcodes.com/2016/03/25/powl-in-fpm/....
(INFO: This POWL takes it's data from a standard FBI View).
The new FPM-POWL is properly(??? I hope so, because it gets shown) maintained inside the LPD_CUST in order to start this popup inside the FPM-framework (flag that it should wait, is also set on caller and callee) .
Ok, let's proceed.--
The calling class (feeder class "A", implementing IF_POWL_FEEDER) calls the POPUP like this
DATA(lt_lpd_content) = lr_lpd_handle->mt_content.
READ TABLE lt_lpd_content
REFERENCE INTO DATA(lr_lpd_content)
WITH KEY application_alias = 'ZSRM_GP/BP_POPUP'.
lr_lpd_handle->launch_application( iv_application_id = lr_lpd_content->application_id ).
The user shall simply be able to pick one business partner....
After the user picks a record, and hits a special toolbar-button of the "popup", its feeder class "B"(also implementing IF_POWL_FEEDER) does, what it needs to do inside handle_action and until now... I try to figure out, HOW to pass the record back to the caller class "A"...
Because, unlike expected (because both LPD_CUST entries have the flag set "Synch/await"), the class "A" proceeds processing any code I place after
lr_lpd_handle->launch_application( iv_application_id = lr_lpd_content->application_id ).
And so I suppose, this is "works as designed" and is asynchroneous .
So, my current experiments assumed synchroneous, and I exported any picked business partner's number to a memory ID and closed the "popup".
But I never returned to the caller, where I wanted to start coding the rest of the requirement.
So, my second try is, that I created an event in feeder class "B" (called popup) and a handler for this inside feederclass "A" ( caller ).
Inside the ctor of class "A" I register via "SET HANDLER FOR ALL INSTANCES".... and the tests are just about to start.
But I really hate this approach,.... is there a best practice regarding this ?
I cannot imagine, that I am the only one with this kind of requirement, which, in simple terms, means:
"Listpopup"... and we all know, how simple this is in sapgui...but inside the FPM-POWL-LPD environment... I cannot get it...
EDIT: Maybe I should do something in here to FORCE a blocking popup call ?
Or can I somehow populate the exporting parameters of handle action of the callee to return to the callers handle_action ? Ala POWL_FORWARD_anything ?

YouTrack rest api - Get fields metadata

I want to create issues with the youtrack rest api,
Currently I'm using:
PUT /rest/issue?{project}&{summary}&{description}&{attachments}&{permittedGroup}
but I want to set other fields (priority, type, subsystem...)
How do I get a list of available fields from the api? and the fields metadata(is mandatory, field type...)?
And after that, How do I set the value of these fields?
I found this in the docs:
https://confluence.jetbrains.com/display/YTD6/Apply+Command+to+an+Issue
but it looks too complex for setting a field.
Issue can be created with following method and fields set only https://confluence.jetbrains.com/display/YTD6/Create+New+Issue . So as you mentioned, it's
PUT /rest/issue?{project}&{summary}&{description}&{attachments}&{permittedGroup}
It's assumed, other fields can be updated within next call. ApplyCommand (https://confluence.jetbrains.com/display/YTD6/Apply+Command+to+an+Issue)method is pretty good example of such a method.
If you need to know all available fields in the projects, here is the method https://confluence.jetbrains.com/display/YTD6/GET+Project+Custom+Fields.
Meta can be called with the following https://confluence.jetbrains.com/display/YTD6/GET+Project+Custom+Field. As you can see, details are available on per field basis.

Grails trouble saving object id

id is present in the params but does not save to the db. for example
[book.id:1, comments: good]
comments will save to db but book.id does not.
I need to figure out how to save params.book.id into the db column BOOK_ID that was created from the hasmany/belongsTo relationship.
By default value attribute of each element will be the result of a toString() call on each element. Setting it as optionKey allows the value to be a bean property of each element in the list.
Kindly change the select to
<g:form action="review">
<g:select name="book.id"
from="${item.Book.list()}"
value="${book?.id}"
/>
<g:textField name="bookreview" value="${params?.bookreview}" /><br>
kindly refer the below link
Grail example with optionkey
You have overwritten toString, therefore your books are always rendered by name and not id. If you remove your toString() method you will see the expected results.
If you want your select box work with the name, just add optionValue="name".
Well, it seems that I had misspelled a crucial parameter inside my domain. So the domain was expecting x and it was getting y. Thus the id was always null. It took me a while to spot it, and I was perplexed because I had previously successfully implemented ids in another project. Grails has some jira issues also that make one consider other possibilities, but this time it was my mistake.

SharePoint Workflow Error: "Unable to transform the input lookup data into the requested type" BUT only on New Item Creation

FYI to start, I am aware of how to properly set up an update to a lookup, and am 99% positive I've done this correctly.
I know this because When I set the workflow to automatically start when an Item is Changed, then it works perfectly. But when I simply change this setting so it will automatically start on New Item Creation, it Cancels the workflow and I get a "Coercion Failed: Unable to transform the input lookup data into the requested type." If both options are checked then it fails on creation, but simply clicking edit on the item properties, and the "Save" makes it work.
The workflow is on a Document Library and works as follows;
User selects the Work Task LookUp from a dropdown in the edit properties form after uploading, and then Saves the item (adding it to the document library). The workflow is suppose to then look at the Work Task LookUp selected, and pull the Account and Effective Date-Type lookUp ID's that Work Task item has, and sets the Document's identical fields to the same value.
Here is the code for the workflow if it helps;
If Current Item: Parent Task is not empty
If Current Item: Sub Task is not empty
Log Both are empty to workflow history list
Then Set Account to Work Tasks:Account
The Log Set Account to workflow history list
Then Set Effective Date and Type to WorkTasks: Effective Date and Type
The Log Set EffDateType to the workflow history list
This is all done in one step. I also added additional steps to test if the account and effective date type fields have been set properly, and if not to set them again. But everytime I run the workflow on change and it works, it always correctly sets these fields based upon the first Step (posted above) and the additional check logs to the history that they are not needed.
As an example, The lookUp for Integer for Tasks:Account is set to work as follows;
Date Source: Work Tasks (a list)
Field from Source: Account (a lookup)
Return Field as: Lookup ID (as Integer)
Find the List Item
Field: Title (from the Work Tasks list)
Value: Current Item: Parent Task (Which is a look up of the "Title"
Field from Work Tasks List, and is set to return the Value as a LookUp Value (As Text))
The Effective Date and Type setting is pretty much identical.
So anyone have any insight? I've tried running it as an impersonated Step, setting a workflow pause (for 1 minute), changing the lookup types incase I messed it up to start with, but ultimately the above workflow DOES work, but only when I set it to "Automatically start on the Change (edit) of an Item", NOT "Automatically start on New Item Creation" like I need to to do.
Oh yes, fyi, I am using SPServices CascadingDropDown on the Work Task and Sub Task fields of the doc Library form, but I honestly do not believe this has anything to do with my issue.
UPDATE:
I've talked with another developer, and he believes it is due to the issue that the workflow is occuring too quickly, before the item creates an ID for itself, which it needs to conduct the lookUps. He had me add another "Pause Workflow" to the very top of my workflow code (above the If conditions) and set it for 1 minute.
It then worked properly.
Downside is we want this to labeling to occur as close to item creation as possible. Because a view of the library relies on grouping based upon Account and Effective Date and Type. To add to this downer, Microsoft's Pause Workflow only allows for 1 minute or more, and then the timer used for this is often off, resulting in a pause longer than that. So far, every test is currently showing 2 minutes minimum on the pause.
A possible alternative solution for instantaniously populate the fileds is to use Javascript and SPServices to do the lookUp to the Task list to pull the account and effective date - type fields and then populate, but my Javascript is not very strong and I would need help doing this. If anyone has any suggestions, I would appreciate them.
(Answered in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
I don't know if it is the ID for the item after further testing. I changed the start of the workflow to wait until a field in the item changes. I set it to wait until the ID field is not 0 (since you cannot set to null), and it still does not work.
6/14/2012 4:13 PM Comment System Account Waiting on ID ​
6/14/2012 4:13 PM Comment System Account Waiting complete on ID ​
6/14/2012 4:13 PM Error System Account Coercion Failed: Unable to transform the input lookup data into the requested type.
I have tried other fields as well, like document ID value is not empty, and it will wait, log it finishing the wait, and then fail.
UPDATE This issue has something to do with the Parent Task field. I have solved the issue without having to wait for a period of time by setting the change from above to wait until the Parent Task field is not empty. It then completes the workflow fine.
Anyone know why there is a delay though? I've solved it, but still don't fully understand what takes it so long.
The main fault has been solved (hence the answer), and the remaining point about the reasons for the delay would probably be a discussion point or not specific enough for SO. Any further clarification can be edited in here.