RTx::WorkflowBuilder is now available on CPAN

Hi,

RTx::WorkflowBuilder is a tool that helps you configure multi-stage
approval workflow in rt.

It is now available at http://search.cpan.org/dist/RTx-WorkflowBuilder/.

examples can be found in the doc at http://search.cpan.org/dist/RTx-WorkflowBuilder/bin/rt-workflow

Cheers,
CLK

Hi,

RTx::WorkflowBuilder is a tool that helps you configure multi-stage
approval workflow in rt.

It is now available at http://search.cpan.org/dist/RTx-WorkflowBuilder/.

Hi Chia-liang,

This looks good, although it doesn’t appear to work smoothly yet.

  1. In your pod you have:

    % bin/rt−workflow PO PO‐Approval −−create

Which should probably read:

% bin/rt−workflow --create PO PO‐Approval
  1. When I had set up the workflow within my RT_SiteConfig.pm, and run the
    bin/rt-workflow script to create the scrips and templates, I naturally
    created a ticket. Nothing happened, but I noticed in the logs there was the
    following entry:

    Found 0 scrips for TransactionBatch stage with applicable type(s)

So, I changed went into:

Configuration -> Queues -> crs -> Scrips

and changed “Stage” from “Transaction Create” to “Transaction Batch”.

  1. The next time I created a ticket, the workflow/approval mechanism kicked in
    and the log files filled up, but no approvals were created - because of a
    stray character:

ENDOFCONTENT (/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:669)
[Thu Feb 26 14:50:29 2009] [error]: Ticket creation failed: Unrecognized
character \xE2 in column 44 at template line 1.

Stack:
[template:1]
[/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:667]
[/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:366]
[/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:303]
[/opt/rt3/bin/…/lib/RT/ScripAction_Overlay.pm:238]
[/opt/rt3/bin/…/lib/RT/Scrip_Overlay.pm:464]
[/opt/rt3/bin/…/lib/RT/Scrips_Overlay.pm:196]
[/opt/rt3/bin/…/lib/RT/Scrips_Overlay.pm:175]
[/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm:3165]
[/opt/rt3/local/html/Ticket/Create.html:394]
[/opt/rt3/share/html/autohandler:311]
(/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:672)
[Thu Feb 26 14:50:29 2009] [warning]: Exiting subroutine via next
at /opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm line 678.
(/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:678)

I’m not sure which bit of which Template, or code, might be causing this
error, but I think we’re close to having a working Approvals system in the
outside world though. What do you think?

Richard Foley
Ciao - shorter than aufwiedersehen

Oh, wait a minute, there’s more.

  1. Going into:

    Configuration -> Queues -> crs -> Scrips

I made sure each subject line was on single line and replaced a couple of stray dashes, (I think the \xE2 was
a “−>” thing instead of a “−>” thing in the auto-generated template from bin/rt-workflow - which was installed via
the CPAN), like this:

  1. Which brought me to this error:

    Use of uninitialized value $content in concatenation (.) or string
    at /opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm line 669.

Which I fudged with this:

    $content = '' unless $content;
  1. Which brought me to here:

[Thu Feb 26 16:50:59 2009] [debug]: Workflow: processing create-workflow-Implemented Approval of
RT::Ticket=HASH(0x7fe03efb52f0) (/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:360)
[Thu Feb 26 16:50:59 2009] [debug]: Workflow: evaluating
Refers-To: TOP
Queue: ___Approvals
Owner:
Requestors: {$Tickets{TOP}->Requestors}
Depended-On-By: TOP
Type: approval
Depends-On: workflow-Tested Approval
Content-Type: text/plain
Due: {time + 86400}
Content: xxx
ENDOFCONTENT (/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:653)
[Thu Feb 26 16:50:59 2009] [debug]: Workflow: yielding (/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:671)
[Thu Feb 26 16:50:59 2009] [debug]: not a recognised queue object. (/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm:279)
[Thu Feb 26 16:50:59 2009] [debug]: RT::Ticket=HASH(0x7fe03f1c0278) No queue given for ticket creation.
(/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm:284)
[Thu Feb 26 16:50:59 2009] [error]: Couldn’t create related ticket create-workflow-Implemented Approval for 16
Could not create ticket. Queue not set (/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:391)

Which makes me think I must be yet closer to a working approvals system, but still no potato in sight…sigh!

All (helpful) suggestions welcome, Chia-liang!

Richard Foley
Ciao - shorter than aufwiedersehen

http://www.rfi.net/On Thursday 26 February 2009 16:20:49 Richard Foley wrote:

On Tuesday 24 February 2009 12:42:15 Chia-liang Kao wrote:

Hi,

RTx::WorkflowBuilder is a tool that helps you configure multi-stage
approval workflow in rt.

It is now available at http://search.cpan.org/dist/RTx-WorkflowBuilder/.

Hi Chia-liang,

This looks good, although it doesn’t appear to work smoothly yet.

  1. In your pod you have:

% bin/rt−workflow PO PO‐Approval −−create

Which should probably read:

% bin/rt−workflow --create PO PO‐Approval

  1. When I had set up the workflow within my RT_SiteConfig.pm, and run the
    bin/rt-workflow script to create the scrips and templates, I naturally
    created a ticket. Nothing happened, but I noticed in the logs there was the
    following entry:

Found 0 scrips for TransactionBatch stage with applicable type(s)

So, I changed went into:

Configuration -> Queues -> crs -> Scrips

and changed “Stage” from “Transaction Create” to “Transaction Batch”.

  1. The next time I created a ticket, the workflow/approval mechanism kicked in
    and the log files filled up, but no approvals were created - because of a
    stray character:

ENDOFCONTENT (/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:669)
[Thu Feb 26 14:50:29 2009] [error]: Ticket creation failed: Unrecognized
character \xE2 in column 44 at template line 1.

Stack:
[template:1]
[/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:667]
[/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:366]
[/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:303]
[/opt/rt3/bin/…/lib/RT/ScripAction_Overlay.pm:238]
[/opt/rt3/bin/…/lib/RT/Scrip_Overlay.pm:464]
[/opt/rt3/bin/…/lib/RT/Scrips_Overlay.pm:196]
[/opt/rt3/bin/…/lib/RT/Scrips_Overlay.pm:175]
[/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm:3165]
[/opt/rt3/local/html/Ticket/Create.html:394]
[/opt/rt3/share/html/autohandler:311]
(/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:672)
[Thu Feb 26 14:50:29 2009] [warning]: Exiting subroutine via next
at /opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm line 678.
(/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:678)

I’m not sure which bit of which Template, or code, might be causing this
error, but I think we’re close to having a working Approvals system in the
outside world though. What do you think?


Richard Foley
Ciao - shorter than aufwiedersehen

http://www.rfi.net/


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

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

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

I made sure each subject line was on single line and replaced a couple of stray dashes, (I think the \xE2 was
a “−>” thing instead of a “−>” thing in the auto-generated template from bin/rt-workflow - which was installed via
the CPAN), like this:

Did you copy and paste from perldoc?

If so, you’re running into nroff/man being “too smart”.

LC_ALL=C perldoc RTx::WorkflowBuilder will get you things you can copy
and paste safely.

Hi Chia-liang et al,

It transpires the approval ticket is actually created, although I am unable to
see it unless I look up the id directly, even though my user currently has
every right imaginable. Further, when I reject the (hidden) approval, this
appears to be succesful. However, when I resolve the (still hidden)
approval, I see the following error:

System error
error: Can’t call method “HasUnresolvedDependencies” on an undefined value
at /opt/rt3/bin/…/local/lib/RT/Approval/Rule/Passed.pm line 35.
context:

31:
32: $obj->SetStatus( Status => ‘open’, Force => 1 );
33: }
34:
35: my $passed = !$top->HasUnresolvedDependencies( Type => ‘approval’ );
36: my $template = $self->GetTemplate(
37: $passed ? ‘All Approvals Passed’ : ‘Approval Passed’,
38: TicketObj => $top,
39: Approval => $self->TicketObj,

code stack: /opt/rt3/bin/…/local/lib/RT/Approval/Rule/Passed.pm:35
/opt/rt3/bin/…/lib/RT/Ruleset.pm:73
/opt/rt3/bin/…/lib/RT/Transaction_Overlay.pm:189
/opt/rt3/bin/…/lib/RT/Record.pm:1456
/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm:3259
/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm:2961
/opt/rt3/bin/…/lib/RT/Record.pm:898
/opt/rt3/bin/…/lib/RT/Interface/Web.pm:940
/opt/rt3/bin/…/lib/RT/Interface/Web.pm:1052
/opt/rt3/share/html/Ticket/Modify.html:82
/opt/rt3/share/html/autohandler:311
raw error

Richard Foley
Ciao - shorter than aufwiedersehen

Oh, wait a minute, there’s more.

  1. Going into:

Configuration -> Queues -> crs -> Scrips

I made sure each subject line was on single line and replaced a couple of
stray dashes, (I think the \xE2 was
a “−>” thing instead of a “−>” thing in the auto-generated template from
bin/rt-workflow - which was installed via
the CPAN), like this:

Subject: Development Approval for: {$Tickets{TOP}->Id} −
$Tickets{TOP}->Subject}

  1. Which brought me to this error:

Use of uninitialized value $content in concatenation (.) or string
at /opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm line 669.

Which I fudged with this:

    $content = '' unless $content;
  1. Which brought me to here:

[Thu Feb 26 16:50:59 2009] [debug]: Workflow: processing
create-workflow-Implemented Approval of
RT::Ticket=HASH(0x7fe03efb52f0)
(/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:360)
[Thu Feb 26 16:50:59 2009] [debug]: Workflow: evaluating
Subject: Implemented Approval for: {$Tickets{TOP}->Id} -
$Tickets{TOP}->Subject}
Refers-To: TOP
Queue: ___Approvals
Owner:
Requestors: {$Tickets{TOP}->Requestors}
Depended-On-By: TOP
Type: approval
Depends-On: workflow-Tested Approval
Content-Type: text/plain
Due: {time + 86400}
Content: xxx
ENDOFCONTENT (/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:653)
[Thu Feb 26 16:50:59 2009] [debug]: Workflow: yielding
(/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:671)
[Thu Feb 26 16:50:59 2009] [debug]: not a recognised queue object.
(/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm:279)
[Thu Feb 26 16:50:59 2009] [debug]: RT::Ticket=HASH(0x7fe03f1c0278) No queue
given for ticket creation.
(/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm:284)
[Thu Feb 26 16:50:59 2009] [error]: Couldn’t create related ticket
create-workflow-Implemented Approval for 16
Could not create ticket. Queue not set
(/opt/rt3/bin/…/lib/RT/Action/CreateTickets.pm:391)

Which makes me think I must be yet closer to a working approvals system, but
still no potato in sight…sigh!

All (helpful) suggestions welcome, Chia-liang!


Richard Foley
Ciao - shorter than aufwiedersehen

http://www.rfi.net/

Hi,

RTx::WorkflowBuilder is a tool that helps you configure multi-stage
approval workflow in rt.

It is now available at http://search.cpan.org/dist/RTx-WorkflowBuilder/.

Hi Chia-liang,

This looks good, although it doesn’t appear to work smoothly yet.

  1. In your pod you have:

    % bin/rt−workflow PO PO‐Approval −−create

Which should probably read:

% bin/rt−workflow --create PO PO‐Approval
  1. When I had set up the workflow within my RT_SiteConfig.pm, and run the
    bin/rt-workflow script to create the scrips and templates, I naturally
    created a ticket. Nothing happened, but I noticed in the logs there was
    the

following entry:

Found 0 scrips for TransactionBatch stage with applicable type(s)

So, I changed went into:

Configuration -> Queues -> crs -> Scrips

and changed “Stage” from “Transaction Create” to “Transaction Batch”.

  1. The next time I created a ticket, the workflow/approval mechanism
    kicked in

Hi Chia-liang et al,

It transpires the approval ticket is actually created, although I am unable to
see it unless I look up the id directly, even though my user currently has
every right imaginable.

Approval tickets are of type “approval” - They’re supposed to be hidden
from the normal UI and visible only under the “Approvals” tab.

Further, when I reject the (hidden) approval, this
appears to be succesful. However, when I resolve the (still hidden)
approval, I see the following error:

I’m going to defer to CL on this one.

I made sure each subject line was on single line and replaced a couple of
stray dashes, (I think the \xE2 was

a “−>” thing instead of a “−>” thing in the auto-generated template from
bin/rt-workflow - which was installed via

the CPAN), like this:

Did you copy and paste from perldoc?

I hear you, and guilty as charged. Although the templates were auto-generated
out of the ‘perl -MCPAN’ installed RTx::WorkflowBuilder itself, I recall
cut’n’pasting just one small part of the subject line into the
RT_SiteConfig.pm Naturally, bin/rt-workflow took my consequently naff
subject line and used it in the templates…

If so, you’re running into nroff/man being “too smart”.

LC_ALL=C perldoc RTx::WorkflowBuilder will get you things you can copy
and paste safely.

Good to know, thanks. All the same, the golden rule is:

"_never_ cut'n'paste!"

Richard Foley
Ciao - shorter than aufwiedersehen

Hi Chia-liang et al,

It transpires the approval ticket is actually created, although I am
unable to

see it unless I look up the id directly, even though my user currently has
every right imaginable.

Approval tickets are of type “approval” - They’re supposed to be hidden
from the normal UI and visible only under the “Approvals” tab.

I hear you, I suspect it’s a rights issue which I have yet to resolve. The
erroneous characters were I suspect responsible for a lot of hidden mischief,
and have reinstalled from scratch and with a much cleaner environment things
are looking a lot better, thanks. If I actually get this up and running I
might even be tempted to take a stab at a clear walk through descr. on the
wiki. At the moment there are three or four separate pages for the approval
system…

Further, when I reject the (hidden) approval, this
appears to be succesful. However, when I resolve the (still hidden)
approval, I see the following error:

I’m going to defer to CL on this one.

Currently this, (“HasUnresolvedDependencies” -> undefined value), is the only
outstanding issue.

Richard Foley
Ciao - shorter than aufwiedersehen

Hi Richard,

It transpires the approval ticket is actually created, although I am
unable to
see it unless I look up the id directly, even though my user
currently has
every right imaginable. Further, when I reject the (hidden)
approval, this
appears to be succesful. However, when I resolve the (still hidden)
approval, I see the following error:

System error
error: Can’t call method “HasUnresolvedDependencies” on an
undefined value
at /opt/rt3/bin/…/local/lib/RT/Approval/Rule/Passed.pm line 35.
context:

Is this a single-stage or multi-stage approval? and is the test t/
approval/basic.t passing for you?

If you look at the (hidden) approval ticket by putting the ticket id
into Display.html, do you see DependedOnBy containing the actual
ticket or other approvals?

Cheers,
CLK

appears to be succesful. However, when I resolve the (still hidden)
approval, I see the following error:

System error
error: Can’t call method “HasUnresolvedDependencies” on an
undefined value
at /opt/rt3/bin/…/local/lib/RT/Approval/Rule/Passed.pm line 35.
context:

Is this a single-stage or multi-stage approval? and is the test t/
approval/basic.t passing for you?

This case was a multi-stage approval, the single-stage passed just fine. In
fact one-, two-, and four-stage approvals were all fine too, it was just the
three-stage approval which failed consistently in this manner.

If you look at the (hidden) approval ticket by putting the ticket id
into Display.html, do you see DependedOnBy containing the actual
ticket or other approvals?

Well, there are three approval tickets, so it’s not so simple to explain…
What I did notice was that under the failing three-approval the "Refers to:"
line appeared to have a missing checkbox, or an empty line, depending on what
way you look at it. I’ve attached a screenshot to show what I mean, maybe
this helps?

Richard Foley
Ciao - shorter than aufwiedersehen

在 2009/2/27 下午 5:18 時, Richard Foley 寫到:

appears to be succesful. However, when I resolve the (still hidden)
approval, I see the following error:

System error
error: Can’t call method “HasUnresolvedDependencies” on an
undefined value
at /opt/rt3/bin/…/local/lib/RT/Approval/Rule/Passed.pm line 35.
context:

Is this a single-stage or multi-stage approval? and is the test t/
approval/basic.t passing for you?

This case was a multi-stage approval, the single-stage passed just
fine. In
fact one-, two-, and four-stage approvals were all fine too, it was
just the
three-stage approval which failed consistently in this manner.

ok, so at which stage of resolving causes the issue?

can you traverse the “depends on” link to see if it reaches to the one
in question?

If you look at the (hidden) approval ticket by putting the ticket id
into Display.html, do you see DependedOnBy containing the actual
ticket or other approvals?

Well, there are three approval tickets, so it’s not so simple to
explain…
What I did notice was that under the failing three-approval the
"Refers to:"
line appeared to have a missing checkbox, or an empty line,
depending on what
way you look at it. I’ve attached a screenshot to show what I mean,
maybe
this helps?

I think those tickets are under “refers to by:”

Cheers,
CLK

ok, so at which stage of resolving causes the issue?

can you traverse the “depends on” link to see if it reaches to the one
in question?

Yes, this seems to be fine.

way you look at it. I’ve attached a screenshot to show what I mean,

I think those tickets are under “refers to by:”

I think you’re right, although it might be more intuitive to display them
non-vertically-centered…

Richard Foley
Ciao - shorter than aufwiedersehen

在 2009/2/27 下午 6:25 時, Richinud 寫到:> On Friday 27 February 2009 10:45:46 Chia-liang Kao wrote:

issue?

Maybe I’ll just stick to two-stage approvals - as they appear to
work just
fine :wink:

The tests in RTx::WorkflowBuilder actually contains a 3-stage
approval. can you try to modify the test’s config to reproduce the
problem?

Cheers,
CLK

Hi,

RTx::WorkflowBuilder is a tool that helps you configure multi-stage
approval workflow in rt.

It is now available at http://search.cpan.org/dist/RTx-WorkflowBuilder/.

Hi Chia-liang,

This is straightforward for simple and for cascading approvals. Good work!

Richard Foley
Ciao - shorter than aufwiedersehen