Search in sources :

Example 41 with Start

use of org.wso2.carbon.humantask.core.engine.commands.Start in project charon by wso2.

the class ListedResource method setStartIndex.

/*
     *  paginated listed resource start index settings
     * @param startIndex
     */
public void setStartIndex(int startIndex) {
    if (!isAttributeExist(SCIMConstants.ListedResourceSchemaConstants.START_INDEX)) {
        SimpleAttribute totalResultsAttribute = new SimpleAttribute(SCIMConstants.ListedResourceSchemaConstants.START_INDEX, startIndex);
        // No need to let the Default attribute factory to handle the attribute, as this is
        // not officially defined as SCIM attribute, hence have no charactersitics defined
        // TODO: may be we can let the default attribute factory to handle it?
        attributeList.put(SCIMConstants.ListedResourceSchemaConstants.START_INDEX, totalResultsAttribute);
    } else {
        ((SimpleAttribute) attributeList.get(SCIMConstants.ListedResourceSchemaConstants.START_INDEX)).setValue(startIndex);
    }
}
Also used : SimpleAttribute(org.wso2.charon3.core.attributes.SimpleAttribute)

Example 42 with Start

use of org.wso2.carbon.humantask.core.engine.commands.Start in project carbon-business-process by wso2.

the class HumanTaskServer method initScheduler.

/**
 * Scheduler initialisation.
 */
private void initScheduler() {
    ThreadFactory threadFactory = new ThreadFactory() {

        private int threadNumber = 0;

        public Thread newThread(Runnable r) {
            threadNumber += 1;
            Thread t = new Thread(r, "HumanTaskServer-" + threadNumber);
            t.setDaemon(true);
            return t;
        }
    };
    ExecutorService executorService = Executors.newFixedThreadPool(serverConfig.getThreadPoolMaxSize(), threadFactory);
    SimpleScheduler simpleScheduler = new SimpleScheduler(new GUID().toString());
    simpleScheduler.setExecutorService(executorService);
    simpleScheduler.setTransactionManager(tnxManager);
    taskEngine.setScheduler(simpleScheduler);
    simpleScheduler.setJobProcessor(new JobProcessorImpl());
    // Start the scheduler within the HumanTaskSchedulerInitializer to ensure that all the tasks are deployed
    // when the scheduler actually starts.
    // simpleScheduler.start();
    scheduler = simpleScheduler;
}
Also used : ThreadFactory(java.util.concurrent.ThreadFactory) ExecutorService(java.util.concurrent.ExecutorService) GUID(org.wso2.carbon.humantask.core.utils.GUID) SimpleScheduler(org.wso2.carbon.humantask.core.scheduler.SimpleScheduler) JobProcessorImpl(org.wso2.carbon.humantask.core.scheduler.JobProcessorImpl)

Example 43 with Start

use of org.wso2.carbon.humantask.core.engine.commands.Start in project carbon-business-process by wso2.

the class TaskOperationsImpl method start.

/**
 * Start the task
 * @param taskId : task identifier
 * @throws IllegalStateFault
 * @throws IllegalOperationFault
 * @throws IllegalArgumentFault
 * @throws IllegalAccessFault
 */
public void start(final URI taskId) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
    try {
        validateTaskId(taskId);
        HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {

            public Object call() throws Exception {
                Start startCommand = new Start(getCaller(), new Long(taskId.toString()));
                startCommand.execute();
                return null;
            }
        });
    } catch (Exception ex) {
        handleException(ex);
    }
}
Also used : Start(org.wso2.carbon.humantask.core.engine.commands.Start) HumanTaskIllegalArgumentException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalArgumentException) RegistryException(org.wso2.carbon.registry.core.exceptions.RegistryException) HumanTaskIllegalStateException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalStateException) HumanTaskIllegalOperationException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalOperationException) UserStoreException(org.wso2.carbon.user.core.UserStoreException) HumanTaskException(org.wso2.carbon.humantask.core.engine.HumanTaskException) HumanTaskIllegalAccessException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalAccessException) HumanTaskRuntimeException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException)

Example 44 with Start

use of org.wso2.carbon.humantask.core.engine.commands.Start 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)

Example 45 with Start

use of org.wso2.carbon.humantask.core.engine.commands.Start in project carbon-business-process by wso2.

the class ScopeImpl method getStartTerminationCoords.

/**
 * At the start: xLeft=0, yTop=0
 * Calculates the coordinates of the start arrow of the TerminationHandler
 *
 * @return coordinates of the start arrow of the TerminationHandler
 */
protected SVGCoordinates getStartTerminationCoords() {
    int xLeft = 0;
    int yTop = 0;
    if (layoutManager.isVerticalLayout()) {
        xLeft = getCoreDimensions().getXLeft() + getCoreDimensions().getWidth();
        yTop = getCoreDimensions().getYTop() + getHandlerIconHeight() + (getHandlerConnectorSpacing() * 2) + (getYSpacing() / 2);
    } else {
        xLeft = getCoreDimensions().getXLeft() + getHandlerIconWidth() + (getHandlerConnectorSpacing() * 2) + (getYSpacing() / 2);
        yTop = getCoreDimensions().getYTop() + getCoreDimensions().getHeight();
    }
    // Returns the calculated coordinate points of the start arrow of the TerminationHandler
    SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);
    return coords;
}
Also used : SVGCoordinates(org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates)

Aggregations

SVGCoordinates (org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates)57 ActivityInterface (org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface)47 Test (org.testng.annotations.Test)17 SiddhiAppRuntime (org.wso2.siddhi.core.SiddhiAppRuntime)17 SiddhiManager (org.wso2.siddhi.core.SiddhiManager)17 Event (org.wso2.siddhi.core.event.Event)17 InputHandler (org.wso2.siddhi.core.stream.input.InputHandler)13 SVGDimension (org.wso2.carbon.bpel.ui.bpel2svg.SVGDimension)11 StreamEventPool (org.wso2.siddhi.core.event.stream.StreamEventPool)11 ArrayList (java.util.ArrayList)10 OMElement (org.apache.axiom.om.OMElement)10 DiagnosticPos (org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos)10 Element (org.w3c.dom.Element)9 StreamCallback (org.wso2.siddhi.core.stream.output.StreamCallback)9 TopLevelNode (org.ballerinalang.model.tree.TopLevelNode)7 APIManagementException (org.wso2.carbon.apimgt.core.exception.APIManagementException)7 ZoneId (java.time.ZoneId)5 HashMap (java.util.HashMap)5 Analyzer (org.wso2.carbon.apimgt.core.api.Analyzer)5 ErrorDTO (org.wso2.carbon.apimgt.rest.api.common.dto.ErrorDTO)5