on 04-21-2006 12:00 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
What is the GP version are you using ?
Best regards,
Aliaskei.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.