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);
}
}
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;
}
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);
}
}
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;
}
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;
}
Aggregations