.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

How to get this.Parent in execute method of activity.

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :Windows Application
 
Hi, Inside execute "protected override void Execute" of the NativeActivity i want to get its parent.    protected override void Execute     (     NativeActivityContext context     )       { this.Parent Actually my problem is that i want to check if this activity is in sequence or parallel during execution. Please help me.    ilogik


View Complete Post


More Related Resource Links

How do I get the parent activity when an activity is moved/dropped/pasted?

  
I can't seem to find a way of determining the parent activity of an activity when it is moved about.  I have an activity that needs to be bound to a parent activity when it is inside a certain parent activity, but when outside of the parent, it needs to have the inarg blanked out so that it can be manually bound to the parent. I have all the logic worked out other than determining the parent activity. I'm using the ModelService_changed event in my rehost to detect the movement of the activity (this seems to be the only way of detecting when an activity is added, moved or copied).  The only problem is that when an activity is moved within the patern (dragged to a new location) the ModelService_changed event fires before the activities model item has been updated. So my attemps to bind always end up binding to the previous parent activity! Is there either 1. A way of getting the current (new) parent activity from the modelItem inside the ModelService_changed event? 2. Another way of detecting if an activity has been added, moved, or pasted into a new location in the workflow? Any help will be greatly appreciated. Cheers,  JasonJason Bolstad

SSMS 2008 Activity Monitor Activity Monitor is unable to execute queries against server (SQL Server

  
I get the following error when running SQL Server SSMS 2008 (32-bit) on my (Windows 7 64-bit) workstation against our SQL Server 2005 (32-bit) development server running Windows Server 2003 (32-bit): TITLE: Microsoft SQL Server Management Studio ------------------------------ The Activity Monitor is unable to execute queries against server <my server\instance name>. Activity Monitor for this instance will be placed into a paused state. Use the context menu in the overview pane to resume the Activity Monitor. ------------------------------ ADDITIONAL INFORMATION: Unable to find SQL Server process ID 2256 on server VTX-DEV-01 (Microsoft.SqlServer.Management.ResourceMonitoring)   I can expand the panes and all display data except Overview and Data File I/O. This is true for all instances on that server. The SSMS 2005 Activity Monitor (also on my workstation) works fine when connected to that server. I checked for the registry setting to disable the performance counters on both my machine and the server, and it was not there. I started the Performance Counter DLL Host on my machine, but that made no difference. I can see all Processor counters on the server from my local Performance Monitor. I ran "lodctr /R" on both systems, but that didn't help. The only SQL counters I see on the server (from my workstation) are SQLServer:SSIS Pipeline and SQLServer:SSIS

The Execute method of job definition Microsoft.SharePoint.Administration.SPUsageImportJobDefinition

  
I'm on a Windows Server Standard 2008 R2 w/ Sharepoint 2010. I'm seeing Event ID 6398 logged every half hour: Event Details: The Execute method of job definition Microsoft.SharePoint.Administration.SPUsageImportJobDefinition (ID ee6f2e0d-9bcb-4c72-8714-5d5f87a0fa3a) threw an exception. More information is included below. Access to the path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS' is denied. Any idea what the fix is?

How can i access to params and args defined in parent activity from custom NativeActivity

  

There is a scenario that the custom NativeActivity need to access to params or args defined in parent activity. What i have done as below

 protected override void Execute(NativeActivityContext context)

  {

   WorkflowInstanceProxy proxy = context.GetExtension<WorkflowInstanceInfo>().GetProxy();

   Activity root = proxy.WorkflowDefinition;

   Activity rootChild = WorkflowInspectionServices.GetActivities(root).ElementAt(0);

   EditingContext ec = new EditingContext();

   ModelTreeManager mtm = new ModelTreeManager(ec);

   mtm.Load(rootChild);

   ModelItem modelItem = mtm.Root;

   ModelProperty c1 = modelItem.Properties["Variables"];

   ModelItemCollection c2 = c1.Collection;

   dynamic c3 = c2[0].GetCurrentValue();

   string value = c3.Get(context);

  }

Apparently it is not possible to access to external params with local context so the error prompt "An activity can only access its own implementation variables."

My question is how to get it ? Is there another easy way to do so ?

Thanks,

Alex


be together be stro

sql 2008: the activity monitor is unable to execute queries against server

  
Installed sql server 2008 entrprise edition on VM server windows 2008 (64bit). When launch Activity Monitor, get:

The Acityvity Monitor is unable to execute queries against server <server name>.
Activity Monitor for this instance will be placed into a paused state.
Use the context menu in the overview pane to resume the Activity Monitor.

Additional information:
   Unable to find SQL Server process ID xxxx on server <server name>
   (Microsoft.SqlServer.Management.ResourceMonitoring)



Tried to "use he context menu in the overview pane to resume the Activity Monitor" and got the same error again.

Installed sql 2008 in my XP machine, I can use Activity Monitor (AM) for local instance but cannot launch it for the instance on the server (same error).

Used windows authentication with sysadmin role for connection from my machine. On the server used domain\administrator that the account created the instance.

Please help.

error code:0xC0024104 source: Reporting Task for subplan- Description: the execute method on the tas

  
Hi,

I am getting following error when running maintenance plan under schedule job. I am getting this error for maintenance cleanup task.  The job is not failing all the time but alternate weeks. I created same maintenance plan on test server(same configuration as PROD) and Maintenance cleanup task related job failed for first time and running fine from there. I don't know why it is causing failed. I checked maintenance plan history and it show successful each time. even i checked manually it deleted all the report files related to maintenance plan. History Cleanup task and Maintenance Cleanup task should not be created on same Maintenance Plan?....I know SQL Server 2005 had some problem with maintenance plan creation before SP2.

The Execute method of job definition Microsoft.SharePoint.Administration.SPWebApplicationProvisionin

  

Sharepoint 2010 Enteprise Edition installation. 1 WFE. 1 Application Server. 1 Search Server. 1 clustered SQL Server instance.

The Execute method of job definition Microsoft.SharePoint.Administration.SPWebApplicationProvisioningJobDefinition (ID a159e302-f3b8-4098-b84b-85007783881f) threw an exception. More information is included below.

Access denied.

All binaries are installed and all servers have joined the farm. Search crawl and query has been configured. Kerberos has been configured.

The show-stopper emerged when creating the first web site – portal.x.x.x

Made the account that runs the timer process sp2010farm a member of the Local Administrator g

Calling parent page method from user control

  

I looked up the  threads about  this. But I couldn't do it...

this is my method in aspx.page:

public  void MesajlariGetir()
    {
        DataSet ds = new DataSet();


        SqlConnection con = new SqlConnection();
        SqlCommand cmd = new SqlCommand("msjlarigetir", con);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@Kime", Session["kullaniciadi"].ToString());
        con.ConnectionString = cnnstr;
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        da.Fill(ds);
        con.Open();
 
        pds.DataSource = ds.Tables[0].AsDataView();
        pds.AllowPaging = true;
        pds.PageSize = 10;
        pds.CurrentPageIndex = CurrentPage;

        DataList1.DataS

Process.Start() Method : Dont want to close the Parent process without closing the Child

  

Hi there,

     I wanna call a child process to run from the parent process. In that case the parent process should not be accessible before closing the child. I nearly accomplished this stuff by using the following code.

 

ProcessStartInfo pStart = new ProcessStartInfo();
      pStart.FileName = @"D:\Child.exe";
      using (Process proc = Process.Start(pStart))
      {
        proc.WaitForExit();
      }

 

The above code works successfully but my problem is different. In my child application there are totally two exe's.

  1. Login.exe
  2. Child.exe

In child application generally we used to call the Login.exe to login then the Login.exe will automatically close and the Child.exe will open.

In my present scenario I have to cal the Child application from the Parent. If I used the above coding, the Login.exe is called successfully. But after logon the Login.exe will close and then Child.exe will run then the Parent.exe is available now.

 

So I need the Parent.exe remain unaccessible until the Child.exe is closed.

Note:

  &nbs

Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust

  

Hi,

I want to pass parameter to Silverlight Control deployed as a Webpart.For this i used WebpartStorageAttribute for getting the values while configuring the Webpart.

It deployed Successfully but when i try to add webpart its raising the following error

Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: Could not load type 'Microsoft.SharePoint.WebPartPages.WebPartStorageAttribute' from assembly 'Microsoft.SharePoint, Version=14.900.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.

Thanks in Advance


How can I execute If/Else in an custom Activity?

  
Hello everyone, I have the following problem:
I have created a custom Activity called "customIfElseActivity" containing an ifElse. There I have a dependency-property called "Id" which is binding to an other customActivity (that reads the Id from a DataBase). Here is my code:


using ...
using ActivityLibrary;

namespace ActivityLibrary
{
    public partial class customIfElseActivity : SequenceActivity
    {
        public customIfElseActivity() { InitializeComponent(); }

       
        public static DependencyProperty IdProperty =    
            System.Workflow.ComponentModel.DependencyProperty.Register("Id",
                typeof(string), typeof(customIfElseActivity));
        
        [Description("The Id to work with")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
                
        public string Id
        {
            get { return    
                ((string)(base.GetValue(customIfElseActivity.IdProperty))); }
            set { base.SetValue(customIfElseActivity.IdProperty, value); }
        }
       
       
        protected override ActivityExecutionStatus Execute(ActivityExecutionContext
            executionContext)
        {
           
      

How to assign the value of my custom activity to the variable of the parent activity?

  

How to assign the value of my custom activity to the variable of the parent activity?

The custom acticity code:

public class ExecuteService : NativeActivity
    {
        public OutArgument Result
        {
            get;
            set;
        }

        public ExecuteService()
        {
        }

        protected override void Execute(NativeActivityContext context)
        {
            //assign the value to the variable of the parent activity
        }
    }

 

The workflow Code:

static Activity CreateActivity()
        {
            var FirstName = new Variable<System.String>();

  &nbs

How to assign the value of my custom activity to the variable of the parent activity?

  

How to assign the value of my custom activity to the variable of the parent activity?

You can see the code:

public class ExecuteService : NativeActivity
{
public OutArgument Result
{
get;
set;
}

public ExecuteService()
{
}

protected override void Execute(NativeActivityContext context)
{
//assign the value to the variable of the parent activity
}
}

public class Test
{
static Activity CreateActivity()
{

//Variable
var FirstName = new Variable<System.String>();
var LastName = new Variable<System.String>();

//FlowStep
ExecuteService ExecuteServiceObject1 = new ExecuteService()
{
Result = new System.Activities.OutArgument<System.String>(FirstName)
};
FlowStep FlowStepObject1 = new FlowStep() { Action = ExecuteServiceObject1 };

ExecuteService ExecuteServiceObject2 = new ExecuteService()
{
Result = new System.Activities.OutArgument<System.String>(LastName)
};
FlowStep FlowStepObject2 = new FlowStep() { Action = ExecuteServiceObject2 };

FlowStepObject1.Next = FlowStepObject2;

//Flowchart
Flowchart FlowChartObject1 = new Flowchart()
{
Variables =
{
FirstName,

LastName
},

StartNode = FlowStepObject1,
Nodes =

Thinking about new C# method prototypes: object as dictionary

  
I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

GridView Parent Child View with JQuery Effects

  
I was just checked how to add some more cool effects to the GridView control using JQuery. In this post I will display parent-child data in the GridView control with some help of the wonderful JQuery library.

Let's first populate the GridView control.

HttpContext.Items and Server.Transfer/Execute

  
The problem was basically that when a Server.Transfer call was applied the script container (and also various ClientScriptProxy script embedding routines) would potentially fail to load up the specified scripts.

want to execute url without showing that page or url to client.

  

hello friends,

I need ur help,what i want to do is to execute a url ("To send a text message to client") on client registration but without showing that url page, in short executing url without displaying any page or url to the client.

please help and thanks in advance.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend