Search in sources :

Example 1 with ScopeDAO

use of org.apache.ode.bpel.dao.ScopeDAO in project carbon-business-process by wso2.

the class InstanceManagementServiceSkeleton method fillScopeInfo.

private void fillScopeInfo(ScopeInfoType scopeInfo, ScopeDAO scope) {
    scopeInfo.setSiid(scope.getScopeInstanceId().toString());
    scopeInfo.setName(scope.getName());
    scopeInfo.setStatus(odeScopeStatusToManagementAPIStatus(scope.getState()));
    Children_type0 childScopes = new Children_type0();
    if (scope.isChildrenExist()) {
    }
    for (ScopeDAO childScope : scope.getChildScopes()) {
        ScopeInfoType childScopeInfo = new ScopeInfoType();
        fillScopeInfo(childScopeInfo, childScope);
        childScopes.addChildRef(childScopeInfo);
    }
    scopeInfo.setChildren(childScopes);
    scopeInfo.setVariables(getVariables(scope));
    if (!scope.getCorrelationDTOs().isEmpty()) {
        scopeInfo.setCorrelationSets(getCorrelationPropertires(scope));
    }
    scopeInfo.setActivities(getActivities(scope));
}
Also used : Children_type0(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Children_type0) ScopeInfoType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ScopeInfoType) ScopeDAO(org.apache.ode.bpel.dao.ScopeDAO)

Example 2 with ScopeDAO

use of org.apache.ode.bpel.dao.ScopeDAO 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);
    }
}
Also used : EventInfoListDocument(org.apache.ode.bpel.pmapi.EventInfoListDocument) ScopeDAO(org.apache.ode.bpel.dao.ScopeDAO) ActivityLifeCycleEventsDocumentBuilder(org.wso2.carbon.bpel.core.ode.integration.utils.ActivityLifeCycleEventsDocumentBuilder) ArrayList(java.util.ArrayList) ScopeDAOImpl(org.apache.ode.dao.jpa.ScopeDAOImpl) BpelEvent(org.apache.ode.bpel.evt.BpelEvent) EventDAOImpl(org.apache.ode.dao.jpa.EventDAOImpl)

Example 3 with ScopeDAO

use of org.apache.ode.bpel.dao.ScopeDAO in project carbon-business-process by wso2.

the class InstanceManagementServiceSkeleton method fillScopeInfoWithEvents.

private void fillScopeInfoWithEvents(ScopeInfoWithEventsType scopeInfoWithEvents, ScopeDAO scope) {
    scopeInfoWithEvents.setSiid(scope.getScopeInstanceId().toString());
    scopeInfoWithEvents.setName(scope.getName());
    scopeInfoWithEvents.setStatus(odeScopeStatusToManagementAPIStatus(scope.getState()));
    ChildrenWithEvents_type0 childScopesWithEvents = new ChildrenWithEvents_type0();
    for (ScopeDAO childScope : scope.getChildScopes()) {
        ScopeInfoWithEventsType childScopeInfoWithEvents = new ScopeInfoWithEventsType();
        fillScopeInfoWithEvents(childScopeInfoWithEvents, childScope);
        childScopesWithEvents.addChildWithEventsRef(childScopeInfoWithEvents);
    }
    scopeInfoWithEvents.setChildrenWithEvents(childScopesWithEvents);
    // scopeInfoWithEvents.setVariablesWithEvents(getVariablesWithEvents(scope));         //TODO:
    // TODO: Just need to change the schema s.t. avoid CorrelationSets_type1 and remove the comment
    // if (!scope.getCorrelationSets().isEmpty()) {
    // //            scopeInfoWithEvents.setCorrelationSets(getCorrelationPropertires(scope));
    // }
    scopeInfoWithEvents.setActivitiesWithEvents(getActivitiesWithEvents(scope));
}
Also used : ScopeInfoWithEventsType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ScopeInfoWithEventsType) ChildrenWithEvents_type0(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ChildrenWithEvents_type0) ScopeDAO(org.apache.ode.bpel.dao.ScopeDAO)

Aggregations

ScopeDAO (org.apache.ode.bpel.dao.ScopeDAO)3 ArrayList (java.util.ArrayList)1 BpelEvent (org.apache.ode.bpel.evt.BpelEvent)1 EventInfoListDocument (org.apache.ode.bpel.pmapi.EventInfoListDocument)1 EventDAOImpl (org.apache.ode.dao.jpa.EventDAOImpl)1 ScopeDAOImpl (org.apache.ode.dao.jpa.ScopeDAOImpl)1 ActivityLifeCycleEventsDocumentBuilder (org.wso2.carbon.bpel.core.ode.integration.utils.ActivityLifeCycleEventsDocumentBuilder)1 ChildrenWithEvents_type0 (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ChildrenWithEvents_type0)1 Children_type0 (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Children_type0)1 ScopeInfoType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ScopeInfoType)1 ScopeInfoWithEventsType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ScopeInfoWithEventsType)1