How to recover from : Workflow Designer encountered problems with your document - visual-studio-2010

As a novice with workflows I create a workflow (in VS2010 workflow designer) with a sequence within which I have a writeline activity. I am experimenting with creating arguments for the workflow so I create 2 arguments in the argument pane w/o doing anything with them at the activity level. (Noteworthy that I dont have a grasp of how to use arguments in the workflow yet). However I save my workflow while the workflow does not show any visible errors( red circles with an excalmation mark). Next time I open the workflow I get the error :
Workflow Designer encountered problems with your document .
Please check the document for invalid content, namespaces,references, or reference loops.
And that seems so final because there is no way that I can have access to my original workflow to possibly correct my error (whatever they might be). when I click on the detail down arrow I see this: Could not find member 'a' in type _8684 .
a is one of the two int32 arguments that I had in the workflow but which I never used in any of the activities.
I would appreciate any help. Thanks in advance.

It seems you're trying to re-host your Workflow Designer and it's not generating correct XAML for you.
The error Could not find member <mname> in type <tname> commonly occurs if the Workflow Designer instance is directly loading a container activity (sequence, flowchart etc.) instead of using an ActivityBuilder first.
If you're already using an ActivityBuilder then you may have missed giving it the root activity namespace. The correct way to add System.Activities.Presentation.WorkflowDesigner is:
this.workflowDesigner = new WorkflowDesigner();
this.workflowDesigner.Load(new ActivityBuilder { Implementation = new Sequence(),
Name = "RootNamespace.RootActivity" });
With the Name set properly WF designer would stop using random types (like _8684 in your case) and generate correct XAML on save/serialization. This should help you get rid of the namespace errors.

Related

Record without adding to repository?

Imagine creating a new QTP project. You hit record to get your first bit of code in place. By default, you'll get something like:
Browser("MyApp").Page("MyPage").WebEdit("MyLogin").Set "Bob"
And you'll get the Browser, Page, and WebEdit objects automatically added to the repository. What I would like to be able to do, as one of those QTP bods that prefers descriptive programming, is hit record, and get something like:
Browser("name:=MyApp").Page("name:=MyPage").WebEdit("name:=MyLogin").Set "Bob"
And have no objects added to the repository. Is there a setting / option to do this somewhere?
(Obviously there are arguments for not wanting to do this, which I acknowledge and appreciate - but for those of us that prefer DP, this could help expedite test creation).
From what i understood is that you want to hit 'Record' button and you will get the script in descriptive type rather than the usual. But that is not possible.
For descriptive programming, you have to explicitly write the code by identifying the properties of each object for that (you can use Tools > Object Spy).
For above example:
Go to Object Spy > Select "the pointing hand symbol button" and click on the WebEdit for which you want to set the text "Bob"
Now, from Object Hierarchy select each object Top to Bottom and write properties of those object in the script. Like 1st Browser, then Page, then WebEdit. Try adding as more properties as you can.
You just can not get descriptive script by hitting Record button.

Birt Reports - Don't generate an empty report

I have several Birt Reports that I am trying to set up to run on a cron job that will email pdfs of the reports every morning. Everything is working fine as far as the generation and emailing goes; the only issue I am stuck with is this: if there is nothing to report, a pdf with just the report title is generated and emailed (a blank report, basically). I'd like to stop this report from being generated at all, so i can skip the emailing, if the pdf file does not exist.
I have been all over Google for two days now, and the closest I can find is this: http://www.eclipse.org/forums/index.php/t/458779/ in which someone was trying to solve a similar problem and received a push in the right direction, but not a complete solution.
It appears as if this can be done during the beforerender script... but how?
I know I need to:
set a persistent global variable in the oncreate if there is indeed data to report.
get the persistent global variable in the beforerender script.
send the magic don't generate report command.
I'm doing all of generating and emailing from a php script, not Java, so I can't send commands like IEngineTask.cancel() (or can I???)
Yes, I know I can make a row in the report that says "No data to report", but that's not what my users want.
And yes, I could query the database outside of the report to determine if there is valid data to report or not, but i'd prefer not to.
And maybe I could even open and read the pdf, programmatically to see if there is anything there, but that sounds like more of a hassle than it's worth...
So, how do I do this?
Thanks.
My answer is a little bit late, but I'm doing it like this in a framework that is working for hundreds of reports, probably it could be simplified for a single report:
Note that all the code is written from memory (not copied from our framework), so maybe it contains some errors.
Add an external Javascript file myframework.js to your report.
In this file, define an object myframework like this:
if (myframework == undefined) {
myframework = {
dataFound: false,
afterReport: function() {
// Write it to the appContext.
// Using Java, you could read it after the
// runAndRenderTask is done.
reportContext.getAppContext().put("dataFound", this.dataFound);
// But since you probably cannot the context
// (don't like coding Java?), the report has to
// tell it to he world some other way...
var txt = "dataFound=" + (dataFound? "true": "false");
var fw = new java.io.FileWriter("c:\\reportcontext.out");
fw.write(txt);
fw.close();
}
};
}
Add the JS file to your report's resources.
In your report, at a place where you decide that the report has found something (e.g. typically in a data set's onFetch event), tell the framework so by calling
myframework.dataFound = true;
In the reports's afterFactory or afterRender event, call
myframework.afterReport();
Then your report should create an output file c:\reportcontext.out which contains the information you need.

vb.net data set not working

I am using two different datasets to populate datagridview my project using visual studio using vb.net. It is windows forms application which is used to display information from the database based on user inputs. Once the information is displayed the user can save the information into a table specifically created to store the report information in order for it to be recalled at a later date. I am now trying to recall this information so have created my dataset in the same way as before and am now trying to invoke a new occurrence of it and this is where the probelm begins. The code is below.
Dim dv2 As New System.Data.DataView
dv2 = New System.Data.DataView(DataSet2.Tables(0), "Status <> ''", "",
DataViewRowState.CurrentRows)
DataTable2TableAdapter.fill(DataSet2.DataTable2, f5.ComboBox2.SelectedValue)
I am getting two issues.
For DataSet2.Tables(0): Reference to a non-shared member requires an object reference
For DataTable2TableAdapter: ’DataTable2TableAdapter’ is not declared. It may be inaccessible due to its protection level.
I dont know why this is happening as I have written the same code here as for my previous data set other than changing the SQL statement behind the dataset at set up. Any thoughts would be welcome as I am totally out of ideas. All questions are welcomed.
Thanks
Try the following code to fix your error number 1....
Dim tablezero as System.Data.DataTable
'
tablezero = DataSet2.Tables(0)
The reason your getting the error is because you are trying to access an object (Table(0)) and it is not visible to the code that is trying to access it, if it was SHARED then it would be visible.
So you can resolve it by defining and object instance/reference to it and then accessing that reference, which in this case i have called "tablezero" (or by making table(0) SHARED - usually not the best bet unlessits neccesary - no point in having something accessible to the whole class it is declared in unless absolutelty neccessary)
It is quite possible the second error may dissapear after just fixing above, then again its difficult to tell without your code for Dataset2
Hope it helps.

Oracle Forms Builder - change to window in another form

We have two forms so far, and need to switch from window1 in from1 (which is login screen) to windowX in formX using button (trigger code below):
begin
show_window('windowX');
go_block('some_block_in_formX');
end;
This gives error FRM-41052: Cannot find Window: invalid ID
So question is, should I add formX into show_window parameter in certain way or is there another approach? Thank you.
Please note, that forms are in different files.
that forms are in different files.
If the forms are different files, you need to call the other form using open form/call form/newform - whatever suits your needs.
show_window/go_block sequence can be used only when you're moving to different windows/blocks of the same form - and the error message
error FRM-41052: Cannot find Window: invalid ID
is complaining that it can't go to that Window because it's in a different form.
Each form effectively has a private namespace for all its windows, blocks, items, etc - and your code always runs within the context of a single form.
To solve this, you'll need a form parameter, plus some code in the other form, e.g.:
in formX, add a parameter ACTION
in form1, pass the value 'XYZ' to ACTION
in formX, in the WHEN-NEW-FORM-INSTANCE trigger, check if :PARAMETER.ACTION = 'XYZ', and if so, do your show_window and go_block. Copy the same code to your WHEN-WINDOW-ACTIVATED trigger.
Of course, you'll need to think about the name of the parameter (e.g. ACTION) and value ('XYZ') that will make sense to people maintaining your forms in the future.

How to add components in to an existing GUI created by guide?

I just created a GUI using guide in MATLAB for a small project I'm working on. I have amongst other things two text fields for from and to dates. Now I'd like to get rid of them and use a Java date select tool. Of course this is not possible using guide so I need to add them manually.
I've managed to get them to show up by putting this code into my Opening_Fcn,
uicomponent(handles, 'style','com.jidesoft.combobox.DateChooserPanel','tag','til2');
using UICOMPONENT.
But even though it shows up I can't access the date select's attributes, for example
get(handles.til2)
returns
??? Reference to non-existent field 'til2'.
How can I fix this?
Unless you edit the saved GUI figure, the basic handles structure will not include your new component by default.
One way to access you component is to store the handle via guidata, by adding the following to your opening function:
handles.til2 = uicomponent(handles, 'style','com.jidesoft.combobox.DateChooserPanel','tag','til2');
guidata(hObject,handles)
Functions that need to access the handle need the line
handles = guidata(hObject)
to return the full handles structure that includes the filed til2

Resources