Re: [rt-users] Approval workflow problem

2008-10-14 Thread Andro

Hi sunnavy

1 I checked the scrip, my RT seems to have it. Some info are below:
  (1) my RT view
   http://www.nabble.com/file/p19986078/10.png 
  (2) Custom action preparation code(copy from RT web interface):
   # --- #
return(0) unless ( lc($self-TransactionObj-NewValue) eq rejected or
   lc($self-TransactionObj-NewValue) eq deleted );

my $rejected = 0;
my $links = $self-TicketObj-DependedOnBy;
foreach my $link (@{ $links-ItemsArrayRef }) {
my $obj = $link-BaseObj;
if ($obj-QueueObj-IsActiveStatus($obj-Status)) {
if ($obj-Type eq 'ticket') {
$obj-Comment(
Content = $self-loc(Your request was rejected.),
);
$obj-SetStatus(
Status  = 'rejected',
Force   = 1,
);

$T::Approval = $self-TicketObj; # so we can access it inside 
templates
$self-{TicketObj} = $obj;  # we want the original id in the token 
line
$rejected = 1;
}
else {
$obj-SetStatus(
Status  = 'deleted',
Force   = 1,
);
}
}
}

$links = $self-TicketObj-DependsOn;
foreach my $link (@{ $links-ItemsArrayRef }) {
my $obj = $link-TargetObj;
if ($obj-QueueObj-IsActiveStatus($obj-Status)) {
$obj-SetStatus(
Status  = 'deleted',
Force   = 1,
);
}
}

# Now magically turn myself into a Requestor Notify object...
require RT::Action::Notify; bless($self, 'RT::Action::Notify');
$self-{Argument} = 'Requestor'; $self-Prepare;

return $rejected;
# --- #

2 I had checking the log, but I don't know how to read it.
   I post it is below:
   (1) when I created ticket, the log is below:
 Oct 15 10:49:01 darkmoon RT: About to think about scrips for
transaction #452
Oct 15 10:49:01 darkmoon RT: About to think about scrips for transaction
#453
Oct 15 10:49:02 darkmoon RT: About to think about scrips for transaction
#454
Oct 15 10:49:02 darkmoon RT: About to think about scrips for transaction
#455
Oct 15 10:49:02 darkmoon RT: About to think about scrips for transaction
#456
Oct 15 10:49:02 darkmoon RT: About to prepare scrips for transaction #456
Oct 15 10:49:03 darkmoon RT: Found 5 scrips for TransactionCreate stage with
applicable type(s) Create
Oct 15 10:49:03 darkmoon RT: Line: ===
Oct 15 10:49:03 darkmoon RT: Line: ===Create-Ticket: poreq
Oct 15 10:49:03 darkmoon RT:   Create ticket: create-poreq
Oct 15 10:49:04 darkmoon RT: Line: Subject: Approve purchase order for
{$Tickets{'TOP'}-Subject}
Oct 15 10:49:04 darkmoon RT: Line: Depended-On-By: TOP
Oct 15 10:49:04 darkmoon RT: Line: Queue: General
Oct 15 10:49:04 darkmoon RT: Line: Type: approval
Oct 15 10:49:05 darkmoon RT: Line: Owner: andro
Oct 15 10:49:05 darkmoon RT: Line: Content: Someone has created a purchase
requisition. Please review and approve it, so they can spend some money.
Oct 15 10:49:05 darkmoon RT: Line: ENDOFCONTENT
Oct 15 10:49:06 darkmoon RT: About to commit scrips for transaction #456
Oct 15 10:49:06 darkmoon RT: Committing scrip #16 on txn #456 of ticket #69
Oct 15 10:49:06 darkmoon RT: In CreateByTemplate
Oct 15 10:49:06 darkmoon RT: Workflow: processing create-poreq of
RT::Ticket=HASH(0x4f0ebc0)
Oct 15 10:49:07 darkmoon RT: Workflow: evaluating Subject: Approve purchase
order for {$Tickets{'TOP'}-Subject} Depended-On-By: TOP Queue: General
Type: approval Owner: andro Content: Someone has created a purchase
requisition. Please review and approve it, so they can spend some money. 
ENDOFCONTENT
Oct 15 10:49:07 darkmoon RT: Workflow: yielding Subject: Approve purchase
order for A10 Depended-On-By: TOP Queue: General Type: approval Owner: andro
Content: Someone has created a purchase requisition. Please review
andapprove it, so they can spend some money.  ENDOFCONTENT
Oct 15 10:49:07 darkmoon RT: About to think about scrips for transaction
#457
Oct 15 10:49:07 darkmoon RT: About to think about scrips for transaction
#458
Oct 15 10:49:08 darkmoon RT: About to think about scrips for transaction
#459
Oct 15 10:49:08 darkmoon RT: About to think about scrips for transaction
#460
Oct 15 10:49:08 darkmoon RT: About to think about scrips for transaction
#461
Oct 15 10:49:08 darkmoon RT: About to prepare scrips for transaction #461
Oct 15 10:49:09 darkmoon RT: Found 5 scrips for TransactionCreate stage with
applicable type(s) Create
Oct 15 10:49:09 darkmoon RT: Line: ===
Oct 15 10:49:09 darkmoon RT: Line: ===Create-Ticket: poreq
Oct 15 10:49:09 darkmoon RT:   Create ticket: create-poreq
Oct 15 10:49:10 darkmoon RT: Line: Subject: Approve purchase order for
{$Tickets{'TOP'}-Subject}
Oct 15 10:49:10 darkmoon RT: Line: Depended-On-By: TOP
Oct 15 10:49:10 darkmoon RT: Line: Queue: General
Oct 15 10:49:10 darkmoon RT: Line: Type: approval
Oct 15 10:49:11 darkmoon RT: Line

Re: [rt-users] Approval workflow problem

2008-10-13 Thread Andro

Hi sunnavy

I show you my practice as below(some image files):
Step 1. I create an ticket
http://www.nabble.com/file/p19951001/1.png 

Step 2. Result of creating ticket (including the Links)
http://www.nabble.com/file/p19951001/3.png 

Step3. Ticket in the queue(pending approval)
http://www.nabble.com/file/p19951001/4.png 

Step4. Rejecting the approval
http://www.nabble.com/file/p19951001/5.png 

Step5. Approval's status change from 'new' to 'rejected'
http://www.nabble.com/file/p19951001/6.png 

Step6. The original ticket still in the queue 
http://www.nabble.com/file/p19951001/7.png 

My problem is Step 6 , why the original ticket didn't be rejected ?

Best regards,
Andro

Hi Andro

Just after you create the original ticket, does the ticket depend on  
the approval ticket?
If the header stuff is correct, the original ticket should depend on  
the approval ticket, and won't be changed because of the reject thing.

All things are fine to me.



-- 
View this message in context: 
http://www.nabble.com/Approval-workflow-problem-tp19894456p19951001.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Re: [rt-users] Approval workflow problem

2008-10-12 Thread Andro

Hi sunnavy

Thanks for your respone.
But I didn't make this mastake, because I had read the manual:
http://wiki.bestpractical.com/view/ApprovalCreation
My problem is the process logic: When an approval is rejected, its original
ticket should be rejected automatically.
In my enviroment, When I reject the approval, its original ticket just
didn't depend on
the approval. The original ticket didn't be rejected.
In othe words, the original ticket still in the queue.

Best regards,
Andro

sunnavy-2 wrote:
 
 Hi Andro
 
 try to move the line Depended-On-By: TOP out of the Content: ...  
 ENDOFCONTENT block, e.g. move it above the Content: ... line.
 
 This should fix the problem.
 
 Good luck!
 
 On Oct 9, 2008, at 4:18 PM, Andro Wei wrote:
 
 Hi all

 According to the book: RT Essentials page 94. It say : Once an  
 approval is rejected, its original ticket is immediately rejected,  
 and all of its other approvals are rejected as well.
 I test it in my RT system (version 3.8.1), but in fact RT does not  
 follow the rule mentioned above.
 When I rejected the approval, RT system just changed the approval  
 ticket' status to Reject,
 and the original ticket didn't change anything. Because the approval  
 ticket's status setted to Reject,
 the original ticket didn't depend on the approval, so the original  
 ticket displayed in the queue without approving.

 I think the action about Approval does not make sense.
 The original ticket should be rejected automatically.
 Anyone had the same problem?? And how did you solve it?
 Thanks!!


 ___
 http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

 Community help: http://wiki.bestpractical.com
 Commercial support: [EMAIL PROTECTED]


 Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
 Buy a copy at http://rtbook.bestpractical.com
 
 
 best wishes
 sunnavy
 
 
 
 
 
 ___
 http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
 
 Community help: http://wiki.bestpractical.com
 Commercial support: [EMAIL PROTECTED]
 
 
 Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
 Buy a copy at http://rtbook.bestpractical.com
 
 

-- 
View this message in context: 
http://www.nabble.com/Approval-workflow-problem-tp19894456p19948597.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.

___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com