Withdrawing / cancelling a request in midst of long-lived process

28 views
Skip to first unread message

Sam Juvonen

unread,
Jun 30, 2009, 11:38:08 PM6/30/09
to Adobe LiveCycle Developers
I am wondering if anyone knows of a simple way to provide for
withdrawing / cancelling a process instance by the requester that
started it. We have a help desk application that allows the requester
to withdraw their request at any time no matter in whose queue it
presently resides.

One way I can think of that is not so simple is:

Use a gateway in the process as OR-WAIT that has event listener that
will complete process upon receipt, and then a separate short-lived
process would be called to throw the proper "cancel" async event using
filter=task id, causing the long-lived process to catch this event and
if matching the filter (task id), finish due to this branch of the
gateway completing (would mean the process of interest is entirely on
a gateway branch).

Appreciate any thoughts from y'all in LC-land....

- Sam

KHinch

unread,
Jul 1, 2009, 2:25:19 PM7/1/09
to Adobe LiveCycle Developers
I have been thinking of implementing a similar long-lived process
rollback. One idea I had was implementing transactional branches to
roll back a workflow to a start position in case one branch "fails".
Unfortunately transactional branches are limited to "execute" and "set
value" processes out of the box. Livedocs state that it is possible to
develop transaction-aware processes using the SDK.
http://livedocs.adobe.com/livecycle/es/wb_help/00000524.html#1506548

If you are working within workspace/task management, one possibility
might be to use a process to re-assign/cancel a task if a "cancel"
event is thrown.

Your multiple-event idea is interesting. TourDeLiveCycle has some
cool on extended use of Event throwing & receiving:
http://tourdelc.adobe.com/content/Samples/CommonProcessPatterns/Events/EventsSendRcv.html

Good luck!
-Kasey

Amal Elaine

unread,
Jul 8, 2009, 2:01:20 AM7/8/09
to live...@googlegroups.com
Hey Sam, is your company and mine the only users of LC in Michigan for now?  Any interest in getting a lunch and learn exchange going?

Curious,
Amal Elaine
--
Amal Elaine Photography
http://www.pbase.com/amal007

Duane Nickull

unread,
Jul 8, 2009, 1:40:24 PM7/8/09
to Adobe LiveCycle Developers
IN Java it is easy using the LC ES SDK

import java.util.*;

import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;

import com.adobe.idp.workflow.client.ProcessManager;

 

public class TerminatingProcesses {

    

    public static void main(String[] args) {

        try{

        

            //    Set connection properties    

            Properties ConnectionProps = new Properties();

            ConnectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://<domain_Name>:<PORT>");

            ConnectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");   // if over firewall use SOAP

            ConnectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");

            ConnectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "<username>");

            ConnectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "<password>");

            

            //Create a ServiceClientFactory object

            ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);

 

            //Create a ProcessManager object

            ProcessManager myProcessManager = new ProcessManager(myFactory);

            

            //Terminate a process instance.  There are also programmatic API’s to search for an instance to get the value below.

               myProcessManager.terminateProcess("756c22860a242fb101ec7a5bc0977fd6");     

            }

            

        catch(Exception e)

        {

            e.printStackTrace();
         // do something here to deal with it.

--
Sr. Technical Evangelist / Adobe / LiveCycle ES
Chair – OASIS SOA RM Technical Committee
Blog: http://technoracle.blogspot.com
Twitter: duanechaos
Duane’s World TV: http://www.duanesworldtv.org
Band: http://www.myspace.com/22ndcentury
Co-author – Web 2.0 Architectures, O’Reilly Media, ISBN 13: 9780596514433
Reply all
Reply to author
Forward
0 new messages