cancel
Showing results for 
Search instead for 
Did you mean: 

Aborting the Process

Former Member
0 Kudos

Hi,

I have a process with 4 blocks and the last block contains 2 actions. In the first action we have two buttons...one to continue and the other to cancel. On clicking the continue button we are proceeding to show the 2nd action. On click of cancel, we want to abort the process. Is it possible to abort the process in some way?

Can it be done by defining a Result state for Fail and setting the state to that? If so how?

Or can it be done by throwing some exception?

Regards

Praveen

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Praveen,

I'm not sure, but it seems is not, at least I investigated it at one time.

In this case use SP5 api- you will need to migrate it for SP7:

<code>

IInformationFactory infoFactory = <lookup the "/sap.com/com.sap.nw.eu.gp/InformationFactory"> ;

IInstanceInformation instance = infoFactory.getInstanceInformation(processId, getCurrentUserUniqueID()) ;

IRuntimeManager manager = <lookup the "/sap.com/com.sap.nw.eu.gp/RuntimeManager"> ;

manager.stopProcess(instance, getCurrentUserUniqueID()) ;

</code>

Use the following references:

1. <dc-ref>

<name>caf/eu/gp/model/api</name>

<vendor>sap.com</vendor>

</dc-ref>

<pp-ref>com.sap.caf.eu.gp.model.process</pp-ref>

<at-build-time/>

2.

<dependency>

<dc-ref>

<name>caf/eu/gp/base</name>

<vendor>sap.com</vendor>

</dc-ref>

<pp-ref>com.sap.caf.eu.gp.base.exception</pp-ref>

<at-build-time/>

</dependency>

Do not forget about runtime references to these libraries.

Best regards,

Aliaksei

0 Kudos

Dear Aliaksei,

thanks for that post. I upgraded to nw04s from sps9 patch 0 to the newest patch.

I tried using the new RuntimeManager but coulnd`t get it ti work. I always get the error ""Invalid connection property system.workflowengine.bwf.endpoint_name" while calling:

IGPProcessInstanceInfo[] array = rtm.getRunningInstances(0, java.sql.Date.valueOf("2006-12-12"), new java.sql.Date(System.currentTimeMillis()), user4Process);

for (int i = 0; i < array.length; i++)
{
IGPProcessInstanceInfo instanceInfo = array<i>;
IGPActionInstance instance = rtm.getActionInstance("75B58B01A10211DBAF9D00174205853C", instanceInfo.getProcessInstanceID(), user4Process);
...

another method which worked before stopped working as well:

IGPProcessInstance processInst = rtm.startProcess(process, gpTitle, "GP Process", user, roles, params, user);

I know I need to call the new Runtimemanager you proposed but I don`t know how to call it with the new params. I couldn`t find a matching Javadoc as well where I could look up some information...

Cheers Jens

Former Member
0 Kudos

Hi Jens,

The error message is pretty clear. Check you connection configuration. I would recommend you not to run on the BWF but on the local workflow but changing back the property in the GP Service to its initial value.

To get a answer faster, you should also create a new topic. The question/problem that you have is somehow different than the initial subject.

Hope this helps.

Best regards,

David

Former Member
0 Kudos

Hi Praveen,

The thing that I would propose you is to Cancel process by using api. It works. But do you know that SP5/SP6 api is completely different from SP7 ?

it's under SP7.

<code>

IGPRuntimeManager runtimeManager = GPProcessFactory.getRuntimeManager() ;

IGPProcessInstance instance = runtimeManager.getProcessInstance(processId, getCurrentUser()) ;

runtimeManager.stopProcess(instance, getCurrentUser()) ;

</code>

Best regards,

Aliaksei

Former Member
0 Kudos

Hi Aliaksei,

Thanks for that valuable information.

I am using the SP5 environment for development. Is it possible to abort the process in SP5 by some other means (since the api is not available)?

Regards

Praveen

Former Member
0 Kudos

Hi Praveen,

What is the GP version are you using ?

Best regards,

Aliaskei.

Former Member
0 Kudos

Hi Aliaskei,

We are using CAF 7 Service Pack 5. We have instances of SP6 and SP7 as well.

Regards

Praveen