AnsweredAssumed Answered

timerEventDefinition and process runs upon startup

Question asked by sanjiv on Jul 9, 2013
Latest reply on Jul 12, 2013 by sanjiv
I'm trying to setup a simple workflow that causes one of the API's on a bean be invoked at 3:30, 4:30 and 5:30pm.

I'm using the code below but what I'm seeign happen is that when the code runtimeService.startProcessInstanceByKey() is invoked, the process runs immediately as I see that mySerivce.process() is being invoked. I do not want it to be invoked immediately but rather only on the scheduled timeCycle.

Any suggestions?


Deployment deployment = repositoryService.createDeployment()

        Map<String, Object> variableMap = new HashMap<String, Object>();
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcessTimer", variableMap);

<definitions xmlns=""

    <process id="myProcessTimer" name="Scheduled Process">
        <startEvent id="timerstartevent1">
                <!–run at 3:30, 4:30 and 5:30 every weekday–>
                <timeCycle>0 30 15,16,17 ? * MON-FRI</timeCycle>

        <sequenceFlow id="flow1" sourceRef="timerstartevent1" targetRef="processVariationMargin"></sequenceFlow>

        <serviceTask id="processVariationMargin"