use of org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ActivityLifeCycleEventsListType in project carbon-business-process by wso2.
the class InstanceManagementServiceSkeleton method getActivityLifeCycleEventsFromScope.
private ActivityLifeCycleEventsListType getActivityLifeCycleEventsFromScope(ScopeDAO scope) throws InstanceManagementException {
final ActivityLifeCycleEventsListType activityLifeCycleEventsList = new ActivityLifeCycleEventsListType();
/*dbexec(new BpelDatabase.Callable<Object>() {
public Object run(BpelDAOConnection conn) throws InstanceManagementException {
ScopeDAO scope = conn.getScope(siid);
if (scope == null) {
String errMsg = "Scope " + siid + " not found.";
log.error(errMsg);
throw new InstanceManagementException(errMsg);
}
fillActivityLifeCycleEventsFromScope(activityLifeCycleEventsList, scope);
return null;
}
});*/
fillActivityLifeCycleEventsFromScope(activityLifeCycleEventsList, scope);
return activityLifeCycleEventsList;
}
use of org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ActivityLifeCycleEventsListType 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.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ActivityLifeCycleEventsListType in project carbon-business-process by wso2.
the class InstanceManagementServiceSkeleton method fillActivityLifeCycleEventsList.
private void fillActivityLifeCycleEventsList(ActivityLifeCycleEventsListType activityLifeCycleEventsList, EventInfoListDocument infoList) {
List<TEventInfo> list;
if (infoList.getEventInfoList() == null) {
list = infoList.addNewEventInfoList().getEventInfoList();
} else {
list = infoList.getEventInfoList().getEventInfoList();
}
List<EventInfo> eventInfoList = new ArrayList<EventInfo>();
Map<Long, Boolean> isFaultMap = new HashMap<Long, Boolean>();
for (TEventInfo tInfo : list) {
EventInfo info = new EventInfo();
info.setType(tInfo.getType());
info.setName(tInfo.getName());
info.setLineNumber(tInfo.getLineNumber());
info.setTimestamp(tInfo.getTimestamp());
info.setActivityId(tInfo.getActivityId());
info.setActivityName(tInfo.getActivityName());
if (tInfo.getName().equals("ActivityFailureEvent")) {
if (isFaultMap.get(tInfo.getActivityId()) == null) {
isFaultMap.put(tInfo.getActivityId(), true);
}
} else if (tInfo.getName().equals("ActivityExecEndEvent")) {
if (isFaultMap.get(tInfo.getActivityId()) != null) {
isFaultMap.remove(tInfo.getActivityId());
}
isFaultMap.put(tInfo.getActivityId(), false);
}
info.setActivityType(tInfo.getActivityType());
info.setScopeId(tInfo.getScopeId());
info.setScopeName(tInfo.getScopeName());
eventInfoList.add(info);
}
for (EventInfo info : eventInfoList) {
boolean isFault = isFaultMap.get(info.getActivityId()) == null ? false : isFaultMap.get(info.getActivityId());
info.setIsRecoveryRequired(isFault);
activityLifeCycleEventsList.addEventInfo(info);
}
}
Aggregations