Microsoft Content Management Server - Custom Approval Assitant page.Approve() doesn't approves postings

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > July 2005 > Custom Approval Assitant page.Approve() doesn't approves postings





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Custom Approval Assitant page.Approve() doesn't approves postings
hecgom@gmail.com

2005-07-13, 6:00 pm

Hi all!!

I'm working in an extension of the CMS standard workflow. I'm in the
part of the Custom Approval Assitant and when I arrive to the point of
invoke the posting.Approve() method for each posting the user could
approve (remember is the Custom Approval Assistant page), the posting
doesn't gets approved. The same issue with the posting.Decline()
method. There's no error or Exception messages. Just the posting stills
in the same "waiting for ... approval" point.


This behavior is only in the buttons of my custom approval assistan
page, the buttons of the web author console works fine.


BTW, I'm developing this using the guide of the Microsoft's
"Integration Techniques and Strategies for Internet Business" book, and
for the custom approval page I'm using the one included in the example
project available for download with the book.


Many Thanks in advance!!!

Stefan [MSFT]

2005-07-14, 2:48 am

Hi,

without knowing your code it is impossible to answer this question.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


<hecgom@gmail.com> wrote in message
news:1121286812.112630.32030@g44g2000cwa.googlegroups.com...
> Hi all!!
>
> I'm working in an extension of the CMS standard workflow. I'm in the
> part of the Custom Approval Assitant and when I arrive to the point of
> invoke the posting.Approve() method for each posting the user could
> approve (remember is the Custom Approval Assistant page), the posting
> doesn't gets approved. The same issue with the posting.Decline()
> method. There's no error or Exception messages. Just the posting stills
> in the same "waiting for ... approval" point.
>
>
> This behavior is only in the buttons of my custom approval assistan
> page, the buttons of the web author console works fine.
>
>
> BTW, I'm developing this using the guide of the Microsoft's
> "Integration Techniques and Strategies for Internet Business" book, and
> for the custom approval page I'm using the one included in the example
> project available for download with the book.
>
>
> Many Thanks in advance!!!
>



hecgom@gmail.com

2005-07-14, 5:51 pm

Hi Stefan, well, here is my code:

Both buttons of the Custom Approval Page invokes this function:

private void ButtonClick(bool approvePosting)
{
// Get the current MCMS context.
CmsHttpContext cmsContext = CmsHttpContext.Current;

// Return if the CmsHttpContext variable is null
// because it's needed for further execution.
if (cmsContext == null)
{
return;
}

// Create a WorkflowManager object for workflow validation.
WFE.WorkFlowEngine workflowManager = new WorkFlowEngine();
// Iterate over the rows in the HTML table of postings
// awaiting approval.
foreach (HtmlTableRow tr in unapprovedPostingsTable.Rows)
{
// Iterate over the cells within each row in
// the table.
foreach (HtmlTableCell td in tr.Cells)
{
// Iterate over the controls in each cell.
foreach (Control control in td.Controls)
{
// Check whether the control is a check box.
if (control is HtmlInputCheckBox)
{
HtmlInputCheckBox inputCheckBox = control
as HtmlInputCheckBox;

// If the check box is checked,
// execute code to either approve
// or decline the posting.
if (inputCheckBox.Checked)
{
try
{
// The control ID is the GUID for a
posting.
// Use the GUID to get the posting.
Posting posting =
cmsContext.Searches.GetByGuid(inputCheckBox.ID) as Posting;

// If the value of approvePosting
is
// true, approve the posting.
// Otherwise, decline it.
if (approvePosting)
{
int newStatus =
workflowManager. subePostingStatusAppAss(posting,cmsConte
xt.User.ServerAccountName);
if (newStatus==3) posting.Approve();
}
else
{
// Decline the posting.
// string sql = "insert into log (log_txt) values ('intenta
declinar posting: "+posting.Guid+"')";
// string DBConn =
System.Configuration.ConfigurationSettings.AppSettings["DBConnWFE"];
// SqlHelper.ExecuteNonQuery(DBConn,System.Data.CommandType.Text,sql);
int newStatus =
workflowManager. bajaPostingStatusAppAss(posting,cmsConte
xt.User.ServerAccountName);
if (newStatus==-1) posting.Decline();

}
// Commit changes to the posting.
cmsContext.CommitAll();
}
catch (Exception ex)
{
// Display an error message if an
// exception occurred.
this.ErrorMessage = ex.Message;

// Roll back any changes that have
// been made.
cmsContext.RollbackAll();
return;
}
}
}
}
}
}
// Refresh the page to show updated content.
Response.Redirect(Request.Url.AbsoluteUri, false);
}

btw, no exception is generated

thanks

hecgom@gmail.com

2005-07-14, 5:51 pm

UPDATE: I've found that when it should approve the posting and doesn't
do it, it fires an Event Log Warning:

CommitChanges() - Warning: Node d not committed or rolled back at start
of commit.

Stefan [MSFT]

2005-07-14, 5:51 pm

Hi,

then you should open a support case for this.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


<hecgom@gmail.com> wrote in message
news:1121366135.413056.51950@g47g2000cwa.googlegroups.com...
> UPDATE: I've found that when it should approve the posting and doesn't
> do it, it fires an Event Log Warning:
>
> CommitChanges() - Warning: Node d not committed or rolled back at start
> of commit.
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com