www.skelta.com
Home      Members   Calendar   Who's On

Welcome Guest ( Login | Register )
      

Home » Skelta Workflow Net » Skelta Workflow Net » Application Development » Get all previous comments and decisions

23 posts, Page 2 of 3. ««123»»

Get all previous comments and decisionsExpand / Collapse
Author
Message
Posted Monday, January 14, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, February 04, 2008
Posts: 21, Visits: 51
in each action i need to display all previous comments and decissions.
Post #307
Posted Monday, January 14, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 12:17 AM
Posts: 136, Visits: 600

Hi,

 

As per the workflow that you’ve designed, to capture the comments you need to declare 2 variables each approval of type string, one for CommentApproved and other for CommentRejected.

 

This could be done at design time (In the start activity) or runtime (Before you execute the workflow)

 

Design Time (In the start activity):

 

You need to declare variables of type string in the start activity as follows:

 

 

OR

 

Runtime (Before you execute the workflow) [I recomment this option]:

 

        VariablesCollection varCol = new VariablesCollection();

        varCol.Add("^Approval1CommentApproved", "string", "");

        varCol.Add("^Approval1CommentRejected", "string", "");

        varCol.Add("^Approval2CommentApproved", "string", "");

        varCol.Add("^Approval2CommentRejected", "string", "");

        varCol.Add("^Approval3CommentApproved", "string", "");

        varCol.Add("^Approval3CommentRejected", "string", "");

 

        Client client = new Client("RepositoryName","WorkflowName");

        client.Execute("userprovider::userid", "<data>1</data>",varCol);

        client.Close();

 

And you can display the details in the custom ASPX page as follows:

 

You can access the variables as follows:

 

protected WebWorkItemAdapter adapter;

   

    protected void Page_Load(object sender, EventArgs e)

    {

        if (!this.IsPostBack)

        {

           

            adapter = new WebWorkItemAdapter();

            adapter.ProcessWebChannelRequest();           

if (string.IsNullOrEmpty(adapter.CurrentWorkItem.CurrentContext.Variables["^Approval1CommentApproved"].Value))

{

// handle it

}

      }

    }

Regards,

Bineesh E Raghavan

Post #308
Posted Monday, January 14, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, February 04, 2008
Posts: 21, Visits: 51
well, i would like to preview all previous comments and decisions for each action.

In other word, in appoval2 i will see what happen in approval1 and so on.

Post #309
Posted Monday, January 14, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, February 04, 2008
Posts: 21, Visits: 51
Thanks very much for your help, i will test the code immediatily and feedback you.

but almost it will work...

Post #310
Posted Monday, January 14, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 12:17 AM
Posts: 136, Visits: 600

Hi,

 

Please place a script activity in between Approval1 and Approval2. In Script activity, the fifth parameter of Run method, i.e. inlink, which is of type string holds the decision that has been taken up by the previous activity. So please declare a variable of type string in variableCollection. Eg: Approval1Decision

 

I’ve used the CSharp as my scripting language.

 

public class Script1

{

public string Run(int ExecutionId, int ExecutionDetailsId, Workflow.NET.Engine.Context ctx, Action action, string inlink)

{

ctx.Variables["Approval1Decision"] = inlink;

ctx.SaveVariables();

return “”;

}

}

 

And you can display the value to show which decision has been taken by the previous activity.

 

Regards,

Bineesh E Raghavan

Post #311
Posted Monday, January 14, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Wednesday, June 04, 2008
Posts: 131, Visits: 423
Hi,

If you have single actor for each of this activity you could also make use of the system variables to check what decision was taken. These variable have to be added similar to CommentsApproved, CommentsRejected variables for each activity.
string approveUsersName = "^" + activityName + "ApprovingUsers";
string rejectUsersName = "^" + activityName + "RejectingUsers";

By checking the value for each of the variable you can decide if the activity output was Approved or Rejected.

string outPutApproval1="";
if (string.IsNullOrEmpty(CurrentContext.Variables["^Approval1ApprovingUsers"].Value))
{
   outPutApproval1="Rejected"; 
 }
else
{
outPutApproval1="Approved"; 

}

Please not that this variable is of type Array and you have to Use an ArrayList to get the value of the variable

ArrayList temp = new ArrayList();
temp = (ArrayList)CurrentContext.Variables["^Approval1ApprovingUsers"].Value;


Moderator

Post #312
Posted Tuesday, January 15, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, February 04, 2008
Posts: 21, Visits: 51
Thanks to all for reply,

I did as you said, so i get the variables without values, although i inserted commenst in the actions.

Please find the screen shot.

  Post Attachments 
Screenshot.JPG (73 views, 140.52 KB)

Post #334
Posted Tuesday, January 15, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 12:17 AM
Posts: 136, Visits: 600

Hi,

 

Please remove the "s" from all the variables and try again.

 

For Eg: From "^Approval1CommentsApproved" to "^Approval1CommentApproved".

 

I apologize for the miscommunication in the earlier post and it is corrected now.

 

Please refer to the post. http://www.skelta.com/forum/FindPost308.aspx
 

Regards,

Bineesh E Raghavan

Post #335