use of org.apache.ode.bpel.pmapi.EventInfoListDocument in project carbon-business-process by wso2.
the class InstanceManagementServiceSkeleton method fillActivityLifeCycleEventsFromScope.
private void fillActivityLifeCycleEventsFromScope(ActivityLifeCycleEventsListType activityLifeCycleEventsList, ScopeDAO scope) {
// List<BpelEvent> events = scope.listEvents();
Set<EventDAOImpl> eventsEntities = ((ScopeDAOImpl) scope).getEvents();
List<BpelEvent> events = new ArrayList<BpelEvent>();
for (EventDAOImpl event : eventsEntities) {
events.add(event.getEvent());
}
ActivityLifeCycleEventsDocumentBuilder docBuilder = new ActivityLifeCycleEventsDocumentBuilder();
for (BpelEvent e : events) {
docBuilder.onEvent(e);
}
EventInfoListDocument infoList = docBuilder.getActivityLifeCycleEvents();
fillActivityLifeCycleEventsList(activityLifeCycleEventsList, infoList);
for (ScopeDAO childScope : scope.getChildScopes()) {
fillActivityLifeCycleEventsFromScope(activityLifeCycleEventsList, childScope);
}
}
use of org.apache.ode.bpel.pmapi.EventInfoListDocument in project carbon-business-process by wso2.
the class ActivityStateAndEventDocumentBuilder method lookup.
// private void completed(ActivityInfoWithEventsDocument ainf) {
// if (removeCompleted) {
// activitiesWithEventsOrdered.remove(ainf);
// activitiesWithEvents.values().remove(ainf);
// }
// }
/**
* return the ActivityInfoWithEventsDocument object for a particular event
* Then take it and fill it with particular event info
* Note - this must be used after fillActivityInfo method, else aInfo will return a null ref.
*
* @param event Activity Event
* @return updated element due to event input
*/
private ActivityInfoWithEventsDocument lookup(ActivityEvent event) {
ActivityInfoWithEventsDocument actEvtInfoDoc = activitiesWithEvents.get(event.getActivityId());
ActivityInfoDocument aInfo = actEvtInfoDoc.getActivityInfoDoc();
EventInfoListDocument aEventList = actEvtInfoDoc.getEventInfoList();
if (aEventList == null) {
aEventList = EventInfoListDocument.Factory.newInstance();
actEvtInfoDoc.setEventInfoList(aEventList);
aEventList = actEvtInfoDoc.getEventInfoList();
}
TEventInfo eventInfo;
if (aEventList.getEventInfoList() == null) {
TEventInfoList eventInfoList = aEventList.addNewEventInfoList();
eventInfo = eventInfoList.addNewEventInfo();
} else {
eventInfo = aEventList.getEventInfoList().addNewEventInfo();
}
fillEventInfo(eventInfo, event);
addActivitiesWithEventOrdered(event, new ActivityInfoWithEventsDocument(aInfo, aEventList));
return activitiesWithEvents.get(event.getActivityId());
}
use of org.apache.ode.bpel.pmapi.EventInfoListDocument in project carbon-business-process by wso2.
the class ActivityStateAndEventDocumentBuilder method addActivitiesWithEventOrdered.
/**
* Update activitiesWithEventsOrdered using infoWithEventsDoc
*
* @param event Activity Event
* @param infoWithEventsDoc ActivityInfoWithEventsDocument
*/
private void addActivitiesWithEventOrdered(ActivityEvent event, ActivityInfoWithEventsDocument infoWithEventsDoc) {
boolean isExist = false;
for (ActivityInfoWithEventsDocument anActivitiesWithEventsOrdered : activitiesWithEventsOrdered) {
if (anActivitiesWithEventsOrdered.getActivityInfoDoc().getActivityInfo().getAiid().equals(infoWithEventsDoc.getActivityInfoDoc().getActivityInfo().getAiid())) {
isExist = true;
EventInfoListDocument aEventList = anActivitiesWithEventsOrdered.getEventInfoList();
if (aEventList == null) {
aEventList = EventInfoListDocument.Factory.newInstance();
anActivitiesWithEventsOrdered.setEventInfoList(aEventList);
aEventList = anActivitiesWithEventsOrdered.getEventInfoList();
}
TEventInfo eventInfo;
if (aEventList.getEventInfoList() == null) {
TEventInfoList eventInfoList = aEventList.addNewEventInfoList();
eventInfo = eventInfoList.addNewEventInfo();
} else {
eventInfo = aEventList.getEventInfoList().addNewEventInfo();
}
fillEventInfo(eventInfo, event);
break;
}
}
if (!isExist) {
activitiesWithEventsOrdered.add(infoWithEventsDoc);
}
}
Aggregations