Ad hoc Start Events Usage in IBM BPMv8.0:-
Hello friends
I would like to share scenario on usage
of ad hoc start events in IBM BPMv8.0.
Scenario
:-( Order Processing)
Order
processing process application allows the customers to book their orders from
web. In order to complete this it follows the below steps.
- A user login into portal with their credentials and enters order, credit card and shipping info.
- For processing this order it takes maximum 7 days .Within this 7 days a customer can cancel his order at any time .
- To cancel Order customer has to call the Call center agent .A call-center agent needs to cancel specific order.
If you
observer above scenario, have to perform action
(cancelling Order )on existing
instance (Order creation).
You often have a need for users to
be able to perform actions on a process.for example
Cancelling an instance when a client
decided not to proceed with the current order
While a
process is running, a user might need to launch a new activity or set of
activities.
The above
situations we can handle/achieve with “ad Hoch
start event “in Process Designer
Order
Processing BPD:-
1). “GetOrderInfo “user task allow s user/
customer to enter order ,credit card
,shipping info ..etc .”Processing Order “ sub process will process submit Order.(which may take max
7 days).
2)In Cancel
Order lane I had used script activity
and added simple log statements(As it is for demonstration purpose).but
in real time case you may add your own
logic for Order Cancellation like Using
system task to delete process instance or deleting order from database using
IS(integration services)..etc.
3) Coming to
Ad hoc start event activity
configuration name as “InvokeOrderCancel”(Which
is used to start Ad hoc event using web API),In Implementation have option event visibility which allows us to restrict access
from Process Portal to particular participant group/Users.
Now how we can access/start this ad Hoch stat event ? This can be
done in two ways:
1. Using process Portal
2. using web API
Using
process Portal to start Ad hoc start event:-
- I hope this post helps you. So far this is my best effort to explain. Please correct me if I do anything wrong.
- Login into Process Portal with valid credentials (Who have rights to cancel order in our case call-center agent.
- Select the waiting task in instance and expand it and there is option with name “Invoke ordercancel”(Which is the name of Ad hoc start event name) as shown below. Click on it.
Note: -Ad hoc task instances that were created during the running of a
process instance must be complete before the process instance completes.
A user
/customer can request for Order cancellation to call-center agent before Order
was shipped.
Using
WebAPI to start Ad hoc start event:-
- Select the waiting task in instance and expand it and there is option with name “Invoke ordercancel”(Which is the name of Ad hoc start event name) as shown below. Click on it.
- Use the below script to start ad Hoch start event in a BPD.
var
ProcInstanceID="2563";
log.info("Current Process Instance ID"+ProcInstanceID);
var
AdhocEventName="InvokeOrderCancel";
var
processID = tw.system.findProcessInstanceByID(ProcInstanceID);
processID.findAdhocStartingPointByName(AdhocEventName).startNew();
General System Service
to Start Ad hoc Start Event:-
Sysout.log file:-
Common Problem while Setting Event visibility to Ad
hoc start event to Particular Participant group/Users :-
If you want
to restrict some process portal options (for example Start Ad hoc events) to
particular users/groups. we need to set event visibility options properly and
verify 100Custom.xml
,if the permission for
ACTION_INJECT_TOKEN is given to particular users/groups.
For more
information go through below link
I
hope this post helps you. So far this is my best effort to explain. Please
correct me if I do anything wrong/any best way other than this.
Please
share your valuable suggestions and feedback to my mail id"mdondetisbit@gmail.com" to
improve myself.
No comments:
Post a Comment