Refine search
ProcessValidator validator = ProcessValidatorRegistry.getInstance().getValidator(process, resource); if (validator == null) { logger.warn("Could not find validator for process {}.", ((Process)process).getType()); logger.warn("Continuing without validation of the process {} [{}]", process.getName(), process.getId()); } else { ProcessValidationError[] errors = validator.validateProcess( (WorkflowProcess) process ); String rules = "package " + process.getPackageName() + "\n"; PackageRegistry pkgRegistry = this.knowledgeBuilder.getOrCreatePackageRegistry(new PackageDescr(process.getPackageName())); if (pkgRegistry != null) { InternalKnowledgePackage p = pkgRegistry.getPackage(); processDescr.setName(process.getPackageName() + "." + process.getName()); processDescr.setResource( resource ); processDescr.setProcessId( process.getId() ); DialectCompiletimeRegistry dialectRegistry = pkgRegistry.getDialectCompiletimeRegistry(); Dialect dialect = dialectRegistry.getDialect( "java" ); Process duplicateProcess = rpkg.getRuleFlows().get(process.getId()); if (duplicateProcess != null) { Resource duplicatedResource = duplicateProcess.getResource(); if (resource == null || duplicatedResource == null || duplicatedResource.getSourcePath() == null || duplicatedResource.getSourcePath().equals(resource.getSourcePath())) { } else { this.errors.add( new ParserError( resource, "Process with same id already exists: " + process.getId(), -1,
@Override public void copyFromSource() { if (this.id != null) { return; } this.compositeId = System.getProperty("org.kie.server.id", "") + "_" + source.getId(); this.containerId = ((WorkflowProcessInstance)source).getDeploymentId(); this.correlationKey = ((WorkflowProcessInstanceImpl)source).getCorrelationKey(); this.date = new Date(); this.id = source.getId(); this.initiator = (String) ((WorkflowProcessInstanceImpl)source).getVariable("initiator"); this.parentId = source.getParentProcessInstanceId(); this.processId = source.getProcessId(); this.processInstanceDescription = ((WorkflowProcessInstanceImpl)source).getDescription(); this.processName = source.getProcessName(); this.processVersion = source.getProcess().getVersion(); this.state = source.getState(); this.variables = ((WorkflowProcessInstanceImpl)source).getVariables(); }
public void afterProcessStarted(ProcessStartedEvent event) { logger.debug("after process"); Map<String, Object> metaData = event.getProcessInstance().getProcess().getMetaData(); for (Map.Entry<String, Object> entry: metaData.entrySet()) { logger.debug(entry.getKey() + " " + entry.getValue()); } String customTag = (String) metaData.get("customTagProcess"); if (customTag != null) { list4.add(customTag); } } });
public static String findLatestProcessByName(Collection<Process> processes, final String processName, Comparator<Process> comparator) { if (processes == null || processName == null) { return null; } Process highestVersionProcess = Collections.max(processes, comparator); if (highestVersionProcess != null && processName.equals(highestVersionProcess.getName())) { return highestVersionProcess.getId(); } return null; }
public int compare(Process o1, Process o2) { // first match by process name if (o1.getName().equals(processName) && o2.getName().equals(processName)) { // then match on version try { if( o1.getVersion() != null && o2.getVersion() != null ) { if ((Double.valueOf(o1.getVersion()) > Double.valueOf(o2.getVersion()))) { return 1; } else { return -1; } } else if( o1.getVersion() != null ) { return 1; } else { return o1.getId().compareTo(o2.getId()); } } catch (NumberFormatException e) { throw new IllegalArgumentException("Could not parse version: " + o1.getVersion() + " " + o2.getVersion(), e); } } else if (o1.getName().equals(processName)) { return 1; } return -1; } }
public String getDescription() { if (description == null) { description = process.getName(); if (process != null) { Object metaData = process.getMetaData().get("customDescription"); if (metaData instanceof String) { String customDescription = (String) metaData;
null, this.env ); context.setProcessInstanceId(processInstance.getId()); context.setState(processInstance.getState() == ProcessInstance.STATE_ACTIVE ? ProcessMarshallerWriteContext.STATE_ACTIVE:ProcessMarshallerWriteContext.STATE_COMPLETED); String processType = ((ProcessInstanceImpl) processInstance).getProcess().getType(); saveProcessInstanceType( context, processInstance, } catch ( IOException e ) { throw new IllegalArgumentException( "IOException while storing process instance " + processInstance.getId() + ": " + e.getMessage(), e );
SimulationInfo simInfo = simContext.getRepository().getSimulationInfo(); if (simInfo != null) { simInfo.setProcessName(session.getKieBase().getProcess(processId).getName()); simInfo.setProcessVersion(session.getKieBase().getProcess(processId).getVersion()); if (!instances.isEmpty()) { pi = instances.get(0); instanceId = session.getIdentifier()+pi.getId(); instanceId = session.getIdentifier()+pi.getId(); pi.getProcessName(), pi.getProcess().getVersion()));
public SimulationEvent simulate(Object activity, SimulationContext context) { NodeInstance nodeInstance = (NodeInstance) activity; long startTime = context.getClock().getCurrentTime(); ProcessInstance pi = nodeInstance.getProcessInstance(); Node node = nodeInstance.getNode(); String bpmn2NodeId = (String) node.getMetaData().get("UniqueId"); String processName = pi.getProcessName(); String processVer = pi.getProcess().getVersion(); if (processVer == null) { processVer = ""; } // set end time for processinstance end time context.setMaxEndTime(context.getClock().getCurrentTime()); return new EndSimulationEvent(pi.getProcessId(), context.getProcessInstanceId(), startTime, context.getClock().getCurrentTime(), context.getStartTime(), bpmn2NodeId, node.getName(), processName, processVer); }
public void setProcess(final Process process) { this.processId = process.getId(); this.process = ( Process ) process; }
return new ProcessDesc(process.getId(), process.getName(), process.getVersion() , process.getPackageName(), process.getType(), process.getKnowledgeType().name(), process.getNamespace(), "");
.setParameter("depId", migrationSpec.getToDeploymentId()) .setParameter("procId", migrationSpec.getToProcessId()) .setParameter("procName", toBeProcess.getName()) .setParameter("procVersion", toBeProcess.getVersion()) .setParameter("procInstanceId", migrationSpec.getProcessInstanceId());
addReferencedResourcesToIndexBuilder(builder, processData); builder.setPackageName(processData.getProcess().getPackageName()); errors = validator.validateProcess(process); if (errors.length > 0) { logger.error("Trying to finish indexing process '" + process.getId() + "/" + process.getName() + "' despite " + errors.length + " validation errors."); AbstractBpmnProcessDataEventListener helper = (AbstractBpmnProcessDataEventListener) process.getMetaData().get(getProcessDescriptorName()); addReferencedResourcesToIndexBuilder(builder, helper);
if (session != null) { if (session.getProcessInstance(workItem.getProcessInstanceId()) != null) { taskData.setProcessId(session.getProcessInstance(workItem.getProcessInstanceId()).getProcess().getId()); String deploymentId = ((WorkItemImpl) workItem).getDeploymentId(); taskData.setDeploymentId(deploymentId);
public String getProcessName() { return getProcess().getName(); }
public void writeProcessInstances(MarshallerWriteContext context) throws IOException { ProtobufMessages.ProcessData.Builder _pdata = (ProtobufMessages.ProcessData.Builder) context.parameterObject; List<org.kie.api.runtime.process.ProcessInstance> processInstances = new ArrayList<org.kie.api.runtime.process.ProcessInstance>( context.wm.getProcessInstances() ); Collections.sort( processInstances, new Comparator<org.kie.api.runtime.process.ProcessInstance>() { public int compare(org.kie.api.runtime.process.ProcessInstance o1, org.kie.api.runtime.process.ProcessInstance o2) { return (int) (o1.getId() - o2.getId()); } } ); for ( org.kie.api.runtime.process.ProcessInstance processInstance : processInstances ) { String processType = processInstance.getProcess().getType(); JBPMMessages.ProcessInstance _instance = (JBPMMessages.ProcessInstance) ProcessMarshallerRegistry.INSTANCE.getMarshaller( processType ) .writeProcessInstance( context, processInstance ); _pdata.addExtension( JBPMMessages.processInstance, _instance ); } }
@Override public void onProcessAdded(Process process) { logger.debug("Added process with id {} and name {}", process.getId(), process.getName()); this.process = process; resource = addResource(process.getId(), getProcessIdResourceType()); addResource(process.getName(), getProcessNameResourceType()); //add process descriptor as process meta data process.getMetaData().put(getProcessDescriptorName(), this); }
@Override public boolean accept(Process process, Resource resource) { if (RuleFlowProcess.RULEFLOW_TYPE.equals(process.getType())) { return true; } return false; }
protected void collectTypes(String key, AnalysisResult analysis, ProcessBuildContext context) { if (context.getProcess() != null) { Set<String> referencedTypes = new HashSet<String>(); MVELAnalysisResult mvelAnalysis = (MVELAnalysisResult) analysis; for( Class<?> varClass : mvelAnalysis.getMvelVariables().values() ) { referencedTypes.add(varClass.getCanonicalName()); } context.getProcess().getMetaData().put(key + "ReferencedTypes", referencedTypes); } } }
public String getVersion() { return delegate.getVersion(); }