AW: Cancelling the previous workitem

Workflow nathanfox at swissinfo.org
Mon Jun 6 07:37:13 EDT 2005


and to add to Jocelyn's last thougths...
I prefer creating a virtual attribute to coding a method when it fits in the
OO scheme  of things.  Virtual attributes are much easier to test (SWO1),
the result is available directly in texts and workflow forks and conditions
(and of course start conditions) without passing through container
variables, and the coding is centralized around the business object and not
in umpteen other workbench objects.  Its just good OO design.
Regards
Nate
-----Ursprüngliche Nachricht-----
Von: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu]Im Auftrag von
Dart, Jocelyn
Gesendet: Montag, 6. Juni 2005 10:00
An: SAP Workflow Users' Group
Betreff: RE: Cancelling the previous workitem


  Hi Kjetil,
  I would always extend a standard object by delegation in such a case,
rather can create a check function module. Like I said it's easier to test
whether your object will meet the condition or not this way.  If you had to
set up an attribute per workflow that might be a pain - but I would have
thought in most cases you are just looking for any active workflows for that
object.

  The benefits of using a start condition I stated previously - it's not
simply that they are all in the one place, it's because any other
*NON-WORKFLOW* business analyst can read, understand, and even maintain the
start condition quickly and easily without bugging yours truly all over
again.  Plus you can turn them on and off at the flick of a button.

  We've been using start conditions in EBP for a while now and they just
save heaps of time, a lot of code rewrites on changing business
requirements, and many many otherwise very tedious explanations.  They
handle currency-specific amounts without drama and they even have their own
test mechanism in situ for the pedantic.
  Regards,
  Jocelyn Dart
  Senior Consultant
  SAP Australia Pty Ltd.
  Level 1/168 Walker St.
  North Sydney
  NSW, 2060
  Australia
  T   +61 412 390 267
  M   + 61 412 390 267
  E   jocelyn.dart at sap.com
  http://www.sap.com


****************************************************************************
*************
  The information contained in or attached to this electronic transmission
is confidential and may be legally privileged. It is intended only for the
person or entity to which it is addressed. If you are not the intended
recipient, you are hereby notified that any distribution, copying, review,
retransmission, dissemination or other use of this electronic transmission
or the information contained in it is strictly prohibited. If you have
received this electronic transmission in error, please immediately contact
the sender to arrange for the return of the original documents.

  Electronic transmission cannot be guaranteed to be secure and accordingly,
the sender does not accept liability for any such data corruption,
interception, unauthorized amendment, viruses, delays or the consequences
thereof.

  Any views expressed in this electronic transmission are those of the
individual sender, except where the message states otherwise and the sender
is authorized to state them to be the views of SAP AG or any of its
subsidiaries. SAP AG, its subsidiaries, and their directors, officers and
employees make no representation nor accept any liability for the accuracy
or completeness of the views or information contained herein. Please be
aware that the furnishing of any pricing information/ business proposal
herein is indicative only, is subject to change and shall not be construed
as an offer or as constituting a binding agreement on the part of SAP AG or
any of its subsidiaries to enter into any relationship, unless otherwise
expressly stated.


****************************************************************************
*************





----------------------------------------------------------------------------
--
  From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Kjetil Kilhavn
  Sent: Monday, 06 June 2005 3:24 PM
  To: SAP Workflow Users' Group
  Subject: RE: Cancelling the previous workitem


  Ahh, yes of course. I have added such a virtual attribute myself but
didn't use it in a start condition. It is very easy using the WAPI
functions). But since that is the answer I assume it isn't possible with a
standard object.

  There is of course a value in seeing all the start conditions in one
place, but otherwise I don't see any particular advantage compared to a
check function - in particular if you haven't already delegated your object
type, and you would have to create one attribute per workflow or task you
need to distinguish between.
  --
  Kjetil Kilhavn, Statoil KTJ IT BKS




----------------------------------------------------------------------------
--
  From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Dart, Jocelyn
  Sent: 6. juni 2005 02:33
  To: SAP Workflow Users' Group
  Subject: RE: Cancelling the previous workitem


  Hi Kjetil,
  Sure you can - all you need to do is create a virtual attribute that
returns the number of currently active workflow instances for your object -
an easy find with the WAPIs - and then your condition is "number of active
instances" must be 0 - i.e. don't start if anything else is already out
there.

  Ok so you need to add a virtual attribute, but that's not difficult, and
it makes it easier for testing as you can see the current value in swo1 test
or in the container in the workflow logs.

  Regards,
  Jocelyn Dart
  Senior Consultant
  SAP Australia Pty Ltd.
  Level 1/168 Walker St.
  North Sydney
  NSW, 2060
  Australia
  T   +61 412 390 267
  M   + 61 412 390 267
  E   jocelyn.dart at sap.com
  http://www.sap.com


****************************************************************************
*************
  The information contained in or attached to this electronic transmission
is confidential and may be legally privileged. It is intended only for the
person or entity to which it is addressed. If you are not the intended
recipient, you are hereby notified that any distribution, copying, review,
retransmission, dissemination or other use of this electronic transmission
or the information contained in it is strictly prohibited. If you have
received this electronic transmission in error, please immediately contact
the sender to arrange for the return of the original documents.

  Electronic transmission cannot be guaranteed to be secure and accordingly,
the sender does not accept liability for any such data corruption,
interception, unauthorized amendment, viruses, delays or the consequences
thereof.

  Any views expressed in this electronic transmission are those of the
individual sender, except where the message states otherwise and the sender
is authorized to state them to be the views of SAP AG or any of its
subsidiaries. SAP AG, its subsidiaries, and their directors, officers and
employees make no representation nor accept any liability for the accuracy
or completeness of the views or information contained herein. Please be
aware that the furnishing of any pricing information/ business proposal
herein is indicative only, is subject to change and shall not be construed
as an offer or as constituting a binding agreement on the part of SAP AG or
any of its subsidiaries to enter into any relationship, unless otherwise
expressly stated.


****************************************************************************
*************





----------------------------------------------------------------------------
--
  From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Kjetil Kilhavn
  Sent: Friday, 03 June 2005 3:29 PM
  To: SAP Workflow Users' Group
  Subject: RE: Cancelling the previous workitem


  Can you really set up a start condition which checks for already existing
instances of the same workflow for the current object? Admittedly I haven't
looked much into start conditions, but from what I have seen they are meant
for much simpler checks.
  --
  Kjetil Kilhavn, Statoil KTJ IT BKS




----------------------------------------------------------------------------
--
  From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Dart, Jocelyn
  Sent: 3. juni 2005 01:46
  To: SAP Workflow Users' Group
  Subject: RE: Cancelling the previous workitem


  Folks,
  Really - if you are 4.6C or above it's better (clarity for developers and
business analysts) and considerably quicker (initial development and
on-going maintenance, switch on/switch off, etc.) to use a start condition
(transaction SWB_COND) which utilises a standard check function module than
build your own custom check function module.  Custom check function module
these days I treat as a last resort, card up my sleeve if all else fails
type of approach.
  Jocleyn



----------------------------------------------------------------------------
    From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Maes Steven
    Sent: Thursday,2 June 2005 9:22 PM
    To: SAP Workflow Users' Group
    Subject: RE: Cancelling the previous workitem


    Hi Amit,



    You can do this in the event linkage. This is where you link the event
to a workflow. Here you can enter a check function to decide if you would
like to start the WF or not.

    Transaction SWETYPV.



    Good luck,



    Steven Maes




----------------------------------------------------------------------------

    Van: Amit Moghe [mailto:amitpmoghe at rediffmail.com]
    Verzonden: donderdag 2 juni 2005 13:07
    Aan: sap-wug at mit.edu
    Onderwerp: Cancelling the previous workitem



    Hi Kjetil,

    Do you want me to call this function module before the triggering  event
is published?

    If yes, then, I am afraid whether I can do that since the event is
published by the standard program. Also for a moment even if I have control
over publishing the event, how can I restart the same workitem?

    If no, then, will you please a bit more elaborate?

    I would definitely like to trigger as few workflows as possible since
that would reduce my work :))

    Thanks & Regards,
    Amit


    -------------------
    It's a bit late I guess, but I would recommend using a check function
instead. Then you prevent starting the second instance by looking for
existing workflows related to your purchase order (function
SAP_WAPI_WORKITEMS_TO_OBJECT).

    The fewer workflows started, the better - unless your salary depends on
the number of started workflows.
    --
    Kjetil Kilhavn, Statoil KTJ IT BKS



    ________________________________

    From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On
Behalf Of Amit Moghe
    Sent: 2. juni 2005 10:32
    To: sap-wug at mit.edu
    Subject: AW: Cancelling the previous workitem



    Hi Michael,

      Thanks a lot for the help. It works perfectly...

    Regards,
    Amit

    --------
      Hi Amit,

      You can built a parallel processing in Your workflow, which ends,
      if one of the both branches is completed. One branch includes Your
      current workflow and the other consits of a Wait Step , which waits
      for the event 'CHANGED' of BUS2012.


      Best regards
      Michael Ludwig
      rku.it GmbH

        -----Ursprüngliche Nachricht-----
        Von: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu]
Im Auftrag von Amit Moghe
        Gesendet: Donnerstag, 2. Juni 2005 08:34
        An: sap-wug at mit.edu
        Cc: amitpmoghe at rediffmail.com
        Betreff: Cancelling the previous workitem



        Hi Workflow Gurus,

        I am new to workflow and need some help.

        I have a workflow for which I am using 'CHANGED' event of the
business object BUS2012 (Purchase Order) as the triggering event. When a
user changes a particular PO, this workflow starts. But before it is
completed if there is another change to the same PO, then, one more workitem
is started.

        My requirement is that if there is change to the PO, then, it should
delete the previous workitem and start a new workitem. Can you please advise
me as to how this can be achieved?

        Thanks in advance.

        Regards,
        Amit








  -------------------------------------------------------------------
  The information contained in this message may be CONFIDENTIAL and is
  intended for the addressee only. Any unauthorised use, dissemination of
the
  information or copying of this message is prohibited. If you are not the
  addressee, please notify the sender immediately by return e-mail and
delete
  this message.
  Thank you.


  -------------------------------------------------------------------
  The information contained in this message may be CONFIDENTIAL and is
  intended for the addressee only. Any unauthorised use, dissemination of
the
  information or copying of this message is prohibited. If you are not the
  addressee, please notify the sender immediately by return e-mail and
delete
  this message.
  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20050606/1661c515/attachment.htm


More information about the SAP-WUG mailing list