Search in sources :

Example 31 with Scope

use of org.wso2.ballerinalang.compiler.semantics.model.Scope 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;
}
Also used : ActivityLifeCycleEventsListType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ActivityLifeCycleEventsListType)

Example 32 with Scope

use of org.wso2.ballerinalang.compiler.semantics.model.Scope in project carbon-business-process by wso2.

the class InstanceManagementServiceSkeleton method getCorrelationPropertires.

private CorrelationSets_type0 getCorrelationPropertires(ScopeDAO scope) {
    CorrelationSets_type0 correlationSets = new CorrelationSets_type0();
    for (CorrelationSetDAO correlationSetDAO : scope.getCorrelationDTOs()) {
        CorrelationSet_type0 correlationset = new CorrelationSet_type0();
        correlationset.setCsetid(correlationSetDAO.getCorrelationSetId().toString());
        correlationset.setName(correlationSetDAO.getName());
        for (Map.Entry<QName, String> property : correlationSetDAO.getProperties().entrySet()) {
            CorrelationPropertyType prop = new CorrelationPropertyType();
            prop.setCsetid(correlationSetDAO.getCorrelationSetId().toString());
            prop.setPropertyName(property.getKey());
            prop.setString(property.getValue());
            correlationset.addCorrelationProperty(prop);
        }
        correlationSets.addCorrelationSet(correlationset);
    }
    return correlationSets;
}
Also used : CorrelationSet_type0(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CorrelationSet_type0) QName(javax.xml.namespace.QName) CorrelationPropertyType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CorrelationPropertyType) CorrelationSets_type0(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CorrelationSets_type0) CorrelationSetDAO(org.apache.ode.bpel.dao.CorrelationSetDAO) Map(java.util.Map) HashMap(java.util.HashMap)

Example 33 with Scope

use of org.wso2.ballerinalang.compiler.semantics.model.Scope 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 34 with Scope

use of org.wso2.ballerinalang.compiler.semantics.model.Scope in project carbon-business-process by wso2.

the class RestResponseFactory method createBinaryRestVariable.

public RestVariable createBinaryRestVariable(String name, RestVariable.RestVariableScope scope, String type, String taskId, String executionId, String processInstanceId, String baseUri) {
    RestUrlBuilder urlBuilder = createUrlBuilder(baseUri);
    RestVariable restVar = new RestVariable();
    restVar.setVariableScope(scope);
    restVar.setName(name);
    restVar.setType(type);
    if (taskId != null) {
        restVar.setValueUrl(urlBuilder.buildUrl(RestUrls.URL_TASK_VARIABLE_DATA, taskId, name));
    }
    if (executionId != null) {
        restVar.setValueUrl(urlBuilder.buildUrl(RestUrls.URL_EXECUTION_VARIABLE_DATA, executionId, name));
    }
    if (processInstanceId != null) {
        restVar.setValueUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_INSTANCE_VARIABLE_DATA, processInstanceId, name));
    }
    return restVar;
}
Also used : RestVariable(org.wso2.carbon.bpmn.rest.engine.variable.RestVariable)

Example 35 with Scope

use of org.wso2.ballerinalang.compiler.semantics.model.Scope in project carbon-business-process by wso2.

the class ScopeImpl method getStartIconExitArrowCoords.

/**
 * At the start: xLeft=0, yTop=0
 * Calculates the coordinates of the arrow which leaves the start Scope Icon
 *
 * @return coordinates of the exit arrow for the start icon
 * After Calculations(Vertical Layout): xLeft= Xleft of Icon + (width of icon)/2 , yTop= Ytop of the Icon +
 * height of the icon
 */
protected SVGCoordinates getStartIconExitArrowCoords() {
    int xLeft = 0;
    int yTop = 0;
    if (layoutManager.isVerticalLayout()) {
        xLeft = getStartIconXLeft() + (getStartIconWidth() / 2);
        yTop = getStartIconYTop() + getStartIconHeight();
    } else {
        xLeft = getStartIconXLeft() + getStartIconWidth();
        yTop = getStartIconYTop() + (getStartIconHeight() / 2);
    }
    SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);
    return coords;
}
Also used : SVGCoordinates(org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates)

Aggregations

Scope (org.wso2.carbon.apimgt.core.models.Scope)41 HashMap (java.util.HashMap)25 RestVariable (org.wso2.carbon.bpmn.rest.engine.variable.RestVariable)25 Test (org.testng.annotations.Test)23 APIManagementException (org.wso2.carbon.apimgt.core.exception.APIManagementException)19 Response (javax.ws.rs.core.Response)16 ScopeInfo (org.wso2.carbon.apimgt.core.auth.dto.ScopeInfo)15 FileInputStream (java.io.FileInputStream)14 API (org.wso2.carbon.apimgt.core.models.API)14 ArrayList (java.util.ArrayList)13 KeyManager (org.wso2.carbon.apimgt.core.api.KeyManager)13 ApiDAO (org.wso2.carbon.apimgt.core.dao.ApiDAO)13 Map (java.util.Map)12 APIGateway (org.wso2.carbon.apimgt.core.api.APIGateway)12 APIPublisher (org.wso2.carbon.apimgt.core.api.APIPublisher)12 GatewaySourceGenerator (org.wso2.carbon.apimgt.core.api.GatewaySourceGenerator)12 IdentityProvider (org.wso2.carbon.apimgt.core.api.IdentityProvider)11 RestResponseFactory (org.wso2.carbon.bpmn.rest.common.RestResponseFactory)11 ActivitiObjectNotFoundException (org.activiti.engine.ActivitiObjectNotFoundException)10 Scope (org.wso2.ballerinalang.compiler.semantics.model.Scope)10