BusinessWorks.startProcess()

Signature

long startProcess(String processName, Event input, String ruleFnURI, Object context)

Domain

action

Description

Starts a BusinessWorks process and executes asynchronously. Also initializes the process engine if it has not been already initialized. Upon completion invokes the RuleFunction to notify the return values. The BusinessWorks process that needs to be started should be a non-process starter and must return an Event in XML - meaning the End Activity's input must be selected from the BusinessEvents Event Schema.

Parameters

NameTypeDescription
processNameStringThe BusinessWorks process name. The process must not be a process starter
inputEventThe Event which is mapped one-to-one to the Input (Start Activity Input Type) BusinessWorks process. It can also be null
ruleFnURIStringThe rule function to invoke on completion of the BusinessWorks process. Completion status could be success or failure. The rule function must have the following signature and must be action only:

void ruleFn(long jobId, int status, Event outputEvent, Object closure);

  • jobId - The Id of the BusinessWorks Job that was completed
  • status - The status of the Job
  • outputEvent - The output of the BusinessWorks process. The End Activity of the BusinessWorks process must return an Event, or null
  • closure - The closure object that you passed along with the startProcess.

contextObjectAny closure object that you want to use with the startProcess. The closure will be sent as a parameter back to the rule function

Returns

TypeDescription
longA successful Job Id, which can be used for query status or cancellation of the Job

Cautions

none