Windows Workflow Foundation 3


WF - "no public writable property named " error help needed..


Hi,
 
   I am new to Windows Workflow foundation..  When i run my project it show the following exception.. i have searched many forums related to this.. but I AM NOT ABLE TO SOLVE THIS. Please help me.. I have paste my coding here...
 
Calling Method :
===========
// Declare and Initiatiate the Dictionary object for WorkFlow.
Dictionary<string, Object> DictionaryStaffdetail = new Dictionary<string, Object>();
DictionaryStaffdetail.Add("status", objBoModel.PStatus.ToString());
 
Workflow class :
=============
private string Status;
public string status
{
get { return Status; }
set { Status = value; }
}
 
ifElseBranchActivity1... condition
========================
this.Status == "New"
 
i got the following error :
 
" The activity 'Workflow1' has no public writable property named 'status'. "
 
Please help me to solve this error....
 
I am expecting your replay...
 
Thanks and Regards
Naarayanan.S
 
 
 
Hi Nags,
 
Thanks for your replay... As per ther replay I have checked the typeof(Workflow1) and call the "goto definiation"
that referes old dll of the workflow1. That DLL contains "EmailId" property so it shows error..
 
I have deleted the DLL reference, rebind the new , Now it is working correctly...Thanks for your help...
 
Now I am working , further implementation .. If I have any clarification , I will check with you..
 
Thanks for your kind co-operation..
 
Thanks and Regards
Sankaran.S
 
Hi Sankaran,
The Dictionary Key is case sensitive. Have the following code change in Workflow Class and try.
Workflow class :
=============
private string status;
public string Status
{
get { return status; }
set { status = value; }
}
Regards,
Nags
 
Hi Nags,
 
 Thanks for your replay..
  
  status is passing param and  Status is Workflow class local variable. so that I can differentiate with case sensitive.
 
  I have also tried your steps.. but i got the same error...
 
  I need one more clarification :  There is any different from calling workflow in .NET Windows Application and
  ASP.NET Application. Because i have tried simple calculator program in winforms. I have passed same procedure of  params its works fine.
 
Now the above code is ASP.NET Apllication .. Please clarify any procedure i have to flow?
 
I am expecting your reply.
 
Thanks and Regards
Sankaran
 
  
Hi Sankaran,
There is no such code difference between .NET Windows Application and ASP.NET Application. If you are getting any error due to the difference in hosting environment, your error message will help analyzing more on that.
Thanks,
Nags
Hi Nags,
 
" The activity 'Workflow1' has no public writable property named 'status'. "
 
Still I am not able to solve the problem.... Could you please help me?  OR Could you please post sample ASP.NET application with Workflow..simple sample is enough... Please copy ,paste or send sample code  to ssn_ram07#yahoo.com... This error is confusing me...
 
Please consider and replay, I am expecting your replay.Urgent please...
 
Thanks and Regards
Sankaran.S
 
 
I am interested in solving the issue than sending the sample solution. Can you upload the entire code so that I will try to resolve?
Thanks,
Nags
 
Hi Nags,
 
How to upload my source.. Please send the procedure or your email ID...
 
I have only called the workflow... and manually add the parameter and value.. I have not done nothing extra...
 
Here is the code : default.aspx.cs
 
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Workflow.Activities;
using System.Workflow.Runtime;
using System.Workflow.ComponentModel;
using System.Workflow.Interop;
using System.Threading;
using System.Collections.Generic;
using ProjWorkflow;
public partial class _Default : System.Web.UI.Page
{
private WorkflowRuntime _workflowruntime;
private AutoResetEvent _waithandle = new AutoResetEvent(false);
protected void Page_Load(object sender, EventArgs e)
{
InitializeWorkflowRuntime();
Dictionary<String, Object> wfArguments = new Dictionary<string, object>();
wfArguments.Add("eamil", "test#san.co.in");
WorkflowInstance instance = _workflowruntime.CreateWorkflow(typeof(Workflow1), wfArguments);
instance.Start();
_waithandle.WaitOne();
}
public void InitializeWorkflowRuntime()
{
_workflowruntime = new WorkflowRuntime();
_workflowruntime.WorkflowCompleted += delegate(object Sender, WorkflowCompletedEventArgs e)
{
_waithandle.Set();
};
_workflowruntime.WorkflowTerminated += delegate(object Sender, WorkflowTerminatedEventArgs e)
{
_waithandle.Set();
};
}
}
 
 
Workflow.cs
=========
 
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using System.Data;
using System.Data.SqlClient;
namespace ProjWorkflow
{
public sealed partial class Workflow1: SequentialWorkflowActivity
{
 
public string Emailid;
public string email
{
get { return Emailid ; }
set { Emailid = value; }
}
 
public Workflow1()
{
InitializeComponent();
}
private void codeActivity1_ExecuteCode(object sender, EventArgs e)
{
string pempid, status;
// Not yet coded...
}
private void codeActivity2_ExecuteCode(object sender, EventArgs e)
{
string pempid, status;
string result;
// Not yet coded....
}
}
}
 
 
I got the "The activity 'Workflow1' has no public writable property named 'eamil'." error...
 
Please gothrough the code and help me to solve this problem...
 
Thanks and Regards
Sankaran.S
Sankaran,
Can you try out this simple change and let me know?
In your  default.aspx.cs, change the following 
From:
wfArguments.Add("eamil", "test#san.co.in");
To:
wfArguments.Add("email", "test#san.co.in");
Seems it is a spelling mistake for the text that refers to the Public Property in the Workflow Class. 
Thanks,
Nags
 
Hi Nags,
 
Thanks for your replay..  Excellent Nags.. This sample just now i created , this working fine.I have changed the code...
My real program is using MVC pattern, Program calling through other  layers so that I have checked simple aspx page...
 
My Orginal code is : I have called this method after update...
 
Model Layer :
 
public static void ExecuteWF(string StaffID, string Process)
{
// created the workflowruntime object
using (WorkflowRuntime workflowruntime = new WorkflowRuntime())
{
// using Threading class raise the AutoResetEvent and passed the param as .f.
AutoResetEvent waithandle = new AutoResetEvent(false);
// respond the WF Event is completed...
workflowruntime.WorkflowCompleted += delegate(object WFSender, WorkflowCompletedEventArgs Wfe)
{
waithandle.Set();
};
 
ClsStaffBase objBoModel = new ClsStaffBase();
objBoModel.PEmployeeId = StaffID;
objBoModel.PEmail = Process;
 
// Declare and Initiatiate the Dictionary object for WorkFlow.
Dictionary<string, Object> DictionaryStaffdetail = new Dictionary<string, Object>();
 
 
// set the email as parameters
DictionaryStaffdetail.Add("email", objBoModel.PEmail.ToString());
WorkflowInstance instance = workflowruntime.CreateWorkflow(typeof(Workflow1), DictionaryStaffdetail);
instance.Start();
waithandle.WaitOne();
}
}
 
Workflow1.CS
============
 
public string Emailid;
public string email
{
get { return Emailid ; }
set { Emailid = value; }
}
 
I got the error...
ex = {"The activity 'Workflow1' has no public writable property named 'email'."}
 
Thanks for putting effort with this... please check the above code what is really i am missing...
 
Thanks and Regards
Sankaran.S
 
Hi Sankaran,
I simulated the code, but did not get any error. Can you recheck the error message that you have posted in the forum?
Thanks,
Nags
Hi Nags,
 
    I am using MVC (Moduel View Controller) pattern Framework, 
 
   a)  I have created simple Workflow i.e accept only one parametter for testing. Then I have added this workflow project reference in to my MVC Pattern project.
 
   b)  My test MVC project contains only one aspx page. Function of this page is Add/Edit/View/Delete Staff details.It contains one grid and textboxes only.
 
   c)  I have called this work flow After the Updation in Edit State through the model layer. ( Already I posted my workflow reference calling codes).
   
   d)  In this situation i got the "workflow public property error" (that i requested).
 
  Could you please clarify any difference in workflow calling  with ASP.NET 3-tier/MVC Architecture.
 
   I need to implement Workflow in MVC pattern this is my task.. Same workflow code is worked in single tier sample    application (Yester day u solved).
 
   This is my environment. Please can you check with multi-tier application and Workflow foundation.
 
   I am expecting your replay..
 
Thanks and Regards
Sankaran.S
 
AFAIK, Workflow won't behave differently because of Architecture or layering. I suppose the issue is due to the wrong Workflow Type (Workflow1 in your case) being referred. Try to check whether your correct Workflow Assembly is getting called. Good luck.
Thanks,
Nags
 
Hi Nags,
 
Thanks for your replay... As per ther replay I have checked the typeof(Workflow1) and call the "goto definiation"
that referes old dll of the workflow1. That DLL contains "EmailId" property so it shows error..
 
I have deleted the DLL reference, rebind the new , Now it is working correctly...Thanks for your help...
 
Now I am working , further implementation .. If I have any clarification , I will check with you..
 
Thanks for your kind co-operation..
 
Thanks and Regards
Sankaran.S
 

Related Links

WWF with .NET compact framework 2.0
How can I query StateMachineWorkflowInstance before the WF idles
Question about modifying a workflow
Rule Conditions against custom activities and XAML activation - how should I achieve this?
MOSS Publishing Site
WF custom persistence once again
Hands on Labs 2.2
WF Virgin
Error in the Hands on lab 09
Workflow Designer
How do you load XOML only State Workflow in WFPad for WWFBeta 2.2 (with namespace for codebehind assembly, and activities)?
invoke sub StateMachine workflow
Using WWF to model and support "Tech Trees" in RTS games
RuleConditionDialog and intellisense
Workflow Persistence & Event Arguments
PersistenceService - Transaction Timeout

Categories

MSDN
Visual Studio Languages
Windows and Windows ph...
Game Development
Data Platform Developm...
SQL Server
SQL Server (Pre-release)
Development
Unified Communications
Archive
Archived Forums A-B
Archived Forums C-D
Archived Forums N-R
Windows Phone Preview ...
Internet of Things
Cortana
Where is the Forum For…?
Off-Topic Posts (Do No...
Visual F#
Visual Studio Code Vis...
Windows Desktop Develo...
Development with the W...
Message Analyzer
Developing Apps for Sh...
SharePoint 2013 - Search
SharePoint 2013 - Setu...
SharePoint 2010 - Setu...
Azure API Management
Machine Learning
Azure App Service - AP...
Azure Functions
Team Foundation Server...
Team Foundation Server...
Team Foundation Server...
Visual FoxPro General
BizTalk Server RFID
ADO.NET Managed Providers
Microsoft Solver Found...
Microsoft Live Labs Volta
Microsoft Translator D...
Small Basic
SQL Server Integration...
SQL Server Reporting S...
SQL Server Data Access
SQL Server Migration
SQL Server Master Data...
SQL Server In-Memory T...
SQL Server 2012 Spatia...
Windows Forms Data Con...
SDK for Home Server 20...
Windows Live Writer: D...
WebsitePanel - Develop...
MSDN Magazine
Microsoft Automatic Gr...
Bing Maps General
Bing Maps Web Controls
Project Customization ...
Microsoft Atlas APIs: ...
Microsoft Lync Persist...
Microsoft Lync Server ...
Silverlight 5
Hosting and Streaming ...
Game Development with ...
Silverlight Video and ...
Expression Studio with...
Expression Blend + Ske...
Microsoft Security Dev...
Retired SharePoint Soc...
.NET Framework Network...
ASMX Web Services and ...
Casablanca
Deep Zoom Composer
DNS and Traffic Manager
LINQ to SQL (Pre-Release)
Microsoft ESP Platform...
Moderator Posting Only...
Microsoft "Data Explor...
Office Development wit...
Office Live Small Busi...
Parallel Computing Pla...
Phoenix
Oracle on Azure
Silverlight (formerly ...
Security for Azure
SQL Server Modeling
Storage Platform – ATA
SQL Creation
Visual Basic 2008 (Pre...
Visual Studio Team Ser...
Visual Studio Editor i...
Visual Studio Source C...
Visual Studio Tools fo...
Windows MultiPoint Mou...
Building Windows Store...
Tools for Windows Stor...
SQL Server 2016 Preview
Microsoft Partner Cent...

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile