public SkipTaskRequest fromProto(SkipTaskRequestPb.SkipTaskRequest from) { SkipTaskRequest to = new SkipTaskRequest(); Map<String, Object> taskInputMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getTaskInputMap().entrySet()) { taskInputMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setTaskInput(taskInputMap); Map<String, Object> taskOutputMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getTaskOutputMap().entrySet()) { taskOutputMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setTaskOutput(taskOutputMap); if (from.hasTaskInputMessage()) { to.setTaskInputMessage( fromProto( from.getTaskInputMessage() ) ); } if (from.hasTaskOutputMessage()) { to.setTaskOutputMessage( fromProto( from.getTaskOutputMessage() ) ); } return to; }
public DynamicForkJoinTaskListPb.DynamicForkJoinTaskList toProto(DynamicForkJoinTaskList from) { DynamicForkJoinTaskListPb.DynamicForkJoinTaskList.Builder to = DynamicForkJoinTaskListPb.DynamicForkJoinTaskList.newBuilder(); for (DynamicForkJoinTask elem : from.getDynamicTasks()) { to.addDynamicTasks( toProto(elem) ); } return to.build(); }
public EventHandlerPb.EventHandler.Action toProto(EventHandler.Action from) { EventHandlerPb.EventHandler.Action.Builder to = EventHandlerPb.EventHandler.Action.newBuilder(); if (from.getAction() != null) { to.setAction( toProto( from.getAction() ) ); } if (from.getStart_workflow() != null) { to.setStartWorkflow( toProto( from.getStart_workflow() ) ); } if (from.getComplete_task() != null) { to.setCompleteTask( toProto( from.getComplete_task() ) ); } if (from.getFail_task() != null) { to.setFailTask( toProto( from.getFail_task() ) ); } to.setExpandInlineJson( from.isExpandInlineJSON() ); return to.build(); }
public RerunWorkflowRequest fromProto(RerunWorkflowRequestPb.RerunWorkflowRequest from) { RerunWorkflowRequest to = new RerunWorkflowRequest(); to.setReRunFromWorkflowId( from.getReRunFromWorkflowId() ); Map<String, Object> workflowInputMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getWorkflowInputMap().entrySet()) { workflowInputMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setWorkflowInput(workflowInputMap); to.setReRunFromTaskId( from.getReRunFromTaskId() ); Map<String, Object> taskInputMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getTaskInputMap().entrySet()) { taskInputMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setTaskInput(taskInputMap); to.setCorrelationId( from.getCorrelationId() ); return to; }
public RerunWorkflowRequestPb.RerunWorkflowRequest toProto(RerunWorkflowRequest from) { RerunWorkflowRequestPb.RerunWorkflowRequest.Builder to = RerunWorkflowRequestPb.RerunWorkflowRequest.newBuilder(); if (from.getReRunFromWorkflowId() != null) { to.setReRunFromWorkflowId( from.getReRunFromWorkflowId() ); } for (Map.Entry<String, Object> pair : from.getWorkflowInput().entrySet()) { to.putWorkflowInput( pair.getKey(), toProto( pair.getValue() ) ); } if (from.getReRunFromTaskId() != null) { to.setReRunFromTaskId( from.getReRunFromTaskId() ); } for (Map.Entry<String, Object> pair : from.getTaskInput().entrySet()) { to.putTaskInput( pair.getKey(), toProto( pair.getValue() ) ); } if (from.getCorrelationId() != null) { to.setCorrelationId( from.getCorrelationId() ); } return to.build(); }
public EventHandler.TaskDetails fromProto(EventHandlerPb.EventHandler.TaskDetails from) { EventHandler.TaskDetails to = new EventHandler.TaskDetails(); to.setWorkflowId( from.getWorkflowId() ); to.setTaskRefName( from.getTaskRefName() ); Map<String, Object> outputMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getOutputMap().entrySet()) { outputMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setOutput(outputMap); if (from.hasOutputMessage()) { to.setOutputMessage( fromProto( from.getOutputMessage() ) ); } to.setTaskId( from.getTaskId() ); return to; }
public EventHandlerPb.EventHandler.TaskDetails toProto(EventHandler.TaskDetails from) { EventHandlerPb.EventHandler.TaskDetails.Builder to = EventHandlerPb.EventHandler.TaskDetails.newBuilder(); if (from.getWorkflowId() != null) { to.setWorkflowId( from.getWorkflowId() ); } if (from.getTaskRefName() != null) { to.setTaskRefName( from.getTaskRefName() ); } for (Map.Entry<String, Object> pair : from.getOutput().entrySet()) { to.putOutput( pair.getKey(), toProto( pair.getValue() ) ); } if (from.getOutputMessage() != null) { to.setOutputMessage( toProto( from.getOutputMessage() ) ); } if (from.getTaskId() != null) { to.setTaskId( from.getTaskId() ); } return to.build(); }
public EventHandler.Action fromProto(EventHandlerPb.EventHandler.Action from) { EventHandler.Action to = new EventHandler.Action(); to.setAction( fromProto( from.getAction() ) ); if (from.hasStartWorkflow()) { to.setStart_workflow( fromProto( from.getStartWorkflow() ) ); } if (from.hasCompleteTask()) { to.setComplete_task( fromProto( from.getCompleteTask() ) ); } if (from.hasFailTask()) { to.setFail_task( fromProto( from.getFailTask() ) ); } to.setExpandInlineJSON( from.getExpandInlineJson() ); return to; }
public EventHandlerPb.EventHandler.StartWorkflow toProto(EventHandler.StartWorkflow from) { EventHandlerPb.EventHandler.StartWorkflow.Builder to = EventHandlerPb.EventHandler.StartWorkflow.newBuilder(); if (from.getName() != null) { to.setName( from.getName() ); } if (from.getVersion() != null) { to.setVersion( from.getVersion() ); } if (from.getCorrelationId() != null) { to.setCorrelationId( from.getCorrelationId() ); } for (Map.Entry<String, Object> pair : from.getInput().entrySet()) { to.putInput( pair.getKey(), toProto( pair.getValue() ) ); } if (from.getInputMessage() != null) { to.setInputMessage( toProto( from.getInputMessage() ) ); } to.putAllTaskToDomain( from.getTaskToDomain() ); return to.build(); }
public DynamicForkJoinTask fromProto(DynamicForkJoinTaskPb.DynamicForkJoinTask from) { DynamicForkJoinTask to = new DynamicForkJoinTask(); to.setTaskName( from.getTaskName() ); to.setWorkflowName( from.getWorkflowName() ); to.setReferenceName( from.getReferenceName() ); Map<String, Object> inputMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getInputMap().entrySet()) { inputMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setInput(inputMap); to.setType( from.getType() ); return to; }
public EventExecutionPb.EventExecution toProto(EventExecution from) { EventExecutionPb.EventExecution.Builder to = EventExecutionPb.EventExecution.newBuilder(); if (from.getId() != null) { to.setId( from.getId() ); } if (from.getMessageId() != null) { to.setMessageId( from.getMessageId() ); } if (from.getName() != null) { to.setName( from.getName() ); } if (from.getEvent() != null) { to.setEvent( from.getEvent() ); } to.setCreated( from.getCreated() ); if (from.getStatus() != null) { to.setStatus( toProto( from.getStatus() ) ); } if (from.getAction() != null) { to.setAction( toProto( from.getAction() ) ); } for (Map.Entry<String, Object> pair : from.getOutput().entrySet()) { to.putOutput( pair.getKey(), toProto( pair.getValue() ) ); } return to.build(); }
public EventExecution fromProto(EventExecutionPb.EventExecution from) { EventExecution to = new EventExecution(); to.setId( from.getId() ); to.setMessageId( from.getMessageId() ); to.setName( from.getName() ); to.setEvent( from.getEvent() ); to.setCreated( from.getCreated() ); to.setStatus( fromProto( from.getStatus() ) ); to.setAction( fromProto( from.getAction() ) ); Map<String, Object> outputMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getOutputMap().entrySet()) { outputMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setOutput(outputMap); return to; }
public TaskResultPb.TaskResult toProto(TaskResult from) { TaskResultPb.TaskResult.Builder to = TaskResultPb.TaskResult.newBuilder(); if (from.getWorkflowInstanceId() != null) { to.setWorkflowInstanceId( from.getWorkflowInstanceId() ); } if (from.getTaskId() != null) { to.setTaskId( from.getTaskId() ); } if (from.getReasonForIncompletion() != null) { to.setReasonForIncompletion( from.getReasonForIncompletion() ); } to.setCallbackAfterSeconds( from.getCallbackAfterSeconds() ); if (from.getWorkerId() != null) { to.setWorkerId( from.getWorkerId() ); } if (from.getStatus() != null) { to.setStatus( toProto( from.getStatus() ) ); } for (Map.Entry<String, Object> pair : from.getOutputData().entrySet()) { to.putOutputData( pair.getKey(), toProto( pair.getValue() ) ); } if (from.getOutputMessage() != null) { to.setOutputMessage( toProto( from.getOutputMessage() ) ); } return to.build(); }
public EventHandler.StartWorkflow fromProto(EventHandlerPb.EventHandler.StartWorkflow from) { EventHandler.StartWorkflow to = new EventHandler.StartWorkflow(); to.setName( from.getName() ); to.setVersion( from.getVersion() ); to.setCorrelationId( from.getCorrelationId() ); Map<String, Object> inputMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getInputMap().entrySet()) { inputMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setInput(inputMap); if (from.hasInputMessage()) { to.setInputMessage( fromProto( from.getInputMessage() ) ); } to.setTaskToDomain( from.getTaskToDomainMap() ); return to; }
public StartWorkflowRequestPb.StartWorkflowRequest toProto(StartWorkflowRequest from) { StartWorkflowRequestPb.StartWorkflowRequest.Builder to = StartWorkflowRequestPb.StartWorkflowRequest.newBuilder(); if (from.getName() != null) { to.setName( from.getName() ); } if (from.getVersion() != null) { to.setVersion( from.getVersion() ); } if (from.getCorrelationId() != null) { to.setCorrelationId( from.getCorrelationId() ); } for (Map.Entry<String, Object> pair : from.getInput().entrySet()) { to.putInput( pair.getKey(), toProto( pair.getValue() ) ); } to.putAllTaskToDomain( from.getTaskToDomain() ); if (from.getWorkflowDef() != null) { to.setWorkflowDef( toProto( from.getWorkflowDef() ) ); } if (from.getExternalInputPayloadStoragePath() != null) { to.setExternalInputPayloadStoragePath( from.getExternalInputPayloadStoragePath() ); } return to.build(); }
public TaskResult fromProto(TaskResultPb.TaskResult from) { TaskResult to = new TaskResult(); to.setWorkflowInstanceId( from.getWorkflowInstanceId() ); to.setTaskId( from.getTaskId() ); to.setReasonForIncompletion( from.getReasonForIncompletion() ); to.setCallbackAfterSeconds( from.getCallbackAfterSeconds() ); to.setWorkerId( from.getWorkerId() ); to.setStatus( fromProto( from.getStatus() ) ); Map<String, Object> outputDataMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getOutputDataMap().entrySet()) { outputDataMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setOutputData(outputDataMap); if (from.hasOutputMessage()) { to.setOutputMessage( fromProto( from.getOutputMessage() ) ); } return to; }
public DynamicForkJoinTaskPb.DynamicForkJoinTask toProto(DynamicForkJoinTask from) { DynamicForkJoinTaskPb.DynamicForkJoinTask.Builder to = DynamicForkJoinTaskPb.DynamicForkJoinTask.newBuilder(); if (from.getTaskName() != null) { to.setTaskName( from.getTaskName() ); } if (from.getWorkflowName() != null) { to.setWorkflowName( from.getWorkflowName() ); } if (from.getReferenceName() != null) { to.setReferenceName( from.getReferenceName() ); } for (Map.Entry<String, Object> pair : from.getInput().entrySet()) { to.putInput( pair.getKey(), toProto( pair.getValue() ) ); } if (from.getType() != null) { to.setType( from.getType() ); } return to.build(); }
public StartWorkflowRequest fromProto(StartWorkflowRequestPb.StartWorkflowRequest from) { StartWorkflowRequest to = new StartWorkflowRequest(); to.setName( from.getName() ); to.setVersion( from.getVersion() ); to.setCorrelationId( from.getCorrelationId() ); Map<String, Object> inputMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getInputMap().entrySet()) { inputMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setInput(inputMap); to.setTaskToDomain( from.getTaskToDomainMap() ); if (from.hasWorkflowDef()) { to.setWorkflowDef( fromProto( from.getWorkflowDef() ) ); } to.setExternalInputPayloadStoragePath( from.getExternalInputPayloadStoragePath() ); return to; }
public WorkflowDefPb.WorkflowDef toProto(WorkflowDef from) { WorkflowDefPb.WorkflowDef.Builder to = WorkflowDefPb.WorkflowDef.newBuilder(); if (from.getName() != null) { to.setName( from.getName() ); } if (from.getDescription() != null) { to.setDescription( from.getDescription() ); } to.setVersion( from.getVersion() ); for (WorkflowTask elem : from.getTasks()) { to.addTasks( toProto(elem) ); } to.addAllInputParameters( from.getInputParameters() ); for (Map.Entry<String, Object> pair : from.getOutputParameters().entrySet()) { to.putOutputParameters( pair.getKey(), toProto( pair.getValue() ) ); } if (from.getFailureWorkflow() != null) { to.setFailureWorkflow( from.getFailureWorkflow() ); } to.setSchemaVersion( from.getSchemaVersion() ); to.setRestartable( from.isRestartable() ); to.setWorkflowStatusListenerEnabled( from.isWorkflowStatusListenerEnabled() ); return to.build(); }
public WorkflowDef fromProto(WorkflowDefPb.WorkflowDef from) { WorkflowDef to = new WorkflowDef(); to.setName( from.getName() ); to.setDescription( from.getDescription() ); to.setVersion( from.getVersion() ); to.setTasks( from.getTasksList().stream().map(this::fromProto).collect(Collectors.toCollection(ArrayList::new)) ); to.setInputParameters( from.getInputParametersList().stream().collect(Collectors.toCollection(ArrayList::new)) ); Map<String, Object> outputParametersMap = new HashMap<String, Object>(); for (Map.Entry<String, Value> pair : from.getOutputParametersMap().entrySet()) { outputParametersMap.put( pair.getKey(), fromProto( pair.getValue() ) ); } to.setOutputParameters(outputParametersMap); to.setFailureWorkflow( from.getFailureWorkflow() ); to.setSchemaVersion( from.getSchemaVersion() ); to.setRestartable( from.getRestartable() ); to.setWorkflowStatusListenerEnabled( from.getWorkflowStatusListenerEnabled() ); return to; }