06-02-2009 03:24 AM
<node name="notifyERP">
<event type="node-enter">
<action class="manageoffice.workflows.Demobase" />
</event>
<transition to="end1"></transition>
</node>
public class Demobase implements ActionHandler, configurationModule {
private static final Logger logger = Logger.getLogger(Demobase.class);
private BeanFactory factory;
public Demobase() {
super();
}
@Override
public void execute(ExecutionContext executionContext) throws Exception {
if (logger.isDebugEnabled()) {
logger.info("Will notified ERP Database");
}
???
…
06-18-2009 06:32 PM
ContextInstance contextInstance = executionContext.getContextInstance();
JBPMNode jbpmNode = (JBPMNode) contextInstance.getVariable("bpm_package"); // there might be a constant that has this somewhere
NodeRef packageNodeRef = jbpmNode.getNodeRef();
List<ChildAssociationRef> childRefList = nodeService.getChildAssocs(packageNodeRef);
for (ChildAssociationRef childAssocRef : childRefList) {
// do something with each document in the workflow package
NodeRef nodeRef = childAssocRef.getChildRef()
}
06-19-2009 02:53 AM
08-19-2009 09:28 AM
02-09-2012 07:33 AM
List<WorkflowPath> paths = workflowService.getWorkflowPaths(workflowId);
List<NodeRef> nodeAnnexes = new ArrayList<NodeRef>();
for (WorkflowPath path : paths) {
List<WorkflowTask> tasks = workflowService.getTasksForWorkflowPath(path.getId());
for (WorkflowTask task : tasks){
List<NodeRef> nodeRefs = workflowService.getPackageContents(task.getId());
for (NodeRef nodeRef : nodeRefs){
boolean ignoreBecauseSame=false;
for (NodeRef n : nodeAnnexes){
// Avoid to get same document
if (n.getStoreRef().equals(nodeRef.getStoreRef())){
logger.debug("SAME");
ignoreBecauseSame=true;
break;
}
}
if (!ignoreBecauseSame){
nodeAnnexes.add(nodeRef);
logger.debug(nameOfNode);
// Can execute actions with the document attached to the workflow…
// …
}
}
}
}
02-14-2012 07:41 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.